Skip to content

Commit

Permalink
missing wsgi file added
Browse files Browse the repository at this point in the history
  • Loading branch information
edmenendez committed Mar 29, 2013
1 parent 89ceadc commit d182217
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -15,7 +15,7 @@ It's assumed you have Python and Postgres already installed.
* Create a database in Postgres. Whatever database settings used needs to be added to apps/ch/settings.py ~ line 12. You could also make a settings_local file using your machine name and put that in settings_local/MACHINE_NAME.py
* Run ```python manage.py syncdb --migrate```
* Go into static directory and run ```python -m SimpleHTTPServer```. You should create a serve.bat file for this. This is the Angular app.
* Start Django. ```python runserver 0.0.0.0:8001``` I created a batch file for this called r.bat. This is your API and admin.
* Start Django. ```python managae runserver 0.0.0.0:8001``` I created a batch file for this called r.bat. This is your API and admin.
* Go to [http://localhost:8000/]. This is the Angular app. It's being served directly via SimpleHTTPServer. It can be served from anywhere, even Amazon. There might be cross domain issues if you're hosting on a different domain.

Use it
Expand Down
32 changes: 32 additions & 0 deletions apps/ch/wsgi.py
@@ -0,0 +1,32 @@
"""
WSGI config for ch project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.
Usually you will have the standard Django WSGI application here, but it also
might make sense to replace the whole Django WSGI application with a custom one
that later delegates to the Django one. For example, you could introduce WSGI
middleware here, or combine a Django application with an application of another
framework.
"""
import os

# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = "ch.settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ch.settings")

# 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)

0 comments on commit d182217

Please sign in to comment.