aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--app/app/settings.py3
-rw-r--r--app/config.yml13
-rw-r--r--app/requirements.txt1
-rw-r--r--app/uwsgi.ini12
-rw-r--r--app/wsgi.py7
6 files changed, 37 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 7f7cccc..52f6b44 100644
--- a/.gitignore
+++ b/.gitignore
@@ -58,3 +58,5 @@ docs/_build/
# PyBuilder
target/
+app/uwsgi.pid
+static
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()