Is there 'django.contrib.auth.middleware.AuthenticationMiddleware' in
your MIDDLEWARE_CLASSES ?

On 29 дек, 18:10, Chris Haynes <[EMAIL PROTECTED]> wrote:
> Thanks a lot, syncdb now works with the admin stuff, and
> I entered the superuser account stuff when requested.
>
> After that I restart the server and get AttributeError at /admin/
> 'WSGIRequest' object has no attribute 'user', with traceback 
> athttp://dpaste.com/29308/. Don't see the admin login screen.
>
> I'm using
> urlpatterns = patterns(
>     '',
>     (r'^submit/', submit),
>     (r'^time/$', current_datetime),
>     (r'^admin/',
> include('django.contrib.admin.urls')),
> )
>
> Any more thoughts much appreciated.
>
> Chris
>
> On Dec 27, 2:12 pm, hedronist <[EMAIL PROTECTED]> wrote:
>
> > Not having the book yet (it's in the mail) I'm not sure exactly what
> > is on page 84, so I'll make a couple of suggestions/observations.
>
> > The "No such table" error message means exactly what it says, so this
> > really feels like "python manage.py syncdb" wasn't run (or wasn't run
> > successfully).
>
> > In addition to uncommenting the MIDDLEWARE lines you also want to
> > uncomment the following INSTALLED_APPS lines:
>
> > INSTALLED_APPS = (
> >     'django.contrib.auth',       # This includes creating the table
> > 'auth_user'
> >     'django.contrib.contenttypes',
> >     'django.contrib.sessions',  # This creates the table
> > 'django_sessions'
> >     'django.contrib.sites',
> > )
>
> > and *then* run syncdb again.
>
> > If you still don't get prompted for superuser it might mean the Django
> > thinks that it has already created these tables (but the error message
> > indicates it doesn't think so). Once Django sees that the table
> > exists, it won't make any changes to it. This is called schema
> > evolution (or migration) and it can be a tripping point.
>
> > So, you might want to reset the world by:
>
> >            python manage.py reset auth sessions --noinput  # or
> > whatever apps you are doing the reset on
>
> > or, more brutally, just delete your sqlite3 file and do a syncdb.
> > Either of these will destroy any data in the associated tables, but
> > since you are working through a tutorial I'm assuming that you don't
> > have too much invested in them.
>
> >   HTH,
> >   Peter
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to