Friday, March 30, 2012

Re: Doing something silly, I'm sure

On Fri, Mar 30, 2012 at 1:11 PM, vanderkerkoff <tonmatt@gmail.com> wrote:
> Sorry everyone, but this is driving me crazy
>
> https://docs.djangoproject.com/en/1.2/topics/auth/

FYI to others, the stacktrace indicates OP is using 1.3 beta 1.

>
> urls.py
> (r'^accounts/login/$', 'django.contrib.auth.views.login'),
>
> view.py
> if pg.registration_required and not request.user.is_authenticated():
>  return HttpResponseRedirect('/accounts/login/?next=%s' %
> request.path)
>

You should just use the login_required decorator instead of rewriting it.

Also, I'm not sure why you are showing us view code. Your urlconf says
that you are pointing at the stock auth view, so why this snippet?

> Have I read the documentation wrong?  I've created a registration
> folder in my templates folder and a login.html file in there, but
> always with the template not found error
>
> http://pastebin.com/dJ6TJWs1
>
> Any tips or help greatly appreciated
>

So, nothing to do with auth, the real question is "Why isn't my
template found". OK. First things, stop using a beta. Update your
django to 1.3.1, so we can rule out any bug in the beta.

Next, you say you "created a registration folder in my templates
folder and a login.html file in there". Where is this template folder?
Show us the structure of your project and your pertinent apps.

Cheers

Tom

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment