python - Django allauth allowed urls -
i started django project using allauth, configured basic settings, without using 3rd party provider. i've created basic template profile page. working expected far, if go localhost:8000/accounts/profile can see page without log in before. i've tried in documentation how define page should require logged in haven't found anything.
any thoughts? thanks!
edit these allauth settings:
#allauth config account_authentication_method = 'email' account_email_required = true account_unique_email = true account_username_required = false account_signup_form_class = 'picturesapp.forms.signupform' account_email_verification = 'none'
one possible way want decorate view handling profile page woth 'login_required' decorator.
example:
from django.contrib.auth.decorators import login_required urlpatterns = patterns('', # profile url(r'^$', login_required(myprofiledetailview.as_view()), name="my_profile" ) )
this decorator verifies user logged in, otherwise returns redirect http response (to login url).
hope helps you.
Comments
Post a Comment