Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
D
django-pwa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Julien Enselme
django-pwa
Commits
9594eac5
Commit
9594eac5
authored
Oct 11, 2019
by
Julien Enselme
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dynamic pages
parent
2c4eab9a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
djangopwa/apps/pwa/views.py
djangopwa/apps/pwa/views.py
+4
-2
djangopwa/settings.py
djangopwa/settings.py
+1
-1
djangopwa/templates/404.html
djangopwa/templates/404.html
+9
-0
No files found.
djangopwa/apps/pwa/views.py
View file @
9594eac5
from
django.http
import
Http404
from
django.shortcuts
import
render
...
...
@@ -15,6 +16,7 @@ def say_something(request, key):
'bye'
:
'Have a nice day'
,
}
thing
=
things_to_say
.
get
(
key
,
''
)
if
key
not
in
things_to_say
:
raise
Http404
(
f
'
{
key
}
is not a valid thing to say'
)
return
render
(
request
,
'pwa/say_something.html'
,
context
=
{
'thing'
:
thing
})
return
render
(
request
,
'pwa/say_something.html'
,
context
=
{
'thing'
:
thing
s_to_say
[
key
]
})
djangopwa/settings.py
View file @
9594eac5
...
...
@@ -25,7 +25,7 @@ SECRET_KEY = '(nponxj8^arqne3g#+shmu$rxn+^lok%jkk6d0cu&%4srt(4!('
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
True
ALLOWED_HOSTS
=
[]
ALLOWED_HOSTS
=
[
'*'
]
# Application definition
...
...
djangopwa/templates/404.html
0 → 100644
View file @
9594eac5
{% extends 'base.html' %}
{% block title %}Not Found{% endblock %}
{% block body %}
<h1>
Page not found
</h1>
<p>
We're sorry but this page doesn't exist.
</p>
{% endblock %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment