РАСКУРx1

This commit is contained in:
fox 2021-01-12 22:07:54 +03:00
parent ab6503f7b0
commit e61828bfa7
No known key found for this signature in database
GPG Key ID: 1E36ED1DFB6FDE78
14 changed files with 9 additions and 23 deletions

1
.flaskenv Normal file
View File

@ -0,0 +1 @@
FLASK_APP=app:app

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.env
**/__pycache__/
.idea/

View File

@ -1,8 +1,10 @@
from dotenv import load_dotenv
from flask import Flask, url_for, render_template from flask import Flask, url_for, render_template
import os import os
import json import json
import numpy.random as gaussian_rnd import numpy.random as gaussian_rnd
load_dotenv()
""".. ..,.,,,. . . . """.. ..,.,,,. . . .
. . ....... ...,%&%/,.. .... .*#&&%*... .... . . .. .. . . ....... ...,%&%/,.. .... .*#&&%*... .... . . .. ..
@ -39,9 +41,6 @@ import numpy.random as gaussian_rnd
app = Flask(__name__, subdomain_matching=True) 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(): def generate_iq():
@ -68,17 +67,10 @@ def index():
data = json.loads(file.read()) data = json.loads(file.read())
cols = data['cols'] cols = data['cols']
projects = data['projects'] 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') @app.route('/', subdomain='tex')
def texindex(): def texindex():
return render_template('texindex.html') 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()

View File

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 778 B

After

Width:  |  Height:  |  Size: 778 B

View File

@ -12,7 +12,7 @@
<p> Тут можно подпись какую-то сделать </p> <p> Тут можно подпись какую-то сделать </p>
<p> Ваш IQ: {{ random_number }}</p> <p> Ваш IQ: {{ random_number }}</p>
<div class="btn-container"> <div class="btn-container">
<button onclick="location.href='https://{{texlink}}'" type="button" class="btn-tex"> <button onclick="location.href='{{texlink}}'" type="button" class="btn-tex">
<p> TeX </p> <p> TeX </p>
</button> </button>
<button type="button"> <button type="button">

View File

@ -1,10 +0,0 @@
{
"hosts": {
"server_name": "thematdev.org",
"port": "1488",
"texlink": "tex.thematdev.org",
"texport": "1488",
"host": "127.0.0.1",
"host_port": "1488"
}
}