РАСКУРx1
This commit is contained in:
parent
ab6503f7b0
commit
e61828bfa7
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.env
|
||||||
|
**/__pycache__/
|
||||||
|
.idea/
|
@ -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()
|
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 778 B After Width: | Height: | Size: 778 B |
@ -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">
|
@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user