from flask import Flask, render_template, url_for, request, redirect, Response, abort, session from flask_sqlalchemy import SQLAlchemy from werkzeug.middleware.proxy_fix import ProxyFix from datetime import datetime import magic import random import string app = Flask(__name__) app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1) app.secret_key = '029c0gji3jfo3o8h938vhwtfmh3t39th' app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///cloudvars.db' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(app) class variables(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) namespace = db.Column(db.String(64), nullable=False) project = db.Column(db.String(64), nullable=False) name = db.Column(db.String(64), nullable=False) value = db.Column(db.String(64), nullable=True) @app.context_processor def get_date(): date = datetime.now() return { "now": date.strftime("%Y-%m-%d") } @app.route('/', methods = ['GET']) def index(): return render_template('index.html') if __name__ == "__main__": app.run(debug=True)