diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2017-10-31 17:12:38 -0400 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2017-10-31 17:12:38 -0400 |
| commit | 11e4b14a65133960cefafca52d8aaf6d7b2f4950 (patch) | |
| tree | ec083c7fddb7aa75ccfd0d4680dc1809ba160501 /app | |
| parent | 30f1cbb8368b133cf46f613e896bf012ec4da51c (diff) | |
| download | dispatch-tracker-11e4b14a65133960cefafca52d8aaf6d7b2f4950.tar.gz dispatch-tracker-11e4b14a65133960cefafca52d8aaf6d7b2f4950.tar.xz | |
Changes to make the app work under uwsgi
Diffstat (limited to 'app')
| -rw-r--r-- | app/app/settings.py | 3 | ||||
| -rw-r--r-- | app/config.yml | 13 | ||||
| -rw-r--r-- | app/requirements.txt | 1 | ||||
| -rw-r--r-- | app/uwsgi.ini | 12 | ||||
| -rw-r--r-- | app/wsgi.py | 7 |
5 files changed, 35 insertions, 1 deletions
diff --git a/app/app/settings.py b/app/app/settings.py index abf4cbc..d472675 100644 --- a/app/app/settings.py +++ b/app/app/settings.py @@ -28,7 +28,7 @@ SECRET_KEY = 'h$r_bwlp@#h#y#%&qhw-n=gb2%wva1d_h65+o94u&!a#%iv&lo' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = CONFIG['allowed_hosts'] # Application definition @@ -135,6 +135,7 @@ USE_TZ = True # https://docs.djangoproject.com/en/1.11/howto/static-files/ STATIC_URL = '/static/' +STATIC_ROOT = CONFIG['static_root'] LOGIN_URL = '/login/' LOGIN_REDIRECT_URL = '/' diff --git a/app/config.yml b/app/config.yml index a60a66e..80a9d6e 100644 --- a/app/config.yml +++ b/app/config.yml @@ -7,7 +7,20 @@ db_default: PASSWORD: HOST: 127.0.0.1 PORT: 5432 +# MySQL Example +# db_default: +# ENGINE: django.db.backends.mysql +# NAME: dispatch_test +# USER: dispatch +# PASSWORD: ahB2lee5 +# HOST: 127.0.0.1 +# PORT: 3306 # Sqlite example. Full path is recommended # db_default: # ENGINE: django.db.backends.sqlite3 # NAME: /home/mitch/scm/dispatch-tracker/app/db.sqlite3 + +allowed_hosts: + - example.com + +static_root: '/full/path/to/static/root' diff --git a/app/requirements.txt b/app/requirements.txt index b9c0537..54570ed 100644 --- a/app/requirements.txt +++ b/app/requirements.txt @@ -8,3 +8,4 @@ python-dateutil==2.6.1 pytz==2017.2 PyYAML==3.12 six==1.10.0 +mysqlclient==1.3.12 diff --git a/app/uwsgi.ini b/app/uwsgi.ini new file mode 100644 index 0000000..5b7b516 --- /dev/null +++ b/app/uwsgi.ini @@ -0,0 +1,12 @@ +[uwsgi] +processes = 1 +threads = 4 + +socket = 127.0.0.1:9200 + +module = wsgi:application + +daemonize=uwsgi.log +pidfile=uwsgi.pid + +home = env diff --git a/app/wsgi.py b/app/wsgi.py new file mode 100644 index 0000000..5cc801e --- /dev/null +++ b/app/wsgi.py @@ -0,0 +1,7 @@ +import os + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings") + +from django.core.wsgi import get_wsgi_application + +application = get_wsgi_application() |
