75d3bd6 by Anon Ray at 2014-02-19 | 1 | # -*- coding: utf-8 -*- |
f867edb by Anon Ray at 2014-04-10 | 2 | # swtstore->runserver.py |
3 | ||
75d3bd6 by Anon Ray at 2014-02-19 | 4 | # Script to run the application server in development mode |
5 | ||
6 | import sys, os |
|
7 | ||
8 | # Get the path to the base directory of the app |
|
9 | BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__))) |
|
10 | ||
11 | # append the path to the WSGI env path |
|
12 | sys.path.insert(0, BASE_DIR) |
|
13 | ||
f867edb by Anon Ray at 2014-04-10 | 14 | # Import and create the app |
15 | from swtstore import create_app |
|
16 | ||
75d3bd6 by Anon Ray at 2014-02-19 | 17 | app = create_app() |
18 | ||
f867edb by Anon Ray at 2014-04-10 | 19 | # Run the server if this script is directly executed |
20 | # Presumably, this is development mode |
|
75d3bd6 by Anon Ray at 2014-02-19 | 21 | if __name__ == '__main__': |
8fe0bbc by Anon Ray at 2014-05-10 | 22 | app.run(host='0.0.0.0', port=5001) |