-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.wsgi
More file actions
27 lines (22 loc) · 837 Bytes
/
main.wsgi
File metadata and controls
27 lines (22 loc) · 837 Bytes
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
"""
Main script used to start the application.
"""
import os.path
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0, '/srv/Server-Item-Catalog')
from project import app as application
from flask import Flask
import json
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from project.db.database_setup import Base
from project.db.database_seed import db_seed
# http://stackoverflow.com/questions/38523303/how-to-reload-a-flask-app-each-time-its-accessed/38524695#38524695
# This is used to refresh the server on template (html) changes
def before_request():
application.jinja_env.cache = {}
application.before_request(before_request)
application.config['DATABASE_URL'] = 'postgresql://catalog:password@localhost/catalog'
application.secret_key = 'change_in_production'