macropin / django-registration

Django-registration (redux) provides user registration functionality for Django websites.
http://django-registration-redux.readthedocs.org
Other
976 stars 350 forks source link

TypeError context must be a dict rather than RequestContext. #270

Closed ghost closed 6 years ago

ghost commented 7 years ago

I am getting an error. "context must be a dict rather than RequestContext."

If I run 'registration.backends.simple.urls' it works fine.

thanks.

TypeError at /accounts/register/
context must be a dict rather than RequestContext. 
Request Method: POST
Request URL:    http://localhost:8000/auth/register/
Django Version: 1.11
Exception Type: TypeError
Exception Value:    
context must be a dict rather than RequestContext.
Exception Location: /usr/local/lib/python3.6/site-packages/django/template/context.py in      make_context, line 287
Python Executable:  /usr/local/opt/python3/bin/python3.6
Python Version: 3.6.1
joshblum commented 7 years ago

@mynumbercrunching what backend are you using? can you provide a full traceback to help us debug?

ghost commented 7 years ago

I was trying to use Django 1.11 when I got the error.

I dropped back to 1.10 and the error went away.

I hope this helps. Cheers.

On Jun 27, 2017, at 8:51 PM, Joshua Blum notifications@github.com wrote:

@mynumbercrunching https://github.com/mynumbercrunching what backend are you using? can you provide a full traceback to help us debug?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/macropin/django-registration/issues/270#issuecomment-311364500, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2eRpwZvrRgjBsftBZigUgd762ka8PXks5sIQjrgaJpZM4OGGvu.

thomas wm. benson | student of humanity & citizen of the world | diogenes@me.com | +1. 239 . 206 . 3240

“Government is not a solution to our problem - government is the problem.” - Ronald Reagan
joshblum commented 7 years ago

Yeah it's related to a change in django 1.11 https://docs.djangoproject.com/en/1.11/releases/1.11/#django-template-backends-django-template-render-prohibits-non-dict-context can you provide a full traceback so we can reproduce the issue and fix it?

ghost commented 7 years ago

I installed the app and am playing with allauth at the moment.

Do you want me to reinstall?

On Jun 27, 2017, at 9:13 PM, Joshua Blum notifications@github.com wrote:

Yeah it's related to a change in django 1.11 https://docs.djangoproject.com/en/1.11/releases/1.11/#django-template-backends-django-template-render-prohibits-non-dict-context https://docs.djangoproject.com/en/1.11/releases/1.11/#django-template-backends-django-template-render-prohibits-non-dict-context can you provide a full traceback so we can reproduce the issue and fix it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/macropin/django-registration/issues/270#issuecomment-311371068, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2eRoFwtbAzTPw8ZenGqxWiDiCi3i4Lks5sIQ4BgaJpZM4OGGvu.

thomas wm. benson | student of humanity & citizen of the world | diogenes@me.com | +1. 239 . 206 . 3240

“Government is not a solution to our problem - government is the problem.” - Ronald Reagan
joshblum commented 7 years ago

give allauth a try, in general we are trying to get new users to migrate since it offers a more comprehensive solution. if you are able reinstall and give some more debug info i'll try to submit a fix :)

ghost commented 7 years ago

One huge issue I have with Allauth is the app name. Why “Account”? I already have an account app. Spent the last several hours trying to rename it so I could test AllAuth.

Why not use AllAuth name for the model?

I have to imagine Account(s) is a very in demand name?

I will try to reinstall and get you the information.

cheers.

On Jun 27, 2017, at 9:28 PM, Joshua Blum notifications@github.com wrote:

give allauth a try, in general we are trying to get new users to migrate since it offers a more comprehensive solution. if you are able reinstall and give some more debug info i'll try to submit a fix :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/macropin/django-registration/issues/270#issuecomment-311375876, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2eRstOa3fBrEj1bHXTerF03LQ5ufDKks5sIRGegaJpZM4OGGvu.

thomas wm. benson | student of humanity & citizen of the world | diogenes@me.com | +1. 239 . 206 . 3240

