Add index.html as home
This commit is contained in:
parent
27075d101f
commit
d39ffc822c
|
|
@ -100,6 +100,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||
},
|
||||
]
|
||||
|
||||
LOGIN_REDIRECT_URL = '/'
|
||||
LOGOUT_REDIRECT_URL = '/'
|
||||
|
||||
# Internationalization
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ from django.urls import path, include
|
|||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.index, name='index'),
|
||||
path('admin/', admin.site.urls),
|
||||
path('accounts/new-user/', views.new_user, name='new-user'),
|
||||
path('accounts/profile/', views.profile, name='profile'),
|
||||
|
|
|
|||
|
|
@ -19,3 +19,6 @@ def new_user(request):
|
|||
@login_required
|
||||
def profile(request):
|
||||
return render(request, 'registration/profile.html')
|
||||
|
||||
def index(request):
|
||||
return render(request, 'index.html')
|
||||
|
|
|
|||
|
|
@ -8,8 +8,9 @@
|
|||
{% block body %}
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="{% url 'index' %}">Home</a></li>
|
||||
{% 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>
|
||||
{% else %}
|
||||
<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