- July 4, 2007
- django python toofpy toolserver-for-python
- 2 (after 2 ratings)
ToofPy is a python server that supports WSGI so you can integrate Django with it via the WSGI handler.
There is already some default Django integration in the source, but it looked really hacked up with many
if hasdjango: lines all over the place and hardcoded URLs.
A really simple solution is to create a Tool for wrapping around Django. That is what the above file does. So I removed most of the hardcoded django lines and created the tool above.
ToofPy dynamically loads tools based on paths on the filesystem, so you'll need to put the file above in the WSGI folder path.
Or, if you want to pre-integrate, import the file in the _initops function of WSGIMainTool just after the code to scan the directory.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
# Put the contents below into a file DjangoWsgiWrapper.py and put it in your # WSGI Tool directory # If you want to pre-integrate it (ie not have it picked up from the # filesystem), then add "import DjangoWsgiWrapper" to the _initopts function # in WSGIMainTool (WSGITool.py) import os from django.core.handlers.wsgi import WSGIHandler # replace with your settings file os.environ['DJANGO_SETTINGS_MODULE'] = "apps.settings" # replace "app" with the name of your app. # You will access django by going to http://yoursite/WSGI/app registerWSGI('app', WSGIHandler())
More like this
- Django app WSGI by ofalk 5 years, 9 months ago
- db_dump.py - for dumpping and loading data from database by limodou 8 years, 1 month ago
- django_production.wsgi by vemubalu 3 years, 11 months ago
- Test Integration for mako templates by eriklee 6 years, 4 months ago
- Obfuscator for django project sources by audial 7 years, 4 months ago