On Mar 14, 7:52 pm, Rex <rex.eastbou...@gmail.com> wrote:
> On Mar 4, 12:47 pm, John Maines <jmai...@sun-sentinel.com> wrote:
>
>
>
> > Hello:
>
> > I've installed Django 1.0 on Ubuntu and am trying to get it to run on
> >Apache.Apacheis installed, working fine, with mod-python also in
> > place. I'm new at everything Linux.
>
> > But when I try to run my app (a test blog),Apachegives an
> > ImportError message (below) I have come across NUMEROUS references to
> > this error message, and the solution usually seems to involve changing
> > the Python Path. But nothing I try seems to work. I've tried using /
> > user/local for a path, /var/www; the path to my app. Nothing works.
> > Any suggestions?
>
> > MOD_PYTHON ERROR
>
> > ProcessId: 9980
> > Interpreter: 'mysite'
>
> > ServerName: 'ubuntu.ubuntu-domain'
> > DocumentRoot: '/var/www/'
>
> > URI: '/mysite'
> > Location: '/'
> > Directory: None
> > Filename: '/var/www/mysite'
> > PathInfo: ''
>
> > Phase: 'PythonHandler'
> > Handler: 'django.core.handlers.modpython'
>
> > Traceback (most recent call last):
>
> [snip]
> > ImportError: Could not import settings 'settings' (Is it on sys.path?
> > Does it have syntax errors?): No module named settings
>
> I'm having the same issue as the OP. Each time I go to mysite.com/
> myapp,Apacheseems to look for a file called /var/www/myapp, instead
> of launching the Django project I attempt to specify in my <Location>
> directive.
>
> I have a project called "mturk". I want to run it on from mysite.com/
> myapp. Based on the answers to the OP's questions, it seems like I
> should be putting something like this in one of my configuration
> files:
>
> <Location "/myapp/">
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE mysite.settings
> PythonOption django.root /home/rex/django/mturk
> PythonDebug On
> PythonPath "['/home/rex/django/mturk'] + sys.path"
> </Location>
>
> Some sources say this snippet should go in /etc/apache2/httpd.conf,
> and some sources say it should go in /etc/apache2/sites-enabled/000-
> default. Which should I go with? Also, I read somewhere that I should
> change my DocumentRoot to the path to the Django project, but wouldn't
> that expose my database and my Python source?
>
> Thanks,
>
> Rex
It turns out the problem was my PythonPath directive -- whereas I had
it set to contain the project directory, /home/rex/django/mturk, I
needed to set it to the parent directory, /home/rex/django. It works
now.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---