fix template matrix for login/logout
This commit is contained in:
parent
19719a68b9
commit
7a7fbfb142
@ -27,9 +27,14 @@
|
||||
</div>
|
||||
<div id="navbar" class="collapse navbar-collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="active"><a href="#">Start</a></li>
|
||||
<li class="active"><a href="/billard/">Tische</a></li>
|
||||
<li><a href="#ueber">Über</a></li>
|
||||
<li><a href="#kontakt">Kontakt</a></li>
|
||||
{% if user.is_authenticated %}
|
||||
<li><a href="{% url 'logout' %}">Abmelden</a></li>
|
||||
{% else %}
|
||||
<li><a href="{% url 'login' %}">Anmelden</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
|
@ -136,6 +136,7 @@ CRISPY_TEMPLATE_PACK = 'bootstrap3'
|
||||
LOGIN_URL = 'login'
|
||||
LOGOUT_URL = 'logout'
|
||||
LOGIN_REDIRECT_URL = 'carom_index'
|
||||
LOGOUT_REDIRECT_URL = 'carom_index'
|
||||
|
||||
STATIC_ROOT = "/srv/carom/carom-server/static/"
|
||||
|
||||
|
@ -15,12 +15,15 @@ Including another URLconf
|
||||
"""
|
||||
from django.conf.urls import url, include
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth import views as auth_views
|
||||
from django.views.generic import RedirectView
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^admin/', admin.site.urls),
|
||||
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
|
||||
url(r'^billard/', include('billard.urls')),
|
||||
url(r'^login/$', auth_views.login),
|
||||
url(r'^logout/$', auth_views.logout),
|
||||
url(r'^', include('django.contrib.auth.urls')),
|
||||
url(r'^.*$', RedirectView.as_view(url='billard/', permanent=False), name='index')
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user