Switch from using the admin login/logout pages to custom 'lemonauth' pages
This commit is contained in:
parent
1670b6d427
commit
c210650ca7
12 changed files with 89 additions and 3 deletions
|
@ -70,6 +70,7 @@ INSTALLED_APPS = [
|
|||
|
||||
'lemoncurry',
|
||||
'home',
|
||||
'lemonauth',
|
||||
'users',
|
||||
'wellknowns',
|
||||
]
|
||||
|
@ -147,6 +148,10 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||
},
|
||||
]
|
||||
|
||||
LOGIN_URL = 'lemonauth:login'
|
||||
LOGIN_REDIRECT_URL = 'home:index'
|
||||
LOGOUT_REDIRECT_URL = LOGIN_REDIRECT_URL
|
||||
|
||||
|
||||
# Internationalization
|
||||
# https://docs.djangoproject.com/en/1.11/topics/i18n/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{% load compress favtags lemoncurry_tags meta static %}<!doctype html>
|
||||
<html lang="en" class="{% block html_class %}{% endblock %}">
|
||||
<head{% meta_namespaces %}>
|
||||
<title class="p-name">{% site_name %}</title>
|
||||
<title class="p-name">{% block title %}{% site_name %}{% endblock %}</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||
{% include 'meta/meta.html' %}
|
||||
|
@ -11,6 +11,7 @@
|
|||
integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous" />
|
||||
{% compress css %}
|
||||
<link rel="stylesheet" type="text/stylus" href="{% static 'lemoncurry/css/layout.styl' %}" />
|
||||
{% block styles %}{% endblock %}
|
||||
{% endcompress %}
|
||||
<script type="text/javascript" src="https://use.fontawesome.com/4fbab4ae27.js"></script>
|
||||
</head>
|
||||
|
|
|
@ -43,10 +43,10 @@ def nav_right(request):
|
|||
if request.user.is_authenticated():
|
||||
items = (
|
||||
MenuItem(label='admin', icon='fa fa-gear', url='admin:index'),
|
||||
MenuItem(label='log out', icon='fa fa-sign-out', url='admin:logout'),
|
||||
MenuItem(label='log out', icon='fa fa-sign-out', url='lemonauth:logout'),
|
||||
)
|
||||
else:
|
||||
items = (
|
||||
MenuItem(label='log in', icon='fa fa-sign-in', url='admin:login'),
|
||||
MenuItem(label='log in', icon='fa fa-sign-in', url='lemonauth:login'),
|
||||
)
|
||||
return {'items': items}
|
||||
|
|
|
@ -28,6 +28,7 @@ urlpatterns = [
|
|||
url('', include('home.urls')),
|
||||
url('^.well-known/', include('wellknowns.urls')),
|
||||
url('^admin/', admin.site.urls),
|
||||
url('^auth/', include('lemonauth.urls')),
|
||||
|
||||
url(r'^sitemap\.xml$', sitemap.index, maps),
|
||||
url(r'^sitemaps/(?P<section>.+)\.xml$', sitemap.sitemap, maps,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue