-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtools.py
More file actions
executable file
·59 lines (44 loc) · 1.29 KB
/
tools.py
File metadata and controls
executable file
·59 lines (44 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import psycopg2
from functools import wraps
from flask import session, redirect, url_for, Flask
from flask_recaptcha import ReCaptcha
# Flask app
app = Flask(__name__,template_folder='../templates', static_folder='../static')
app.config['UPLOAD_PATH'] = 'static/uploads'
app.secret_key = b'_softforrange***d*'
app.config['RECAPTCHA_SITE_KEY'] = 'RECAPTCHA_SITE_KEY' # <-- Add your site key
app.config['RECAPTCHA_SECRET_KEY'] = 'RECAPTCHA_SECRET_KEY' # <-- Add your secret key
recaptcha = ReCaptcha(app)
global ServerPort
ServerPort = 5000
global myUrl
myIp = "192.168.1.33"
myUrl = "http://{}:{}/".format(str(myIp), str(ServerPort))
global MyEmail
global MyEmailPass
MyEmail = "your_yandex_mail"
MyEmailPass = "your_password"
# docker-database connect
conn = psycopg2.connect(
host="db-postgres",
database="postgres",
port="5432",
user="postgres",
password="123456789Zz.")
"""
conn = psycopg2.connect(
host="localhost",
database="teklink",
port="5432",
user="postgres",
password="123456789Zz.")
"""
cursor = conn.cursor()
def login_required(f):
@wraps(f)
def decorated_function(*args, **kwargs):
if "logged_in" in session:
return f(*args, **kwargs)
else:
return redirect(url_for("main"))
return decorated_function