Added initial files

This commit is contained in:
xemeds
2020-07-18 13:10:03 +00:00
parent d212259c57
commit c783e7792a
10 changed files with 65 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
tiny0/__pycache__
+3
View File
@@ -0,0 +1,3 @@
flask==1.1.2
flask-sqlalchemy==2.4.4
flask-wtf==0.14.3
+4
View File
@@ -0,0 +1,4 @@
from tiny0 import app
if __name__ == '__main__':
app.run(debug=True)
+12
View File
@@ -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
+4
View File
@@ -0,0 +1,4 @@
{
"SECRET_KEY": "SECRET_KEY",
"SQLALCHEMY_DATABASE_URI": "sqlite:///database.db"
}
+8
View File
@@ -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")
+9
View File
@@ -0,0 +1,9 @@
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField
from wtforms.validators import DataRequired, Length, URL
'''
Declaration of forms
'''
+7
View File
@@ -0,0 +1,7 @@
from tiny0 import db
'''
Declaration of models
'''
+9
View File
@@ -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!"
+8
View File
@@ -0,0 +1,8 @@
#from tiny0.models import URLs
from secrets import choice
'''
Generate valid token
'''