Wednesday, June 22, 2011

Run Django via WSGI without web server

Recently I faced a problem - I needed to test updated Django WSGI-runner script. But I didn't have a web server on my computer. And I didn't want to install it. So, how to deal with that?

I found out about Werkzeug. It was supposed to solve my issue. To install it run system-wide
sudo pip install werkzeug
I made a runner script run.py that makes a dev server with Werkzeug and voila:

run.py
from werkzeug.serving import run_simple
from wsgi import application

run_simple('127.0.0.1', 4000, application)

where wsgi.py is former django.wsgi file.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.