Skip to content
Browse files

add runserver.sh helper script

  • Loading branch information...
1 parent 1b43809 commit d657987d4a88005dc00afb422f6ecedae80468ad @denibertovic denibertovic committed
Showing with 21 additions and 12 deletions.
  1. +7 −0 gunicorn_config.py
  2. +2 −2 kset/settings/__init__.py
  3. +2 −10 kset/wsgi.py
  4. +10 −0 runserver.sh
View
7 gunicorn_config.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env python
+
+bind = "127.0.0.1:8000"
+workers = 4
+
+loglevel = 'debug'
+
View
4 kset/settings/__init__.py
@@ -1,5 +1,5 @@
-# Try to activate local settings. If it fails, assume we're on production and
-# activate production settings. Note that local.py shouldn't be tracked in the
+# Try to activate local settings. If it fails, assume we're on development and
+# activate dev settings. Note that local.py shouldn't be tracked in the
# repository.
try:
View
12 kset/wsgi.py
@@ -11,18 +11,10 @@
framework.
"""
-from os import environ
-from os.path import basename, dirname
-
-settings_module = basename(dirname(__file__)) + '.settings'
-environ.setdefault("DJANGO_SETTINGS_MODULE", settings_module)
+PROJECT_NAME = 'kset'
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
-application = get_wsgi_application()
-
-# Apply WSGI middleware here.
-# from helloworld.wsgi import HelloWorldApplication
-# application = HelloWorldApplication(application)
+kset = get_wsgi_application()
View
10 runserver.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+set -e
+
+source /home/`whoami`/.virtualenvs/kset/bin/activate
+
+export DJANGO_SETTINGS_MODULE=kset.settings
+
+
+exec gunicorn -c gunicorn_config.py kset.wsgi:kset
+

0 comments on commit d657987

Please sign in to comment.
Something went wrong with that request. Please try again.