ubernostrum / django-registration

An extensible user-registration app for Django.
BSD 3-Clause "New" or "Revised" License
923 stars 241 forks source link

Template Does Not Exist for Login #207

Closed Archetype90 closed 4 years ago

Archetype90 commented 4 years ago

I will apologize in advance, as I believe this is user error, but having followed the documentation, read the issues on this GitHub page, and Googled the problem, I am not sure what could be causing it in this specific case.

I had used the package in the past with great success, but I have run into a problem now with the login page. I have followed the quick setup guide for the two step activation method. I have done the following:

  1. Added django_registration to installed apps
  2. Added django.contib.auth to installed apps
  3. Added ACCOUNT_ACTIVATION_DAYS to settings.py
  4. Updated urls.py with django_registration.backends.activation.urls and django.contrib.auth.urls
  5. Added templates to the templates/django_registration/ folder

After following these steps, I was able to add the following links to my landing page and have the page successfully render:

<li class="nav-item"><a href="{% url 'login' %}" class="nav-link">Login</a></li>
<li class="nav-item"><a href="{% url 'django_registration_register' %}" class="nav-link">Register</a></li>

When clicking the "Register" button it successfully takes me to my registration template. But, when clicking the login button, I get the following error:

TemplateDoesNotExist at /accounts/login/
registration/landing_page.html

Now, landing_page.html is the page where the links to login and registration above exist. The error is very explicit. If I create a registration folder in templates and put my login.html template there, but rename it to landing_page,html all is well. But none of this should be necessary (at least from the past times I had used the package). I have not been able to find anything in the upgrade section (although technically this is not an upgrade), nor have I found any information about login pages anywhere else.

This does seem to be a fairly common issue on Google, but most of the people seem to be creating their own registration system. From the last time I used the application this handled everything from registration to activation to login.

The documentation for django-registration suggests the same thing:

Users would then be able to register by visiting the URL /accounts/register/, log in (once activated) at /accounts/login/, etc.

The sample URL configuration above also sets up the built-in auth views included in Django (login, logout, password reset, etc.) via the django.contrib.auth.urls URLconf.

Again, I apologize for what is likely user error, and thank you for any help you may be able to provide.

Archetype90 commented 4 years ago

Going to go ahead and close the issue. While it still exists, I still suspect it was user error. I have moved to the redux package and have had no similar issues.