Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse for 'registration_activate' not found #119

Closed
codecraf8 opened this issue Oct 30, 2015 · 13 comments
Closed

Reverse for 'registration_activate' not found #119

codecraf8 opened this issue Oct 30, 2015 · 13 comments

Comments

@codecraf8
Copy link

I have the following settings -

REGISTRATION_OPEN = True # If True, users can register

ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window; you may, of course, use a different value.

REGISTRATION_AUTO_LOGIN = True # If True, the user will be automatically logged in.

LOGIN_REDIRECT_URL = '/' # The page you want users to arrive at after they successful log in

LOGIN_URL = '/accounts/login/' # The page users are directed to if they are not logged in, and are trying to access pages requiring authentication

INCLUDE_REGISTER_URL = True

And the following in the URLS -

...
url(r'accounts/register/', BaseRegisterView.as_view(), name='registration_register'),
(r'^accounts/', include('registration.backends.simple.urls')),
...

Following error -

Reverse for 'registration_activate' with arguments '('c6ae1dfec24759f7cd8013462c7240f0f21440aa',)'     and keyword arguments '{}' not found. 0 pattern(s) tried: []

Error during template rendering

In template /Users/Saket/.virtualenvs/oss/lib/python2.7/site-  packages/registration/templates/registration/activation_email.txt, error at line 13

Reverse for 'registration_activate' with arguments '('c6ae1dfec24759f7cd8013462c7240f0f21440aa',)' and keyword arguments '{}' not found. 0 pattern(s) tried: []
3   {% blocktrans with site_name=site.name %}
4   You (or someone pretending to be you) have asked to register an account at
5   {{ site_name }}.  If this wasn't you, please ignore this email
6   and your address will be removed from our records.
7   {% endblocktrans %}
8   {% blocktrans %}
9   To activate this account, please click the following link within the next

 10 {{ expiration_days }} days:
 11 {% endblocktrans %}

      http://{{site.domain}}
      {% url 'registration_activate' activation_key %}
@codecraf8 codecraf8 changed the title REverse for 'registration_activate' not found Reverse for 'registration_activate' not found Oct 30, 2015
@dicato
Copy link
Collaborator

dicato commented Jan 15, 2016

@5ak3t is this still valid?

@joshblum
Copy link
Collaborator

joshblum commented Jun 5, 2016

@5ak3t any updates? If not we'll close the issue for now, feel free to reopen if you're still having any problems!

@codecraf8
Copy link
Author

Please close it for now.

@joshblum
Copy link
Collaborator

Thanks @5ak3t!

@shepelevstas
Copy link

cant get {% url 'registration_activate' %} part to work in activation_email.txt
is there a solution?

@joshblum
Copy link
Collaborator

joshblum commented Apr 6, 2017

@5ak3t were you able to find a workaround?

@shepelevstas
Copy link

had to construct it:
http://{{site}}/accounts/activate/{{activation_key}}

@joshblum
Copy link
Collaborator

joshblum commented Apr 6, 2017

@shepelevstas how did you include the urls? perhaps that's why the reverse failed?

@shepelevstas
Copy link

url(r'^accounts/register/$',
RegistrationView.as_view(form_class=UserRegistrationForm),
name="registration_register",
),
url(r'^accounts/activate/(?P<activation_key>[-:\w]+)/$',
ActivationView.as_view(),
name='registration_activate'),
url(r'^accounts/', include('registration.backends.hmac.urls')),

@shepelevstas
Copy link

sorry, don't know how to format text to code here

@joshblum
Copy link
Collaborator

joshblum commented Apr 6, 2017

https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet for formatting :)

also i think that you're using the django-registration project since you have url(r'^accounts/', include('registration.backends.hmac.urls')), and not this one (django-registration-redux). You should open the issue there if they have a bug!

@shepelevstas
Copy link

Wow! That's a facepalm )))))))))) Thanks!:)

@surfer190
Copy link

You will run into this issue if you have given to namespace to the apps urls.py and within that you are including 'registration.backends.default.urls'

So your app finds users:registration_activate but not just registration_activate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants