Code

Opened 7 years ago

Closed 7 years ago

#4889 closed (duplicate)

Help solve a potential deployment problem (mod_python)

Reported by: davep@… Owned by: jacob
Component: Documentation Version: master
Severity: Keywords: deployment
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I've been trying all evening to deploy an application that goes fine with 'runserver' but won't go with mod_python. The error I was getting was an exception - ViewDoesNotExist - being raised by the URL parser failing to find my views on the path. For some reason. Messing around with the value of PythonPath in the Apache configuration led to a dilemma where one would break Python itself and the other would break Django. In a moments inspiration I just gave it both paths and it worked a treat. My current config is as below:

root@gateway:/var/www/dev-ad1-dyn.atomicdroplet/django_ad_serve# cat /etc/apache2/sites-available/django_ad_serve 
<VirtualHost *:80>
#Ordinary webserving
        ServerAdmin davep@atomicdroplet.com
        ServerName dev-ad1-dyn.atomicdroplet.com
#Django
        <Location "/">
        SetHandler python-program
        PythonHandler django.core.handlers.modpython
        SetEnv DJANGO_SETTINGS_MODULE django_ad_serve.settings
        PythonPath "['/var/www/dev-ad1-dyn.atomicdroplet/','/var/www/dev-ad1-dyn.atomicdroplet/django_ad_serve/']+sys.path"
        PythonDebug On
        </Location>
</VirtualHost>

This ticket is requesting that some similar advice is dispensed in the deployment documentation and perhaps in the FAQ around ViewDoesNotExist. It was particularly frustrating in that runserver worked just fine.

Thanks,
Dave

Attachments (0)

Change History (4)

comment:1 Changed 7 years ago by John Shaffer <jshaffer2112@…>

  • Has patch unset
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 7 years ago by Graham.Dumpleton@…

Same issue of documentation not explaining that site directory may need to be in path as mentioned in list post referenced from #4296. In particular:

http://groups.google.com/group/django-users/browse_frm/thread/24deb095a2b2e450/1c982558d464017a

comment:3 Changed 7 years ago by davep@…

I agree with Graham that this is the same problem as #4296 and that the google groups link referenced above illustrates the problem (and delves significantly deeper into it's causes than I can). Perhaps this bug should be marked as a dupe of #4296

comment:4 Changed 7 years ago by Matt McClanahan <cardinal@…>

  • Resolution set to duplicate
  • Status changed from new to closed

#4296 has been closed with the addition to the docs in [5896], which looks like it covers this ticket's issue as well.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.