diff --git a/.flaskenv b/.flaskenv new file mode 100644 index 0000000..0dbded6 --- /dev/null +++ b/.flaskenv @@ -0,0 +1 @@ +FLASK_APP=app:app \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..80adff4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.env +**/__pycache__/ +.idea/ \ No newline at end of file diff --git a/main.py b/app/__init__.py similarity index 88% rename from main.py rename to app/__init__.py index 8e1c45c..d4d45d0 100644 --- a/main.py +++ b/app/__init__.py @@ -1,8 +1,10 @@ +from dotenv import load_dotenv from flask import Flask, url_for, render_template import os import json import numpy.random as gaussian_rnd +load_dotenv() """.. ..,.,,,. . . . . . ....... ...,%&%/,.. .... .*#&&%*... .... . . .. .. @@ -39,9 +41,6 @@ import numpy.random as gaussian_rnd app = Flask(__name__, subdomain_matching=True) -with open('config/json/main.json') as file: - main_cfg_data = json.loads(file.read()) -app.config['SERVER_NAME'] = f"{main_cfg_data['hosts']['server_name']}:{main_cfg_data['hosts']['port']}" def generate_iq(): @@ -68,17 +67,10 @@ def index(): data = json.loads(file.read()) cols = data['cols'] projects = data['projects'] - return render_template('index.html', random_number=generate_iq(), projects=projects, texlink=f"{main_cfg_data['hosts']['texlink']}:{main_cfg_data['hosts']['texport']}") + return render_template('index.html', random_number=generate_iq(), projects=projects, + texlink=os.getenv('TEXURL')) @app.route('/', subdomain='tex') def texindex(): return render_template('texindex.html') - - -def main(): - app.run(f"{main_cfg_data['hosts']['host']}", f"{main_cfg_data['hosts']['host_port']}") - - -if __name__ == '__main__': - main() diff --git a/static/assets/css/fonts.css b/app/static/assets/css/fonts.css similarity index 100% rename from static/assets/css/fonts.css rename to app/static/assets/css/fonts.css diff --git a/static/assets/css/style.css b/app/static/assets/css/style.css similarity index 100% rename from static/assets/css/style.css rename to app/static/assets/css/style.css diff --git a/static/assets/css/teststyle.css b/app/static/assets/css/teststyle.css similarity index 100% rename from static/assets/css/teststyle.css rename to app/static/assets/css/teststyle.css diff --git a/static/assets/images/chatmanager.png b/app/static/assets/images/chatmanager.png similarity index 100% rename from static/assets/images/chatmanager.png rename to app/static/assets/images/chatmanager.png diff --git a/static/assets/images/soon.jpg b/app/static/assets/images/soon.jpg similarity index 100% rename from static/assets/images/soon.jpg rename to app/static/assets/images/soon.jpg diff --git a/static/assets/images/thissite.png b/app/static/assets/images/thissite.png similarity index 100% rename from static/assets/images/thissite.png rename to app/static/assets/images/thissite.png diff --git a/static/js/projects.js b/app/static/js/projects.js similarity index 100% rename from static/js/projects.js rename to app/static/js/projects.js diff --git a/templates/index.html b/app/templates/index.html similarity index 94% rename from templates/index.html rename to app/templates/index.html index 69ed550..7dedacb 100644 --- a/templates/index.html +++ b/app/templates/index.html @@ -12,7 +12,7 @@
Тут можно подпись какую-то сделать
Ваш IQ: {{ random_number }}