Add index.html as home
This commit is contained in:
parent
3e726644ac
commit
cf63cc2344
|
|
@ -100,6 +100,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
LOGIN_REDIRECT_URL = '/'
|
||||||
LOGOUT_REDIRECT_URL = '/'
|
LOGOUT_REDIRECT_URL = '/'
|
||||||
|
|
||||||
# Internationalization
|
# Internationalization
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ from django.urls import path, include
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
path('', views.index, name='index'),
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
path('accounts/new-user/', views.new_user, name='new-user'),
|
path('accounts/new-user/', views.new_user, name='new-user'),
|
||||||
path('accounts/profile/', views.profile, name='profile'),
|
path('accounts/profile/', views.profile, name='profile'),
|
||||||
|
|
|
||||||
|
|
@ -19,3 +19,6 @@ def new_user(request):
|
||||||
@login_required
|
@login_required
|
||||||
def profile(request):
|
def profile(request):
|
||||||
return render(request, 'registration/profile.html')
|
return render(request, 'registration/profile.html')
|
||||||
|
|
||||||
|
def index(request):
|
||||||
|
return render(request, 'index.html')
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,9 @@
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<nav>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li><a href="{% url 'index' %}">Home</a></li>
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
<li><a href="{% url 'profile' %}">Profile</a></li>
|
<li><a href="{% url 'profile' %}">Profile {{ user.username }}</a></li>
|
||||||
<li><a href="{% url 'logout' %}">Logout</a></li>
|
<li><a href="{% url 'logout' %}">Logout</a></li>
|
||||||
{% else %}
|
{% else %}
|
||||||
<li><a href="{% url 'login' %}">Login</a></li>
|
<li><a href="{% url 'login' %}">Login</a></li>
|
||||||
|
|
|
||||||
5
templates/index.html
Normal file
5
templates/index.html
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
{% extends "base_main.html" %}
|
||||||
|
{% block title %}Barn{% endblock %}
|
||||||
|
{% block main %}
|
||||||
|
<h1>Barn</h1>
|
||||||
|
{% endblock %}
|
||||||
Loading…
Reference in a new issue