Login

Tag "wsgi"

Snippet List

django_production.wsgi

The above conf file the easiest way to point the env and the settings together , the user has to point the django.wsgi file with the correct path and it should work fine and one can directly run it in apache

  • django
  • wsgi
Read More

Monkey-patch Django's test client to return WSGIRequest objects

Testing low-level functionality sometimes requires a WSGIRequest object. An example of this is testing template tags. This will monkey-patch the test Client object to return WSGIRequest objects Normal Django behavior: >>> client.get('/') <HttpResponse > With this code, get the request object: >>> client.request_from.get('/') <WSGIRequest > Installation: For this to work, you simply need to import the contents of this file. If you name this file `clientrequestpatch.py`, do this inside your Django tests. from django.test.testcases import TestCase from myproject.test import clientrequestpatch

  • request
  • test
  • client
  • wsgi
  • wsgirequest
Read More

Interactive debugger and other Paste niceties

runserver with extra development tools: 1. interactive debugger that pops up automatically if an exception occurs, courtesy of [Werkzeug](http://werkzeug.pocoo.org/documentation/dev/debug.html#using-the-debugger) 2. logging of print statements directly into HTML (div float), courtesy of [Paste](http://pythonpaste.org/modules/debug.prints.html). Credits: [piranha.org.ua](http://piranha.org.ua/)

  • print
  • django
  • debugging
  • paste
  • wsgi
  • werkzeug
Read More

Django app WSGI

If you want to have your wsgi as general as possible (for eg. different environments) without any hardcoded paths, this example might help you...

  • wsgi
Read More

5 snippets posted so far.