Add home page and urls!
This commit is contained in:
@@ -2,6 +2,7 @@ from django.urls import path
|
|||||||
|
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
|
app_name = 'bookmarks'
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('', views.BookmarkListView.as_view(), name='bookmark-list')
|
path('', views.BookmarkListView.as_view(), name='bookmark-list')
|
||||||
]
|
]
|
||||||
@@ -1,2 +1,8 @@
|
|||||||
{% block content %}
|
<html>
|
||||||
{% endblock %}
|
<head>
|
||||||
|
<title>Forget me not</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
{% block content %} {% endblock %}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|||||||
12
forgetmenot/templates/home/index.html
Normal file
12
forgetmenot/templates/home/index.html
Normal 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 %}
|
||||||
@@ -16,7 +16,10 @@ Including another URLconf
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import include, path
|
from django.urls import include, path
|
||||||
|
|
||||||
|
from . import views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
path('', views.home, name='home'),
|
||||||
path('bookmarks/', include('bookmarks.urls')),
|
path('bookmarks/', include('bookmarks.urls')),
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
path('accounts/', include('django.contrib.auth.urls'))
|
path('accounts/', include('django.contrib.auth.urls'))
|
||||||
|
|||||||
6
forgetmenot/views.py
Normal file
6
forgetmenot/views.py
Normal 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')
|
||||||
Reference in New Issue
Block a user