Re: Problems with Apache + mod_python [SOLVED]

2008-03-29 Thread Ramiro Morales

On Fri, Mar 28, 2008 at 11:45 PM, Graham Dumpleton
<[EMAIL PROTECTED]> wrote:
>
>  On Mar 29, 5:04 am, Slayer_X <[EMAIL PROTECTED]> wrote:
>  > Problem solved!
>  >
>  > I deleted the symlinks, delete de django-trunk dir and make a fresh
>  > install directly in
>  >
>  > /usr/lib/python2.4/site-packages/django
>
>  What do you mean by 'make a fresh install directly in'? Do you mean
>  you copied it in by hand or did you use an appropriate setup.py file
>  script?
>

We were chatting on #django-es when César solved this. What he means when
he says a fresh install is that he removed the django symlink from
/usr/lib/python2.4/site-packages/ (that pointed to a Django SVN WC on his
home dir)

Then, as root, he did a

cd /usr/lib/python2.4/site-packages/
svn co http://code.djangoproject.com/svn/django/trunk/django

The problem he was having with the symlink approach was related to the fact
that, even when he theoretically disabled SElinux and rebooted, something
wasn´t working when mod_python wanted to import django (importing
django in a normal user interactive python session worked ok.)

>
>  > In my Apache conf I use this path
>  >
>  > PythonPath "['/'] + sys.path"
>

>  Why are you adding '/' to the module search path. There shouldn't be
>  any need to add the root of the file system to it.
>

This is because his project was located in a dir below / as in:

/
ripsol/
settings.py
urls.spy
...

-- 
 Ramiro Morales

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problems with Apache + mod_python [SOLVED]

2008-03-28 Thread Graham Dumpleton

On Mar 29, 5:04 am, Slayer_X <[EMAIL PROTECTED]> wrote:
> Problem solved!
>
> I deleted the symlinks, delete de django-trunk dir and make a fresh
> install directly in
>
> /usr/lib/python2.4/site-packages/django

What do you mean by 'make a fresh install directly in'? Do you mean
you copied it in by hand or did you use an appropriate setup.py file
script?

> In my Apache conf I use this path
>
> PythonPath "['/'] + sys.path"

Why are you adding '/' to the module search path. There shouldn't be
any need to add the root of the file system to it.

Graham

> And now Django is working :-D
>
> Thanks a lot for your help
>
> César
>
> PD: Sorry for my bad english
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problems with Apache + mod_python [SOLVED]

2008-03-28 Thread Slayer_X

Problem solved!

I deleted the symlinks, delete de django-trunk dir and make a fresh
install directly in

/usr/lib/python2.4/site-packages/django

In my Apache conf I use this path

PythonPath "['/'] + sys.path"

And now Django is working :-D

Thanks a lot for your help

César

PD: Sorry for my bad english

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problems with Apache + mod_python

2008-03-28 Thread Slayer_X

Hi everyone!

> Michael Wieher wrote:
> Get rid of your installation of django and re-install it.
---
done

>To test it, go to any unrelated location in your file-system  (ie: cd /usr
>or cd /var or something, start up python and import django.)
---
I can import django without errors

>Also, be sure you don't have duplicate copies of python 2.4 installed on
>your system.
---
Just 1 copy of python (python-2.4.3-19.el5)

>Evert Rol wrote:
>You shouldn't need to add '/usr/lib/python2.4/site-packages/' to
>PythonPath: django is already in site-packages, and python (assuming
>that's python2.4 in /usr/bin) will automatically search there.
>You should, however, add the path to the 'ripsol' project there (or
>actually the path just above that); otherwise Python cannot pick up
>the ripsol.settings file (or any of your python files within ripsol).
>And I guess it should find something to test your setup when accessing
>the URL.
---
Done! and the python binary is in the correct location

>Karen Tracey:
>I know nothing of CentOS but from googling a bit it sounds like it
>is a distrib possibly based off of SELinux (security-enhanced).  Is django
>actually installed under site-packages or is it just linked there?  If it's
>only linked, and the link is to some user-owned space, then probably the
>issue is that apache doesn't have the access rights to read that space.
--
U can disable SElinux using system-config-security or modifying the /
etc/sysconfig/selinux file directly, after this u need to reboot :)

If u want to be sure about SElinux status run:
/usr/bin/sestatus -v

Obviusly I disabled SELinux on my system

> Graham Dumpleton wrote:
>Since mod_wsgi shares many of the same issues as mod_python, you may
>want to also read the issues documents for mod_wsgi:

