Django Admin asks password every operation

138 views
Skip to first unread message

Stefano T

unread,
Oct 5, 2012, 12:57:24 PM10/5/12
to Django users
Hi all.
i'm new to django and i'm facing a problem i can't solve so far.
Basically, when i log in in the admin part, every operation i do it
ask me for the login. doesn't matter which browser i user, it's always
the same.
at the beginning it was acting normally: once logged in i stay logged
in until the logout.
idea?

ciao

Larry Martell

unread,
Oct 5, 2012, 1:31:52 PM10/5/12
to django...@googlegroups.com
What is SESSION_COOKIE_AGE set to in your settings file? Or are
cookies disabled for your browser?

Stefano T

unread,
Oct 5, 2012, 2:10:09 PM10/5/12
to django...@googlegroups.com
i didn't est SESSION_COOKIE_AGE anywhere, so i suppose it's set to its default value.
Cookies are enabled.
i'm facing the problem in chrome (i deleted all the browser data, nothing changed)
with FF it works.
Before it was working with chrome, suddently it stopped.

Stefano T

unread,
Oct 5, 2012, 2:15:25 PM10/5/12
to django...@googlegroups.com
wait i may have spotted out the problem:
if i've an app, is this the correct url pattern for the homepage? 

    url(r'^', 'earth.views.Home'),

or does it take ll the urls?

Bill Freeman

unread,
Oct 5, 2012, 6:52:33 PM10/5/12
to django...@googlegroups.com
All urls match this. The regular expression says "any URL that starts
from the beginning, no matter what follows. I suspect that you want
'r^$'

Bill
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/jJ7LrE2_TC0J.
>
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

Stefano T

unread,
Oct 6, 2012, 9:53:36 AM10/6/12
to django...@googlegroups.com
What i want is to match the root of my website with a url.

Babatunde Akinyanmi

unread,
Oct 6, 2012, 9:58:28 AM10/6/12
to django...@googlegroups.com
I suspect Bill's answer is what you are looking for as regards the
url. However, it won't solve the password problem
>> > django...@googlegroups.com<javascript:>.
>>
>> > To unsubscribe from this group, send email to
>> > django-users...@googlegroups.com <javascript:>.
>> > For more options, visit this group at
>> > http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/Qj_oADXTnvIJ.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

--
Sent from my mobile device

Victor Rocha

unread,
Oct 6, 2012, 10:05:33 AM10/6/12
to django...@googlegroups.com
Depending on what exactly you want to accomplish to match the root to a url, I do as follow:
url(r'^$', 'earth.views.Home'),

However, it is sometimes good to have a default page if a request didnt match the url requested (I would use this as the very last rule, otherwise it will catch every request):
url(r'^', 'earth.views.Home'),

As for your origina question, are you sure you have your session middleware activated?

Stefano T

unread,
Oct 7, 2012, 5:19:50 AM10/7/12
to Django users
Actually i had the url matching that was matchin all the request and
send it to home.
the problem was that in the home view i accidentally copied a
logout(request) into the view and obviusly every time it was logging
out me.

now it works.
Reply all
Reply to author
Forward
0 new messages