damon
damon

Reputation: 8477

registration_complete template not shown with 0.8 version of django-registration

I was previously using 0.6 version of django-registration.Now I upgraded to 0.8 ,and some issues are cropping up in my webapp

I have in the templates/registration folder ,these files needed for register(among others)

activation_complete.html activation_email.txt activation_email_subject.txt registration_form.html registration_complete.html

The registration_form.html is

{% extends "registration/auth_base.html" %}
{% block content %}{{block.super}}
<div class="subtitle short">Register</div>
       <div id="registerform" class="box half">
        <form action="/myapp/account/register/" method="POST">{% csrf_token %}
        {% if form.non_field_errors %}
            {{ form.non_field_errors }}
        {% endif %}
        <fieldset class="registerfields">            
            <p><label for="id_username">Username:</label> {{ form.username }}</p>
            {% if form.username.errors %}<p class="error">{{ form.username.errors }}</p>{% endif %}            
            <p><label for="id_email">EmailAddress:</label>{{ form.email }}</p>
            {% if form.email.errors %}<p class="error">{{ form.email.errors }}</p>{% endif %}
            <p><label for="id_password1">Password:</label>{{ form.password1 }}</p>
            {% if form.password1.errors %}<p class="error">{{ form.password1.errors }}</p>{% endif %}
            <p><label for="id_password2">Password(again):</label>{{ form.password2 }}</p>
            {% if form.password2.errors %}<p class="error">{{ form.password2.errors }}</p>{% endif %}

        <p>
            <input type="submit" value="Submit" />
        </p>
        </fieldset>

        </form>
        </div>
{% endblock %}

The template registration_complete.html is as below

{% extends "registration/auth_base.html" %}
{% block content %}{{block.super}}

<p id="message">Registration Complete! Check your email</p> 

{% endblock %}

Also here is the auth_base.html

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Myapp{% block title %} {% endblock %}</title>
<LINK REL=StyleSheet HREF="{{MEDIA_URL}}css/myapp.css" TYPE="text/css" MEDIA="screen, print"/>
<link rel="shortcut icon" href="{{ MEDIA_URL }}img/myapp-icon.ico"/>
</head>
<body>

<div id="content">
   {% block content %}

   {% endblock %}
 </div>

<div id="sidebar"> 
    <h3> page info </h3>
    {% block whatis %}
    {% endblock %}

</div>
<div id="homelnk">
<a href="{% url home %}"><img class="centerpage" src="{{ MEDIA_URL }}img/home.png"></a>
</div>
</body>
</html>

But when I submit a new user details for registration,I am not getting this registration_complete page.I still get a registration form with blank fields

Still,the activation link is sent to the email , and I am able to login as the new user..Why is the registration_complete page not shown?This used to work in the older version of django-registration ..I couldn't find anything in the upgrade guide regarding the templates..

Any advice appreciated

Upvotes: 0

Views: 266

Answers (1)

ltbesh
ltbesh

Reputation: 667

I use this template for registration_form.html:

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

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

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

You can find more of those here : https://github.com/nathanborror/django-registration/tree/master/registration/templates/registration

Upvotes: 1

Related Questions