Commit 8c7dc054 authored by Julien Enselme's avatar Julien Enselme

Add basic views to create basic pages

parent bce959ca
from django.shortcuts import render
# Create your views here.
def offline(request):
return render(request, 'pwa/offline.html')
def my_page(request):
return render(request, 'pwa/my_page.html')
......@@ -54,7 +54,9 @@ ROOT_URLCONF = 'djangopwa.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'DIRS': [
os.path.join(BASE_DIR, 'djangopwa/templates'),
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
......
<html>
<head>
<title>Test PWA site – A page</title>
</head>
<body>
<h1>A page</h1>
<p>This is a very small and uninteresting page of a test site for Django and PWA</p>
</body>
</html>
<html>
<head>
<title>Test PWA site – Offline</title>
</head>
<body>
<h1>You are now offline</h1>
<p>It's sad, but that's how it is.</p>
</body>
</html>
......@@ -16,6 +16,12 @@ Including another URLconf
from django.contrib import admin
from django.urls import path
from .apps.pwa import views as pwa_views
urlpatterns = [
path('admin/', admin.site.urls),
path('', pwa_views.my_page),
path('offline/', pwa_views.offline),
]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment