Django on Apache (mod_python) administration cookie problem

121 views
Skip to first unread message

Daniel "bodom_lx" Graziotin

unread,
Sep 29, 2008, 7:55:52 PM9/29/08
to django...@googlegroups.com
Hi everybody! I'm a new Django developer and for learning the
framework I decided to create (another) pastebin clone that I
published on http://incollo.com
The application works very well and I'm very proud of it because I
started learning Django six days ago :-)
Anyway..
I'm having problems in accessing the Django administration panel,
which works perfectly with the development built-in webserver.
This is what I receive when I try to login:
---
Looks like your browser isn't configured to accept cookies. Please
enable cookies, reload this page, and try again.
---
It makes me think that this is a Apache + mod_python related
problem..The Django application works..The media directory for admin
is correctly served (I created a media-admin directory and copied in
it the content django/contrib/admin/media

Any help? Thank you very much

--
Daniel "bodom_lx" Graziotin
- http://bd-things.net
- http://bd-things.net/bodom_lx.asc - GPG public key


--
Daniel "bodom_lx" Graziotin
- http://bd-things.net
- http://bd-things.net/bodom_lx.asc - GPG public key

Álvaro Justen

unread,
Sep 30, 2008, 8:56:14 PM9/30/08
to Django users
Daniel bodom_lx Graziotin wrote:
> Hi everybody! I'm a new Django developer and for learning the
> framework I decided to create (another) pastebin clone that I
> published on http://incollo.com
> The application works very well and I'm very proud of it because I
> started learning Django six days ago :-)
> Anyway..
> I'm having problems in accessing the Django administration panel,
> which works perfectly with the development built-in webserver.
> This is what I receive when I try to login:
> ---
> Looks like your browser isn't configured to accept cookies. Please
> enable cookies, reload this page, and try again.
> ---
> It makes me think that this is a Apache + mod_python related
> problem..The Django application works..The media directory for admin
> is correctly served (I created a media-admin directory and copied in
> it the content django/contrib/admin/media
>
> Any help? Thank you very much

Hello,
I was with the same error and romke in #dja...@irc.freenode.net helped
me to solve this problem.
The solution is to disable mhash in PHP (or other mod_* that uses
this). To do this, comment the line that enable mhash extension in
your php.ini - in my caseI edited /etc/php5/conf.d/mhash.ini (I use
Debian).

I found this information in: http://blog.foozia.com/blog/2007/may/20/cookie-problem-django-admin/

--
Cheers,
Álvaro Justen
Debian GNU/Linux user

Álvaro Justen

unread,
Sep 30, 2008, 9:05:03 PM9/30/08
to Django users
Ah, some details:
-> Admin interface runs OK with python manage.py runserver - as of it
is an Apache error, Django's web server isn't affected by this bug.
-> I'm using Debian etch as server: I've installed Apache, PHP and
mod_php with Debian packages, but Django installed manually.
-> Versions:
* Apache: Server version: Apache/2.2.3
Server built: Mar 22 2008 09:29:10
* PHP: PHP 5.2.0-8+etch11 (cli) (built: May 10 2008 10:46:24)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
* Django: 1.0-final-SVN-unknown

Graham Dumpleton

unread,
Sep 30, 2008, 9:09:57 PM9/30/08
to Django users


On Oct 1, 10:56 am, Álvaro Justen <alvarojus...@gmail.com> wrote:
> Daniel bodom_lx Graziotin wrote:
> > Hi everybody! I'm a new Django developer and for learning the
> > framework I decided to create (another) pastebin clone that I
> > published onhttp://incollo.com
> > The application works very well and I'm very proud of it because I
> > started learning Django six days ago :-)
> > Anyway..
> > I'm having problems in accessing the Django administration panel,
> > which works perfectly with the development built-in webserver.
> > This is what I receive when I try to login:
> > ---
> > Looks like your browser isn't configured to accept cookies. Please
> > enable cookies, reload this page, and try again.
> > ---
> > It makes me think that this is a Apache + mod_python related
> > problem..The Django application works..The media directory for admin
> > is correctly served (I created a media-admin directory and copied in
> > it the content django/contrib/admin/media
>
> > Any help? Thank you very much
>
> Hello,
> I was with the same error and romke in #dja...@irc.freenode.net helped
> me to solve this problem.
> The solution is to disable mhash in PHP (or other mod_* that uses
> this). To do this, comment the line that enable mhash extension in
> your php.ini - in my caseI edited /etc/php5/conf.d/mhash.ini (I use
> Debian).
>
> I found this information in:http://blog.foozia.com/blog/2007/may/20/cookie-problem-django-admin/

If it is that problem, the proper fix is to update your Python
installation to one that Debian hasn't broken. See:

http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Python_MD5_Hash_Module_Conflict
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=440272

Graham

Daniel bodom_lx Graziotin

unread,
Oct 10, 2008, 10:39:02 AM10/10/08
to Django users
Thank you very much for your replies, Alvaro and Graham!
Removing php5-mhash solved the problem

M.Ganesh

unread,
Oct 21, 2008, 7:52:24 PM10/21/08
to django...@googlegroups.com
Hi Daniel,

I am also facing the same problem. I really can't understand the
technicalities of the solution offered in this thread. Since you seemed
to have solved the problem, can you please give a little more details on
how to do it

Thanks in advance

Regards Ganesh

Graham Dumpleton

unread,
Oct 21, 2008, 8:04:02 PM10/21/08
to Django users


On Oct 22, 10:52 am, "M.Ganesh" <ganeshpuls...@gmail.com> wrote:
> Hi Daniel,
>
> I am also facing the same problem. I really can't understand the
> technicalities of the solution offered in this thread. Since you seemed
> to have solved the problem, can you please give a little more details on
> how to do it

Disabling the PHP mhash module is only a workaround even if it does
work.

The proper fix if it is this issue is to refresh your Python 2.4
installation to get fixed version from Debian repository, or even
perhaps upgrade to Python 2.5 and newer mod_python version which uses
Python 2.5.

Alternatively, disable PHP from Apache completely if you do not need
it.

Which of the three options don't you understand and are wanting more
detail for?

Graham

M.Ganesh

unread,
Oct 24, 2008, 8:59:48 PM10/24/08
to django...@googlegroups.com
Graham,
Option 3: I use other utilities like wordpress and phpMyAdmin, so I cannot afford to disable php completely
Option 2: I use Linux Mint (Ubuntu variant) for developement and Debian Etch for production. So for option 2, I will require two sets of instructions, which means more trouble for you. So let me skip that.
Option 1: If this work around works for me, I'll get going and think of better permanent solutions later
Kindly help me on option one (disabling PHP mhash)


Thanks in advance

Regards Ganesh

Graham Dumpleton

unread,
Oct 24, 2008, 10:57:41 PM10/24/08
to Django users


On Oct 25, 11:59 am, "M.Ganesh" <ganeshpuls...@gmail.com> wrote:
> Graham,
> Option 3: I use other utilities like wordpress and phpMyAdmin, so I cannot afford to disable php completely
> Option 2: I use Linux Mint (Ubuntu variant) for developement and Debian Etch for production. So for option 2, I will require two sets of instructions, which means more trouble for you. So let me skip that.
> Option 1: If this work around works for me, I'll get going and think of better permanent solutions later
> Kindly help me on option one (disabling PHP mhash)

That one I can't help you with as know nothing about PHP. I presume
there is a configuration file for PHP somewhere you need to edit and
comment out load line for PHP mhash module.

Graham

> Thanks in advance
> Regards Ganesh
> Graham Dumpleton wrote:Disabling the PHP mhash module is only a workaround even if it does work. The proper fix if it is this issue is to refresh your Python 2.4 installation to get fixed version from Debian repository, or even perhaps upgrade to Python 2.5 and newer mod_python version which uses Python 2.5. Alternatively, disable PHP from Apache completely if you do not need it. Which of the three options don't you understand and are wanting more detail for? GrahamThanks in advance Regards Ganesh Daniel bodom_lx Graziotin wrote:Thank you very much for your replies, Alvaro and Graham! Removing php5-mhash solved the problem

Dave Dash

unread,
Nov 4, 2008, 1:08:29 AM11/4/08
to Django users
I am witnessing this issue using manage.py runserver.

The only useful information I can give is this was working when I was
running .97 (or whatever was the trunk a few months back), I recently
upgraded to the latest trunk (~1.1) and now continually get this
message.

I suspect something has changed in the last few months and I missed
whatever it was. I'm going to attempt to setup a dummy project and
try this again.

If anybody has some clue, please let me know,

Cheers,

Dave Dash

Graham Dumpleton

unread,
Nov 4, 2008, 1:50:47 AM11/4/08
to Django users


On Nov 4, 5:08 pm, Dave Dash <d...@davedash.com> wrote:
> I am witnessing this issue using manage.py runserver.
>
> The only useful information I can give is this was working when I was
> running .97 (or whatever was the trunk a few months back), I recently
> upgraded to the latest trunk (~1.1) and now continually get this
> message.
>
> I suspect something has changed in the last few months and I missed
> whatever it was.  I'm going to attempt to setup a dummy project and
> try this again.
>
> If anybody has some clue, please let me know,

Clear the cookie for the application from your browser cache.

Graham

Dave Dash

unread,
Nov 4, 2008, 10:29:59 AM11/4/08
to Django users
I had cleared the cookies, I also tried in another browser as well -
same result.

On Nov 3, 10:50 pm, Graham Dumpleton <Graham.Dumple...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages