Adding custom django package to WSGI settings


/ Published in: Django
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # in your project.wsgi file
  2.  
  3. import os, sys
  4.  
  5. #add the desired django version at the beginning of the path; mind you must provide the Django folder as downloaded!
  6. sys.path.insert(1, "/path/to/Django/")
  7.  
  8. sys.path.append('/my/project/root/') # add things as usual...
  9.  
  10. # the rest is the normal wsgi stuff...
  11.  
  12. os.environ['DJANGO_SETTINGS_MODULE'] = 'project.settings'
  13.  
  14. import django.core.handlers.wsgi
  15. application = django.core.handlers.wsgi.WSGIHandler()

URL: https://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.