Ticket #15058: 15058.diff

File 15058.diff, 1.4 KB (added by Aymeric Augustin, 14 years ago)
  • docs/howto/deployment/modwsgi.txt

     
    4242
    4343    os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
    4444
     45    sys.path.append('/path/to')
     46    sys.path.append('/path/to/mysite')
     47
    4548    import django.core.handlers.wsgi
    4649    application = django.core.handlers.wsgi.WSGIHandler()
    4750
    48 If your project is not on your ``PYTHONPATH`` by default you can add::
     51The first directory added to ``sys.path`` allows Python to import your
     52application, starting with your settings modules. The second directory is
     53necessary if you have left out the name of your project in your imports,
     54which is recommended for pluggable apps.
    4955
    50     path = '/path/to/mysite'
    51     if path not in sys.path:
    52         sys.path.append(path)
     56If these directories are already on your ``PYTHONPATH`` by default, you can
     57omit these lines.
    5358
    54 just below the ``import sys`` line to place your project on the path. Remember to
    55 replace 'mysite.settings' with your correct settings file, and '/path/to/mysite'
    56 with your own project's location.
     59Remember to replace 'mysite.settings' with your correct settings file, and
     60'/path/to/mysite' with your own project's location. The example above assumes
     61that you have run 'django-admin.py startproject mysite' in '/path/to'.
    5762
    5863.. _serving-media-files:
    5964
Back to Top