-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.py
63 lines (42 loc) · 1.7 KB
/
app.py
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
60
61
62
63
##### .......................................... Importing Libraries .............................................#####
from flask import Flask, render_template as rt, flash
from os import getenv
from flask_mail import Mail
from flask_socketio import SocketIO
##### .......................................... Flask App .............................................#####
app=Flask(__name__)
app.config['SECRET_KEY'] = getenv("SECRET_KEY")
socketio = SocketIO(app)
##### .......................................... Mail Configuration .............................................#####
app.config.update(
MAIL_SERVER = getenv('SMTP_SERVER'),
MAIL_PORT = getenv('SMTP_PORT'),
MAIL_USE_SSL = True,
MAIL_USERNAME = getenv('SMTP_USERNAME'),
MAIL_PASSWORD = getenv('SMTP_PASSWORD')
)
mail = Mail(app)
##### .......................................... Static Pages .............................................#####
@app.route('/')
def homepage():
return rt('index.html')
@app.route('/synopsis')
def synopsis():
return rt('synopsis.html')
@app.route('/contact-us')
def contact_us():
flash("This form is not working yet")
return rt('contact-us.html')
@app.route('/about-us')
def about_us():
return rt('about-us.html')
#####.......................................... Errors Pages .............................................#####
@app.errorhandler(404)
def badlink(e):
return rt('pagenotfound.html') , 404
##### .......................................... Importing Routes and Sockets .............................................#####
from users.routes import *
from crosswords.routes import *
import socketIO.sockets as sockets
if __name__ == '__main__':
socketio.run(app ,debug=True)