>  http://code.google.com/p/modwsgi/wiki/ApplicationIssues
--
Thanks for the link, Im reading and watching probably issues, news
coming soon ;)

On Mar 27, 6:19 pm, Floyd Arguello <[EMAIL PROTECTED]> wrote:
> Try this:
> PythonPath "['/var/www/html/ripsol'] + sys.path"
---
Tried but the same problem persist

I keep trying, no surrender! thanks to all your responses

César
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problems with Apache + mod_python

2008-03-28 Thread Slayer_X

Hi everyone!

> Michael Wieher wrote:
> Get rid of your installation of django and re-install it.
---
done

>To test it, go to any unrelated location in your file-system  (ie: cd /usr
>or cd /var or something, start up python and import django.)
---
I can import django without errors

>Also, be sure you don't have duplicate copies of python 2.4 installed on
>your system.
---
Just 1 copy of python (python-2.4.3-19.el5)

>Evert Rol wrote:
>You shouldn't need to add '/usr/lib/python2.4/site-packages/' to
>PythonPath: django is already in site-packages, and python (assuming
>that's python2.4 in /usr/bin) will automatically search there.
>You should, however, add the path to the 'ripsol' project there (or
>actually the path just above that); otherwise Python cannot pick up
>the ripsol.settings file (or any of your python files within ripsol).
>And I guess it should find something to test your setup when accessing
>the URL.
---
Done! and the python binary is in the correct location

>Karen Tracey:
>I know nothing of CentOS but from googling a bit it sounds like it
>is a distrib possibly based off of SELinux (security-enhanced).  Is django
>actually installed under site-packages or is it just linked there?  If it's
>only linked, and the link is to some user-owned space, then probably the
>issue is that apache doesn't have the access rights to read that space.
--
U can disable SElinux using system-config-security or modifying the /
etc/sysconfig/selinux file directly, after this u need to reboot :)

If u want to be sure about SElinux status run:
/usr/bin/sestatus -v

Obviusly I disabled SELinux on my system

> Graham Dumpleton wrote:
>Since mod_wsgi shares many of the same issues as mod_python, you may
>want to also read the issues documents for mod_wsgi:

>  http://code.google.com/p/modwsgi/wiki/ApplicationIssues
--
Thanks for the link, Im reading and watching probably issues, news
coming soon ;)

On Mar 27, 6:19 pm, Floyd Arguello <[EMAIL PROTECTED]> wrote:
> Try this:
> PythonPath "['/var/www/html/ripsol'] + sys.path"
---
Tried but the same problem persist

I keep trying, no surrender! thanks to all your responses

César
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problems with Apache + mod_python

2008-03-28 Thread Slayer_X

Hi everyone!

> Michael Wieher wrote:
> Get rid of your installation of django and re-install it.
---
done

>To test it, go to any unrelated location in your file-system  (ie: cd /usr
>or cd /var or something, start up python and import django.)
---
I can import django without errors

>Also, be sure you don't have duplicate copies of python 2.4 installed on
>your system.
---
Just 1 copy of python (python-2.4.3-19.el5)

>Evert Rol wrote:
>You shouldn't need to add '/usr/lib/python2.4/site-packages/' to
>PythonPath: django is already in site-packages, and python (assuming
>that's python2.4 in /usr/bin) will automatically search there.
>You should, however, add the path to the 'ripsol' project there (or
>actually the path just above that); otherwise Python cannot pick up
>the ripsol.settings file (or any of your python files within ripsol).
>And I guess it should find something to test your setup when accessing
>the URL.
---
Done! and the python binary is in the correct location

>Karen Tracey:
>I know nothing of CentOS but from googling a bit it sounds like it
>is a distrib possibly based off of SELinux (security-enhanced).  Is django
>actually installed under site-packages or is it just linked there?  If it's
>only linked, and the link is to some user-owned space, then probably the
>issue is that apache doesn't have the access rights to read that space.
--
U can disable SElinux using system-config-security or modifying the /
etc/sysconfig/selinux file directly, after this u need to reboot :)

If u want to be sure about SElinux status run:
/usr/bin/sestatus -v

Obviusly I disabled SELinux on my system

> Graham Dumpleton wrote:
>Since mod_wsgi shares many of the same issues as mod_python, you may
>want to also read the issues documents for mod_wsgi:

>  http://code.google.com/p/modwsgi/wiki/ApplicationIssues
--
Thanks for the link, Im reading and watching probably issues, news
coming soon ;)

