Add home page and urls!

This commit is contained in:
2021-03-17 22:00:44 -05:00
parent d19eb748d2
commit 46dd3bf9b3
5 changed files with 30 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ from django.urls import path
from . import views
app_name = 'bookmarks'
urlpatterns = [
path('', views.BookmarkListView.as_view(), name='bookmark-list')
]

View File

@@ -1,2 +1,8 @@
{% block content %}
{% endblock %}
<html>
<head>
<title>Forget me not</title>
</head>
<body>
{% block content %} {% endblock %}
</body>
</html>

View File

@@ -0,0 +1,12 @@
{% extends "base.html" %}
{% block content %}
<p>This is the home page.</p>
<p>
Links<br/>
<ul>
<li><a href="{% url 'bookmarks:bookmark-list' %}">Bookmarks</a></li>
<li><a href="{% url 'login' %}">Login</a></li>
</ul>
</p>
{% endblock %}

View File

@@ -16,7 +16,10 @@ Including another URLconf
from django.contrib import admin
from django.urls import include, path
from . import views
urlpatterns = [
path('', views.home, name='home'),
path('bookmarks/', include('bookmarks.urls')),
path('admin/', admin.site.urls),
path('accounts/', include('django.contrib.auth.urls'))

6
forgetmenot/views.py Normal file
View File

@@ -0,0 +1,6 @@
from django.shortcuts import render
from django.views.decorators.http import require_safe
@require_safe
def home(request):
return render(request, 'home/index.html')