Registration Redux


#1

Just finished integrating the registration module and getting the pages set up. In the book it appears that the content of the Log In, Registration, Confirmation, and Log out pages should if generated by the plug in. When I go to the page, it loads as expected, but with no for content.

Feeling like I missed something obvious, but after going though section a few times, I can’t figure it out.


#2

Hi there! There is a big part of the book (in the registration chapter) where you set up the templates/HTML for those pages in your templates directory. Did you do that?


#3

Chapter 10? Yes, I did that.

When viewing source, there’s nothing in the form:

<form role="form" action="" method="post">
    <input type='hidden' name='csrfmiddlewaretoken' value='o7QKSFsnCjYKJHPTHf4lQLhC9JS61sTfK4PsMO1NtcZ4x6jh4wfpFbdWxACw2mAh' />
    
    <input type="submit" name="" value="Submit">
  </form>


#4

Please confirm a few more things, just double checking stuff:

  1. Is “registration” added to your settings.py file under INSTALLED_APPS?
  2. Did you include the URLs in your urls.py?
  3. Your registration_form.html template includes the code {{ form.as_p }} within the form tag?

Basically sounds like something within the plugin is missing so I’m trying to track down what. Also, what version of djang-registration-redux and django itself are you using? You can find that out by running pip freeze in your terminal (make sure you’re in your virtual environment.)


#5

in settings.py

INSTALLED_APPS = [
'collection',
'registration',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',

]

in urls.py

urlpatterns = [
path('', views.index, name='home'),
path('about/',
TemplateView.as_view(template_name='about.html'),
    name='about'),
path('contact/',
TemplateView.as_view(template_name='contact.html'),
    name='contact'),
path('things/<slug>/', views.thing_detail,
    name='thing_detail'),
path('things/<slug>/edit/',
    views.edit_thing, name='edit_thing'),
path('account/', include('registration.backends.simple.urls')),
path('admin/', admin.site.urls),

]

in registration_form.html

<form role="form" action="" method="post">
{% csrf_token %}
{{ form.a_p }}
<input type="submit" name="" value="Submit">

versions

Django==2.0.9
django-registration-redux==2.0
pytz==2018.7

Does that shed any light?


#6

There’s your problem — it should be {{ form.as_p }}. :)


#7

(-‸ლ)