On Mar 27, 6:19 pm, Floyd Arguello <[EMAIL PROTECTED]> wrote:
> Try this:
> PythonPath "['/var/www/html/ripsol'] + sys.path"
---
Tried but the same problem persist

I keep trying, no surrender! thanks to all your responses

César
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problems with Apache + mod_python

2008-03-27 Thread Floyd Arguello

Slayer_X wrote:
> # vim /etc/httpd/conf/httpd.conf
> 
> PythonPath "['/usr/lib/python2.4/site-packages/django'] +
> sys.path"
> SetHandler python-program
> PythonHandler django.core.handlers.modpython
> PythonDebug On
> SetEnv DJANGO_SETTINGS_MODULE ripsol.settings
> 

Try this:

PythonPath "['/var/www/html/ripsol'] + sys.path"


Good luck!

Floyd

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problems with Apache + mod_python

2008-03-27 Thread Graham Dumpleton

On Mar 28, 9:32 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Thu, Mar 27, 2008 at 3:13 PM, Michael Wieher <[EMAIL PROTECTED]>
> wrote:
>
> > but this is the error message.
>
> > >ImportError: No module named django
>
> > shouldn't that mean that python can't find the django module?  regardless
> > of if he has further issues, modules within modules or anything, if python
> > can't find the initial django module that means a bad install?
>
> It means python running under apache can't find django.  However the dev
> server works, so django is there.  Which leads me to suspect a permissions
> problem.  I know nothing of CentOS but from googling a bit it sounds like it
> is a distrib possibly based off of SELinux (security-enhanced).  Is django
> actually installed under site-packages or is it just linked there?  If it's
> only linked, and the link is to some user-owned space, then probably the
> issue is that apache doesn't have the access rights to read that space.
> Search the list for SELinux and you'll get some hits for other people who
> have tacked this problem and figured out how to set things up so apache
> could read their files.

Since mod_wsgi shares many of the same issues as mod_python, you may
want to also read the issues documents for mod_wsgi:

  http://code.google.com/p/modwsgi/wiki/ApplicationIssues

In particular those sections dealing with Access Rights of Apache User
and Secure Variants of UNIX.

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problems with Apache + mod_python

2008-03-27 Thread Karen Tracey
On Thu, Mar 27, 2008 at 3:13 PM, Michael Wieher <[EMAIL PROTECTED]>
wrote:

> but this is the error message.
>
> >ImportError: No module named django
>
> shouldn't that mean that python can't find the django module?  regardless
> of if he has further issues, modules within modules or anything, if python
> can't find the initial django module that means a bad install?


It means python running under apache can't find django.  However the dev
server works, so django is there.  Which leads me to suspect a permissions
problem.  I know nothing of CentOS but from googling a bit it sounds like it
is a distrib possibly based off of SELinux (security-enhanced).  Is django
actually installed under site-packages or is it just linked there?  If it's
only linked, and the link is to some user-owned space, then probably the
issue is that apache doesn't have the access rights to read that space.
Search the list for SELinux and you'll get some hits for other people who
have tacked this problem and figured out how to set things up so apache
could read their files.

Karen

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problems with Apache + mod_python

2008-03-27 Thread Michael Wieher
but this is the error message.


>ImportError: No module named django

shouldn't that mean that python can't find the django module?  regardless of
if he has further issues, modules within modules or anything, if python
can't find the initial django module that means a bad install?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problems with Apache + mod_python

2008-03-27 Thread Evert Rol

> If your python interpreter can't import django, you installed it  
> wrong.
> C'est tres facil.

One of the previous post in this thread mentions the development  
server works fine, so django can be imported from the shell  
apparently. But testing that will never hurt; there may happen to be a  
django installation in the project directory as well, that would mess  
up things.


> the django module should be installed to the system and should be  
> importable from anywhere.  Setting your PYTHON_PATH is, at best, a  
> hack, and at worst, will cause massive problems (as hacks do) when  
> any little unrelated thing changes.

Unless you don't have root access (although that's not the case here).  
Setting PythonPath isn't a hack, it can be a very convenient way to  
keep a lot of stuff out of root access. But see below.


