Setting Up User Authentication in Wagtail

600 views
Skip to first unread message

Mohit Gupta

unread,
May 19, 2015, 3:11:03 AM5/19/15
to wag...@googlegroups.com
Hello,

I've noticed that wagtail sets the LOGIN_URL and LOGIN_REDIRECT_URL variables to redirect from the django admin to the Wagtail admin. 

As far as I know, if I'd like to use the @login_required decorator, I need to be able to set these variables for my user login pages. Is there a current workaround for this?

Full disclosure: I'm pretty green at setting these up with Django much less wagtail.

Any help would be appreciated!

Matthew Westcott

unread,
May 19, 2015, 5:45:12 AM5/19/15
to wag...@googlegroups.com
Hi Mohit,
The forthcoming Wagtail 1.0 release will eliminate the need for these variables:
http://docs.wagtail.io/en/latest/releases/1.0.html#you-no-longer-need-login-url-and-login-redirect-url-to-point-to-wagtail-admin
For now, you can use the Wagtail 1.0 beta release (set 'wagtail==1.0b1' in your requirements file).

Cheers,
- Matt

Mohit Gupta

unread,
May 20, 2015, 4:16:44 AM5/20/15
to wag...@googlegroups.com
Thanks for the quick reply Matt.

I also noticed that django.contrib.sites is isn't one of the default INSTALLED_APPS. 

Would I be able to install django.contrib.sites without causing any big problems with the wagtail?

Cheers,

Mo

Matthew Westcott

unread,
May 20, 2015, 7:56:05 AM5/20/15
to wag...@googlegroups.com
Hi Mo,
I think enabling django.contrib.sites should be fine, although it probably hasn't had much testing - so give it a go, and let us know if you run into any issues. The only restriction I'm aware of is that you probably won't be able to use Django's CurrentSiteMiddleware <https://docs.djangoproject.com/en/1.8/ref/contrib/sites/#site-middleware>, as the 'request.site' variable conflicts with the one set by Wagtail's SiteMiddleware.

Cheers,
- Matt
> --
> You received this message because you are subscribed to the Google Groups "Wagtail support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wagtail+u...@googlegroups.com.
> To post to this group, send email to wag...@googlegroups.com.
> Visit this group at http://groups.google.com/group/wagtail.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/wagtail/0f9a9d3d-d9cb-4fc6-a795-62d3c14995a8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages