|
|
| mod_python: problem with http.conf |
  United States |
2007-11-05 15:37:30 |
Hello I am using Fedora 7. I am using Django for the first
time. I
want the django to run on port 80. so that :
http://localhost/mysite/
should retreive the Django dafault page. I have installed
mod_python
and imported it into http.conf.
In http.conf I have also:
<Location "/mysite/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonDebug On
</Location>
MY CLASS PATH IS:
$ echo $PATH
/home/priya/mysite:/usr/kerberos/bin:/usr/local/bin:/usr/bin
:/bin:/
home/priya/bin
CHECK THE SCREEN SHOT OF THE ERROR PAGE:
http://img222.imageshack.us/my.php?image=screenshotuf4
.png
Advance thank you for the help....
--~--~---------~--~----~------------~-------~--~----~
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-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: mod_python: problem with http.conf |
  United States |
2007-11-05 16:07:09 |
On Nov 6, 8:37 am, stranger <strangersqu... gmail.com> wrote:
> Hello I am using Fedora 7. I am using Django for the
first time. I
> want the django to run on port 80. so that :
>
> http://localhost/mysite/
>
> should retreive the Django dafault page. I have
installed mod_python
> and imported it into http.conf.
>
> In http.conf I have also:
>
> <Location "/mysite/">
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE mysite.settings
> PythonDebug On
> </Location>
>
> MY CLASS PATH IS:
> $ echo $PATH
>
/home/priya/mysite:/usr/kerberos/bin:/usr/local/bin:/usr/bin
:/bin:/
> home/priya/bin
No it isn't. That is your shell program search path. Nothing
to do
with Python module search path, nor Java class path for that
matter.
> CHECK THE SCREEN SHOT OF THE ERROR PAGE:
>
> http://img222.imageshack.us/my.php?image=screenshotuf4
.png
Read the mod_python documentation for Django properly.
Specially, look
at how PythonPath directive is used to define how you
application can
be found.
http://www.djangoproject.com/documentation/modpython/
Graham
--~--~---------~--~----~------------~-------~--~----~
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-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: mod_python: problem with http.conf |
  United States |
2007-11-05 16:13:12 |
Thank you Graham for the fast reply.... Could you please
elaborate a
little since i am new to django.
<Location "/mysite/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonDebug On
</Location>
...and replace mysite.settings with the Python import path
to your
Django project's settings file.
So how to know Python import path to Django project settings
file.
--~--~---------~--~----~------------~-------~--~----~
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-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: mod_python: problem with http.conf |
  United States |
2007-11-05 16:20:48 |
On Nov 6, 9:13 am, stranger <strangersqu... gmail.com> wrote:
> Thank you Graham for the fast reply.... Could you
please elaborate a
> little since i am new to django.
>
> <Location "/mysite/">
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE mysite.settings
> PythonDebug On
> </Location>
> ...and replace mysite.settings with the Python import
path to your
> Django project's settings file.
>
> So how to know Python import path to Django project
settings file.
As per exact example in the documentation, something like:
<Location "/mysite/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonDebug On
PythonPath "['/path/to/project'] + sys.path"
</Location>
Just replace '/path/to/project' with the parent directory of
where
'mysite' project directory is, which in your case seems to
be '/home/
priya'.
Just try to do what the documentation says to do.
Graham
--~--~---------~--~----~------------~-------~--~----~
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-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: mod_python: problem with http.conf |
  United States |
2007-11-05 16:30:23 |
Hello Graham,
Just followed the same instructions as u said.
<Location "/mysite/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE mysite.settings
PythonDebug On
PythonPath "['/home/priya'] + sys.path"
</Location>
No Change in http:localhost/mysite
Still pointing to the same error page.
EnvironmentError: Could not import settings
'mysite.settings' (Is it
on sys.path? Does it have syntax errors?): No module named
mysite.settings
--~--~---------~--~----~------------~-------~--~----~
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-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: mod_python: problem with http.conf |
  United States |
2007-11-05 16:34:21 |
On Nov 6, 9:30 am, stranger <strangersqu... gmail.com> wrote:
> Hello Graham,
>
> Just followed the same instructions as u
said.
>
> <Location "/mysite/">
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> SetEnv DJANGO_SETTINGS_MODULE mysite.settings
> PythonDebug On
> PythonPath "['/home/priya'] +
sys.path"
> </Location>
>
> No Change in http:localhost/mysite
>
> Still pointing to the same error page.
> EnvironmentError: Could not import settings
'mysite.settings' (Is it
> on sys.path? Does it have syntax errors?): No module
named
> mysite.settings
Is your settings file in fact located at:
/home/priya/mysite/settings.py
Did you restart Apache after making the config change?
As Apache will normally run as a special user, does that
user have the
ability to read files from your home directory? If the
directories
down to that point are not readable and searchable to
others, or the
individual files not readable to others then Apache user
will not be
able to read them and you will also get this error.
Graham
--~--~---------~--~----~------------~-------~--~----~
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-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: mod_python: problem with http.conf |
  United States |
2007-11-05 16:37:45 |
Yes my settings.py file is in the place you specified.
I have restarted the apache: /etc/init.d/httpd restart
I think u r right. Apache dont have right to read that
module. Please
specify me how to give access to apche to my mysite
directory.
--~--~---------~--~----~------------~-------~--~----~
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-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: mod_python: problem with http.conf |
  United States |
2007-11-05 16:44:08 |
On Nov 6, 9:37 am, stranger <strangersqu... gmail.com> wrote:
> Yes my settings.py file is in the place you specified.
>
> I have restarted the apache: /etc/init.d/httpd
restart
>
> I think u r right. Apache dont have right to read that
module. Please
> specify me how to give access to apche to my mysite
directory.
You need to use the 'chmod' command. If you don't know what
this is
for and how it works, I suggest you read through:
http://www.unixgeeks.org/security/newbie/unix/man9/
chmod.html
and learn about it.
In the end you will need 'o+rx' on directories, and 'o+r' on
files,
but read about chmod to learn what that means first.
Graham
--~--~---------~--~----~------------~-------~--~----~
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-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: mod_python: problem with http.conf |
  United States |
2007-11-05 16:57:31 |
Thank alot Graham. To which user, I must grant access?
I know the command chmod.. and I traversed to mysite
directory and
chmod -R 755 *
still no change.
--~--~---------~--~----~------------~-------~--~----~
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-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: mod_python: problem with http.conf |
  United States |
2007-11-05 17:09:33 |
On Nov 6, 9:57 am, stranger <strangersqu... gmail.com> wrote:
> Thank alot Graham. To which user, I must grant access?
>
> I know the command chmod.. and I traversed to mysite
directory and
> chmod -R 755 *
>
> still no change.
Hmmm, I saw that example in the document I referred to and
thought it
was a bad example. For that reason I said in my post what
permissions
you should be aiming for. My initial thought of warning you
not to use
that example from the document was probably right. I thought
perhaps
though you would read the document well so you understood
what it mean
rather than just cutting and pasting some example that may
work.
Anyway, no major harm, it just means you have made a whole
bunch of
files executable when they don't need to be. Although, if
you ran this
command in your home directory you could have created
various problems
for yourself in the future.
Now, in what directory did you run this command?
In your home directory what do you get if you run:
ls -lasgd .
Graham
--~--~---------~--~----~------------~-------~--~----~
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-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|