Mandatory authentication for users to access site

14 views
Skip to first unread message

John Tate

unread,
Nov 24, 2022, 6:50:18 AM11/24/22
to Mezzanine Users
Hey Mezzanine Community,

I have been using Mezzanine CMS happily for my personal website for many years where I post blogs and such, open to the public.

I want to deploy another site on a subdomain where I can post blogs much the same but in a private matter, for people invited only. I basically intend to start with `pip install mezzanine --user` much like my personal site (but as another Linux user account), where most details were taken care of for me. I run Mezzanine because it got my site running quickly!

I just want to configure it so that a login is required to view any pages or blog posts whatsoever. I can't find much on doing this, and as far as changing mezzanine goes it is important the solution is the simplest one possible.

I also want it so user accounts and passwords to access this site are created by myself and myself only. Any registration features need to be disabled.

John

Danny

unread,
Nov 26, 2022, 5:20:31 PM11/26/22
to mezzani...@googlegroups.com
Some suggestions:

- Check the 'Login required' box on all Pages
- Update your base template to hide any "Sign Up" links
- add ACCOUNTS_APPROVAL_REQUIRED=True to your settings.py
This means that even of someone does sign up without your knowledge, you'll have to approve/activate the account manually as admin.
- Add the decorator @login_required to functions in views.py (and use these in urls.py as an override of the mezzanine defaults).

This is likely the biggest change, as you'll want to override the default Mezzanine blog behaviour so that it uses your URLs/views rather than the default ones.

Hope this helps.

Seeya. Danny.

--
You received this message because you are subscribed to the Google Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mezzanine-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mezzanine-users/3a07d74a-d2ce-4257-8a62-dffc778d58bdn%40googlegroups.com.


Reply all
Reply to author
Forward
0 new messages