Changes between Version 2 and Version 3 of django_apache_and_mod_wsgi


Ignore:
Timestamp:
Aug 19, 2007, 3:52:30 AM (17 years ago)
Author:
yml
Comment:

Integrate the feedbacks from Graham Dumpleton

Legend:

Unmodified
Added
Removed
Modified
  • django_apache_and_mod_wsgi

    v2 v3  
    4545This suppose that you create a folder named apache in your django project in this folder your should add the following files:
    4646
    47 08/16/2007  04:12 PM             1,082 apache_django_wsgi.conf
    48 08/16/2007  04:31 PM               557 dj_survey.wsgi
    49 08/16/2007  04:31 PM             4,362 settings_production.py
    50 08/16/2007  04:09 PM               712 urls_production.py
    51 08/16/2007  04:33 PM                 0 __init__.py
     47 * 08/16/2007  04:12 PM             1,082 apache_django_wsgi.conf
     48 * 08/16/2007  04:31 PM               557 dj_survey.wsgi
     49 * 08/16/2007  04:31 PM             4,362 settings_production.py
     50 * 08/16/2007  04:09 PM               712 urls_production.py
     51 * 08/16/2007  04:33 PM                 0 !__init!__.py
    5252
    53 __Note__: There is a file called "__init__.py" in <PATH TO YOUR DJANGO PROJECT>/apache. In this case <PATH TO YOUR DJANGO PROJECT> is equal to c:\<LONG PATH>\dj_project
     53__Note__: There is a file called "!__init!__.py" in <PATH TO YOUR DJANGO PROJECT>/apache. In this case <PATH TO YOUR DJANGO PROJECT> is equal to c:\<LONG PATH>\dj_project
    5454
    5555Like in the httpd.conf you should pay attention to the separator. You should use "/" and not "\"
     
    9292{{{
    9393import os, sys
    94 sys.path.append('C:\\yml\\_myScript_\\dj_things\\web_development\\workspace')
    95 sys.path.append('C:\\yml\\_myScript_\\dj_things\\web_development\\workspace\\dj_project')
     94
     95#Calculate the path based on the location of the WSGI script.
     96apache_configuration= os.path.dirname(os.path.dirname(__file__))
     97project = os.path.dirname(apache_configuration)
     98workspace = os.path.dirname(project)
     99sys.path.append(project)
     100sys.path.append(workspace)
     101
     102#Add the path to 3rd party django application and to django itself to the PYTHONPATH.
    96103sys.path.append('C:\\yml\\_myScript_\\dj_things\\web_development\\svn_views\\django_src\\trunk')
    97104sys.path.append('C:\\yml\\_myScript_\\dj_things\\web_development\\svn_views\\django-registration')
     105
    98106os.environ['DJANGO_SETTINGS_MODULE'] = 'dj_project.apache.settings_production'
    99107import django.core.handlers.wsgi
     
    128136
    129137== Test ==
    130 Retstart apache and now you should be able enjoy your application serve by apache.
     138Retstart apache and now you should be able enjoy your application serve by Apache and mod_wsgi.
    131139
    132140== References ==
Back to Top