How to resolve user registration and activation email error in Django registration?

Posted by user2476295 on Stack Overflow See other posts from Stack Overflow or by user2476295
Published on 2013-07-02T22:52:05Z Indexed on 2013/07/02 23:05 UTC
Read the original article Hit count: 472

So I was just trying to setup a basic user authentication in Django and downloaded a django registration app with templates. Now when I run the server at 127.0.0.1:8000/accounts/register/ I get a basic registration page, I fill in the details and when I click submit I get this error "NoReverseMatch at /accounts/register/"

Error during template rendering
In template Users/sudhasinha/mysite/mysite/registration/templates/registration/activation_email.txt,   error at line 4
'url' requires a non-empty first argument. The syntax changed in Django 1.5, see the docs.
1   {% load i18n %}
2   {% trans "Activate account at" %} {{ site.name }}:
3   
4   http://{{ site.domain }}{**% url registration_activate activation_key %**}
5   
6   {% blocktrans %}Link is valid for {{ expiration_days }} days.{% endblocktrans %}
7   

This is what my activation_email.txt looks like:

{% load i18n %}
{% trans "Activate account at" %} {{ site.name }}:

http://{{ site.domain }}{% url registration_activate activation_key %}

{% blocktrans %}Link is valid for {{ expiration_days }} days.{% endblocktrans %}

And this is what my registration_form.html looks like:

{% extends "base.html" %}
{% load i18n %}

{% block content %}
<form method="post" action=".">
{{ form.as_p }}

<input type="submit" value="{% trans 'Submit' %}" />
</form>
{% endblock %}

I have very minimal experience with Django and would appreciate some help to resolve this error. My urls seem to be setup correctly but I will post it if needed. Also pardon my horrible formatting

© Stack Overflow or respective owner

Related posts about django

Related posts about django-forms