Added initial files
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
tiny0/__pycache__
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
flask==1.1.2
|
||||||
|
flask-sqlalchemy==2.4.4
|
||||||
|
flask-wtf==0.14.3
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
from tiny0 import app
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app.run(debug=True)
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
from flask import Flask
|
||||||
|
from flask_sqlalchemy import SQLAlchemy
|
||||||
|
from tiny0.config import SECRET_KEY, SQLALCHEMY_DATABASE_URI
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
app.config['SECRET_KEY'] = SECRET_KEY
|
||||||
|
app.config['SQLALCHEMY_DATABASE_URI'] = SQLALCHEMY_DATABASE_URI
|
||||||
|
|
||||||
|
db = SQLAlchemy(app)
|
||||||
|
|
||||||
|
from tiny0 import routes
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"SECRET_KEY": "SECRET_KEY",
|
||||||
|
"SQLALCHEMY_DATABASE_URI": "sqlite:///database.db"
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import json
|
||||||
|
|
||||||
|
with open("tiny0/config.json", "r") as config_file:
|
||||||
|
|
||||||
|
config_data = json.load(config_file)
|
||||||
|
|
||||||
|
SECRET_KEY = config_data.get("SECRET_KEY")
|
||||||
|
SQLALCHEMY_DATABASE_URI = config_data.get("SQLALCHEMY_DATABASE_URI")
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
from flask_wtf import FlaskForm
|
||||||
|
from wtforms import StringField, SubmitField
|
||||||
|
from wtforms.validators import DataRequired, Length, URL
|
||||||
|
|
||||||
|
'''
|
||||||
|
|
||||||
|
Declaration of forms
|
||||||
|
|
||||||
|
'''
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
from tiny0 import db
|
||||||
|
|
||||||
|
'''
|
||||||
|
|
||||||
|
Declaration of models
|
||||||
|
|
||||||
|
'''
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
from flask import render_template, redirect, request, flash, url_for
|
||||||
|
from tiny0 import app
|
||||||
|
#from tiny0.forms import URLForm
|
||||||
|
#from tiny0.models import URLs
|
||||||
|
#from token import gen_valid_token
|
||||||
|
|
||||||
|
@app.route("/")
|
||||||
|
def index():
|
||||||
|
return "Hello, world!"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
#from tiny0.models import URLs
|
||||||
|
from secrets import choice
|
||||||
|
|
||||||
|
'''
|
||||||
|
|
||||||
|
Generate valid token
|
||||||
|
|
||||||
|
'''
|
||||||
Reference in New Issue
Block a user