aboutsummaryrefslogtreecommitdiff
path: root/wqflask/secure_server.py
blob: b877c54474fb650c43b7e32a108b5110b65b8d99 (plain)
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
from __future__ import print_function, division, absolute_import

from wqflask import app

from flask import Flask, render_template

# Setup mail
from flask.ext.mail import Mail
mail = Mail(app)

from wqflask.model import *

# Create a user to test with
##@app.before_first_request
#def create_user():
#    db.create_all()
#    user_datastore.create_user(email='matt@example.com', password='notebook')
#    db.session.commit()

import logging
file_handler = logging.FileHandler(app.config['LOGFILE'])
file_handler.setLevel(logging.DEBUG)
app.logger.addHandler(file_handler)

import logging_tree
logging_tree.printout()

import sys
print("At startup, path is:", sys.path)


########
def tracefunc(frame, event, arg, indent=[0]):
    if event == "call":
        indent[0] += 2
        print("-" * indent[0] + "> call function", frame.f_code.co_name)
    elif event == "return":
        print("<" + "-" * indent[0], "exit function", frame.f_code.co_name)
        indent[0] -= 2
    return tracefunc

import sys
sys.settrace(tracefunc)
##############

#print("app.config is:", app.config)

if __name__ == '__main__':
    #create_user()
    app.run(host='0.0.0.0',
        port=app.config['SERVER_PORT'],
        use_debugger=False,
        threaded=True,
        use_reloader=True)