Friday, March 30, 2012

Re: Doing something silly, I'm sure

I've been using django authentication, for this work I use this settings:

urls.py
url(r'^$', 'django.contrib.auth.views.login', {'template_name': 'home.login.html'})

Template - home.login.html

<form method="post" action="{% url django.contrib.auth.views.login %}">
<div>
<label for="username"> 
<span>{{form.username.label_tag}}</span>
{{form.username}}
</label>
<label for="password"> 
<span>{{form.password.label_tag}}</span>
{{form.password}}
</label>
<input type="submit" value="login"/>
</div>
{% if form.errors %}
<p>Por favor, verifique o usuário e a senha.</p>
{% endif %}
</form>


Ivo Marcelo Leonardi Zaniolo
Contatos: 
Cel: +55 41 88048620 
Email: imarcelolz@gmail.com 
Google Plus Twitter Linkedin Blog Facebook Skype: imarcelolz 




2012/3/30 vanderkerkoff <tonmatt@gmail.com>
Sorry everyone, but this is driving me crazy

https://docs.djangoproject.com/en/1.2/topics/auth/

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)

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


--
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.


--
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