Commits

Jan Willems  committed 648f3c2

Added uwsgi and nginx configuration; updated wsgi and settings accordingly.

  • Participants
  • Parent commits c48453c

Comments (0)

Files changed (5)

File conf/api.conf

+
+upstream django {
+    # server unix:///path/to/your/mysite/mysite.sock;
+    server 127.0.0.1:3031;
+}
+
+server {
+
+    listen      8000;
+    server_name 127.0.0.1;
+    charset     utf-8;
+
+    client_max_body_size 75M;
+
+    access_log /var/log/nginx/api.access.log;
+    error_log /var/log/nginx/api.error.log;
+
+    location / {
+        uwsgi_pass  django;
+        include     uwsgi_params;
+    }
+
+    location /nginx_status {
+        stub_status on;
+        access_log  on;
+        allow all;
+    }
+
+}

File conf/synchroniser.ini

+[uwsgi]
+socket = 127.0.0.1:3031
+
+#chdir = /var/www/api
+chdir = /home/jw/python/projects/django-synchroniser
+env = DJANGO_SETTINGS_MODULE=example.settings
+module = example.wsgi:application
+
+processes = 4
+threads = 2
+
+stats = 127.0.0.1:9191
+
+master = True
+pidfile = /tmp/django-synchroniser.pid
+vacuum = True
+max-requests = 5000
+
+#daemonize = /var/log/uwsgi/django-synchroniser.log
+daemonize = /home/jw/django-synchroniser.log
+
+uid = www-data
+gid = www-data

File example/settings.py

 
 ROOT_URLCONF = 'example.urls'
 
-WSGI_APPLICATION = 'synchronise.wsgi.application'
+WSGI_APPLICATION = 'example.wsgi.application'
 
 
 # Database

File example/wsgi.py

 """
 
 import os
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "synchronise.settings")
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings")
 
 from django.core.wsgi import get_wsgi_application
 application = get_wsgi_application()
+
+CONFIGURATION_FILE = "synchroniser.properties"
+
+DEVELOPMENT = "development"
+PRODUCTION = "production"
+STAGING = "staging"
+