Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
go
Commits
6fc765e6
Commit
6fc765e6
authored
May 15, 2016
by
David Haynes
Browse files
Move 404/500 to templates/admin
parent
d6a213c8
Changes
4
Hide whitespace changes
Inline
Side-by-side
go/go/templates/404.html
→
go/go/templates/
admin/
404.html
View file @
6fc765e6
File moved
go/go/templates/500.html
→
go/go/templates/
admin/
500.html
View file @
6fc765e6
File moved
go/go/views.py
View file @
6fc765e6
...
...
@@ -56,7 +56,7 @@ def index(request):
random_short
=
URL
.
generate_valid_short
()
if
random_short
is
None
:
return
HttpResponseServerError
(
render
(
request
,
'500.html'
,
{})
render
(
request
,
'
admin/
500.html'
,
{})
)
else
:
url
.
short
=
random_short
...
...
@@ -229,7 +229,7 @@ def redirection(request, short):
domain
=
"%s://%s"
%
(
request
.
scheme
,
request
.
META
.
get
(
'HTTP_HOST'
))
+
"/"
if
url
.
target
==
domain
+
short
:
return
redirect
(
'404.html'
)
return
redirect
(
'
admin/
404.html'
)
if
'qr'
in
request
.
GET
:
url
.
qrclicks
+=
1
...
...
go/settings/urls.py
View file @
6fc765e6
...
...
@@ -10,8 +10,8 @@ import go.views
admin
.
autodiscover
()
handle404
=
TemplateView
.
as_view
(
template_name
=
"404.html"
)
handle500
=
TemplateView
.
as_view
(
template_name
=
"500.html"
)
handle404
=
TemplateView
.
as_view
(
template_name
=
"
admin/
404.html"
)
handle500
=
TemplateView
.
as_view
(
template_name
=
"
admin/
500.html"
)
urlpatterns
=
[
# / - Homepage url.
...
...
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