mirror of
https://github.com/mediacms-io/mediacms.git
synced 2024-11-22 00:03:28 +01:00
Feat login required (#204)
* global login required option * add option to require global login
This commit is contained in:
parent
171b9f84d7
commit
748d4bae4b
@ -427,6 +427,10 @@ CELERY_BEAT_SCHEDULE = {
|
|||||||
|
|
||||||
LOCAL_INSTALL = False
|
LOCAL_INSTALL = False
|
||||||
|
|
||||||
|
# this is an option to make the whole portal available to logged in users only
|
||||||
|
# it is placed here so it can be overrided on local_settings.py
|
||||||
|
GLOBAL_LOGIN_REQUIRED = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# keep a local_settings.py file for local overrides
|
# keep a local_settings.py file for local overrides
|
||||||
from .local_settings import *
|
from .local_settings import *
|
||||||
@ -446,3 +450,12 @@ if LOCAL_INSTALL:
|
|||||||
SSL_FRONTEND_HOST = FRONTEND_HOST.replace("http", "https")
|
SSL_FRONTEND_HOST = FRONTEND_HOST.replace("http", "https")
|
||||||
else:
|
else:
|
||||||
SSL_FRONTEND_HOST = FRONTEND_HOST
|
SSL_FRONTEND_HOST = FRONTEND_HOST
|
||||||
|
|
||||||
|
if GLOBAL_LOGIN_REQUIRED:
|
||||||
|
# this should go after the AuthenticationMiddleware middleware
|
||||||
|
MIDDLEWARE.insert(5, "login_required.middleware.LoginRequiredMiddleware")
|
||||||
|
LOGIN_REQUIRED_IGNORE_PATHS = [
|
||||||
|
r'/accounts/login/$',
|
||||||
|
r'/accounts/logout/$',
|
||||||
|
r'/accounts/signup/$',
|
||||||
|
]
|
||||||
|
@ -29,11 +29,14 @@ m3u8
|
|||||||
|
|
||||||
django-ckeditor
|
django-ckeditor
|
||||||
|
|
||||||
|
django-login-required-middleware==0.6.1
|
||||||
|
|
||||||
# extra nice utilities!
|
# extra nice utilities!
|
||||||
rpdb
|
rpdb
|
||||||
tqdm
|
tqdm
|
||||||
ipython
|
ipython
|
||||||
flake8
|
flake8
|
||||||
|
pylint
|
||||||
pep8
|
pep8
|
||||||
django-silk
|
django-silk
|
||||||
django-debug-toolbar
|
django-debug-toolbar
|
||||||
|
Loading…
Reference in New Issue
Block a user