> > are you sure you have django directory _IN_
> >
> > /usr/lib/python2.4/site-packages/django
>
> Yes, I have the django directory
>
>
> > or is it only
> >
> > /usr/lib/python2.4/site-packages/django/core/handlers/modpython.py
> --
> I have that file too
>
>
> > then you would need only
> >
> > /usr/lib/python2.4/site-packages
> >
> > in the path ?
> >
> > -- tony
> --
> I tried with
> PythonPath "['/usr/lib/python2.4/site-packages/django'] +
> sys.path"
>
> and
>
> PythonPath "['/usr/lib/python2.4/site-packages/'] +
> sys.path"
>
> And I obtain the same error:
> 
> Mod_python error: "PythonHandler django.core.handlers.modpython"
>
> Traceback (most recent call last):
>
>  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
> 287, in HandlerDispatch
>log=debug)
>
>  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
> 461, in import_module
>f, p, d = imp.find_module(parts[i], path)
>
> ImportError: No module named django
> ^


You shouldn't need to add '/usr/lib/python2.4/site-packages/' to  
PythonPath: django is already in site-packages, and python (assuming  
that's python2.4 in /usr/bin) will automatically search there.
You should, however, add the path to the 'ripsol' project there (or  
actually the path just above that); otherwise Python cannot pick up  
the ripsol.settings file (or any of your python files within ripsol).  
And I guess it should find something to test your setup when accessing  
the URL. As in the second code-part at 
http://www.djangoproject.com/documentation/modpython/#basic-configuration
I'm not sure if that helps your problem, but problems (and solutions)  
occur in strange ways.



--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problems with Apache + mod_python

2008-03-27 Thread Michael Wieher
Look.
If your python interpreter can't import django, you installed it wrong.
C'est tres facil.

the django module should be installed to the system and should be importable
from anywhere.  Setting your PYTHON_PATH is, at best, a hack, and at worst,
will cause massive problems (as hacks do) when any little unrelated thing
changes.

Get rid of your installation of django and re-install it.

if I had to guess (and I do) I'd say somehow or someway there is a
permissions issue, but doing a simple removal/reinstall is the easiest way I
can think of.

To test it, go to any unrelated location in your file-system  (ie: cd /usr
or cd /var or something, start up python and import django.)

There should never be a need to fiddle with your PATH or your PYTHON_PATH
when importing django if it was installed correctly.

Also, be sure you don't have duplicate copies of python 2.4 installed on
your system.

On Thu, Mar 27, 2008 at 11:51 AM, Slayer_X <[EMAIL PROTECTED]> wrote:

>
> Hi, sorry for the delay
>
> On Mar 16, 2:45 pm, prz <[EMAIL PROTECTED]> wrote:
> > are you sure you have django directory _IN_
> >
> > /usr/lib/python2.4/site-packages/django
>
> Yes, I have the django directory
>
>
> > or is it only
> >
> > /usr/lib/python2.4/site-packages/django/core/handlers/modpython.py
> --
> I have that file too
>
>
> > then you would need only
> >
> > /usr/lib/python2.4/site-packages
> >
> > in the path ?
> >
> > -- tony
> --
> I tried with
> PythonPath "['/usr/lib/python2.4/site-packages/django'] +
> sys.path"
>
> and
>
> PythonPath "['/usr/lib/python2.4/site-packages/'] +
> sys.path"
>
> And I obtain the same error:
> 
> Mod_python error: "PythonHandler django.core.handlers.modpython"
>
> Traceback (most recent call last):
>
>  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
> 287, in HandlerDispatch
>log=debug)
>
>  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
> 461, in import_module
>f, p, d = imp.find_module(parts[i], path)
>
> ImportError: No module named django
> ^
>
> Help me please
>
> César
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Problems with Apache + mod_python

2008-03-27 Thread Slayer_X

Hi, sorry for the delay

On Mar 16, 2:45 pm, prz <[EMAIL PROTECTED]> wrote:
> are you sure you have django directory _IN_
>
> /usr/lib/python2.4/site-packages/django

Yes, I have the django directory


> or is it only
>
> /usr/lib/python2.4/site-packages/django/core/handlers/modpython.py
--
I have that file too


> then you would need only
>
> /usr/lib/python2.4/site-packages
>
> in the path ?
>
>     -- tony
--
I tried with
PythonPath "['/usr/lib/python2.4/site-packages/django'] +
sys.path"

and

PythonPath "['/usr/lib/python2.4/site-packages/'] +
sys.path"

And I obtain the same error:

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
287, in HandlerDispatch
log=debug)

  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
461, in import_module
f, p, d = imp.find_module(parts[i], path)

ImportError: No module named django
^

Help me please

César
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---