I am trying to set up a user login page. A user needs to login first before he/she can do anything.
I refered: "http://superjared.com/entry/requiring-login-entire-django- powered-site/" "Then put myproject.middleware.SiteLogin in your MIDDLEWARE_CLASSES in settings.py (replace myproject with your project name) and you’re done" I must have did something wrong. Then how to enable a user login? On Jun 5, 9:07 am, Daniel Roseman <roseman.dan...@googlemail.com> wrote: > On Jun 5, 4:58 pm, David <ww...@yahoo.com> wrote: > > > > > > > Middleware class: > > > MIDDLEWARE_CLASSES = ( > > 'django.middleware.common.CommonMiddleware', > > 'django.contrib.sessions.middleware.SessionMiddleware', > > 'django.contrib.auth.middleware.AuthenticationMiddleware', > > 'mysite.middleware.SiteLogin', > > ) > > > =========== > > urls.py: > > > from django.conf.urls.defaults import * > > from django.contrib import admin > > admin.autodiscover() > > > urlpatterns = patterns('', > > > (r'^admin/(.*)', admin.site.root), > > (r'^accounts/login/', process_request), > > (r'^polls/', include('mysite.polls.urls')), > > ) > > Why are you doing this? You can't map middleware to a URL, it makes > absolutely no sense. What are you trying to do? > -- > DR.- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---