“Government is not a solution to our problem - government is the problem.” - Ronald Reagan
joshblum commented 6 years ago

hey @mynumbercrunching any update?

ghost commented 6 years ago

I am still in limbo with a Franken-beast sort of login system at the moment. Not sure which app I am going to finally go with?

Might just write my own which I know wont be hard as good.

Just wish there was “simple" way for Redux to login with either the email or user name.

Played with several other apps. I do like Redux the best. I hope you don’t give up on it!

Mine is a secure site with zero need for the social media stuff and AllAuth is too over the top.

And they used to of my app names, “account” and “basecamp”. I guess we must think a lot alike. LOL.

Let me know if I can help or contribute.

Cheers.

On Sep 13, 2017, at 9:39 PM, Joshua Blum notifications@github.com wrote:

hey @mynumbercrunching https://github.com/mynumbercrunching any update?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/macropin/django-registration/issues/270#issuecomment-329189103, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2eRsK5VuUqG017C0yL5iGv_UfUxFVNks5sh-k0gaJpZM4OGGvu.

thomas wm. benson | student of humanity & citizen of the world | diogenes@me.com | +1. 239 . 206 . 3240

“Government is not a solution to our problem - government is the problem.” - Ronald Reagan
joicemjoseph commented 6 years ago

@joshblum Here is the full traceback

../../.virtualenvs/analyse/local/lib/python2.7/site-packages/django/test/client.py:548: in post
    secure=secure, **extra)

../../.virtualenvs/analyse/local/lib/python2.7/site-packages/django/test/client.py:350: in post
    secure=secure, **extra)

../../.virtualenvs/analyse/local/lib/python2.7/site-packages/django/test/client.py:416: in generic
    return self.request(**r)

../../.virtualenvs/analyse/local/lib/python2.7/site-packages/django/test/client.py:501: in request
    six.reraise(*exc_info)

../../.virtualenvs/analyse/local/lib/python2.7/site-packages/django/core/handlers/exception.py:41: in inner response = get_response(request)

../../.virtualenvs/analyse/local/lib/python2.7/site-packages/django/core/handlers/base.py:249: in _legacy_get_response
    response = self._get_response(request)

../../.virtualenvs/analyse/local/lib/python2.7/site-packages/django/core/handlers/base.py:187: in _get_response
response = self.process_exception_by_middleware(e, request)

../../.virtualenvs/analyse/local/lib/python2.7/site-packages/django/core/handlers/base.py:185: in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)

../../.virtualenvs/analyse/local/lib/python2.7/site-packages/django_toolset/decorators.py:34: in _wrapped_view
    return view_func(request, *args, **kwargs)

analyzer/apps/user_auth/views.py:143: in auth_register
    get_current_site(request), request

../../.virtualenvs/analyse/local/lib/python2.7/site-packages/registration/models.py:353: in send_activation_email
    activation_email_subject, ctx_dict))

../../.virtualenvs/analyse/local/lib/python2.7/site-packages/django/template/loader.py:68: in render_to_string
    return template.render(context, request)

../../.virtualenvs/analyse/local/lib/python2.7/site-packages/django/template/backends/django.py:64: in render
    context = make_context(context, request, autoescape=self.backend.engine.autoescape)

../../.virtualenvs/analyse/local/lib/python2.7/site-packages/django/template/context.py:287: in make_context
    raise TypeError('context must be a dict rather than %s.' % context.__class__.__name__)

E   TypeError: context must be a dict rather than RequestContext.
joshblum commented 6 years ago

@joicemjoseph thanks for the traceback. From the traceback it appears that you're using version 1.4 of django-registration which doesn't support Django version 1.11. If you upgrade the issue should resolve. Can you upgrade and confirm? If upgrading resolves your problem we can close this issue.

@mynumbercrunching what version of django-registration were you using?

joicemjoseph commented 6 years ago

Thank you, @joshblum

joshblum commented 6 years ago

Going to close for now, @mynumbercrunching please reopen if upgrading does not resolve your issue!