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
5391518f
Commit
5391518f
authored
Feb 16, 2018
by
David Haynes
🙆
Browse files
Merge branch '125-myissue' into '2.3-dev'
Resolve "Case insensitive routes (e.g. myLinks)" See merge request
!115
parents
aaaaa9ef
e7ec8019
Pipeline
#2308
passed with stages
in 3 minutes and 40 seconds
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
go/settings/urls.py
View file @
5391518f
...
...
@@ -5,7 +5,7 @@ The URLs of the project and their associated view that requests are routed to.
"""
# Django Imports
import
django.contrib.auth.views
from
django.
conf.
urls
import
url
from
django.urls
import
path
from
django.contrib
import
admin
from
django.views.decorators.cache
import
cache_page
from
django.views.generic
import
TemplateView
...
...
@@ -20,42 +20,42 @@ admin.autodiscover()
urlpatterns
=
[
# / - Homepage url. Cached for 1 second (this is the page you see after
# logging in, so having it show as not logged in is strange)
url
(
r
'^$
'
,
cache_page
(
1
)(
go
.
views
.
index
),
name
=
'index'
),
path
(
'
'
,
cache_page
(
1
)(
go
.
views
.
index
),
name
=
'index'
),
# /view/<short> - View URL data. Cached for 15 minutes
url
(
r
'^view/(?P<short>[-\w]+)$
'
,
cache_page
(
60
*
15
)(
go
.
views
.
view
),
name
=
'view'
),
path
(
'view/<slug:short>
'
,
cache_page
(
60
*
15
)(
go
.
views
.
view
),
name
=
'view'
),
# /about - About page. Cached for 15 minutes
url
(
r
'^
about
/?$
'
,
cache_page
(
60
*
15
)(
TemplateView
.
as_view
(
template_name
=
'core/about.html'
)),
name
=
'about'
),
path
(
'
about'
,
cache_page
(
60
*
15
)(
TemplateView
.
as_view
(
template_name
=
'core/about.html'
)),
name
=
'about'
),
# /signup - Signup page for access. Cached for 15 minutes
url
(
r
'^
signup
/?$
'
,
cache_page
(
60
*
15
)(
go
.
views
.
signup
),
name
=
'signup'
),
path
(
'
signup'
,
cache_page
(
60
*
15
)(
go
.
views
.
signup
),
name
=
'signup'
),
# /new - Create a new Go Link
url
(
r
'^new/?$
'
,
go
.
views
.
new_link
,
name
=
'new_link'
),
path
(
'new
'
,
go
.
views
.
new_link
,
name
=
'new_link'
),
# /my - My-Links page, view and review links.
url
(
r
'^my/?$
'
,
go
.
views
.
my_links
,
name
=
'my_links'
),
path
(
'my
'
,
go
.
views
.
my_links
,
name
=
'my_links'
),
# /edit/<short> - Edit link form
url
(
r
'^edit/(?P<short>[-\w]+)$
'
,
go
.
views
.
edit
,
name
=
'edit'
),
path
(
'edit/<slug:short>
'
,
go
.
views
.
edit
,
name
=
'edit'
),
# /delete/<short> - Delete a link, no content display.
url
(
r
'^delete/(?P<short>[-\w]+)$
'
,
go
.
views
.
delete
,
name
=
'delete'
),
path
(
'delete/<slug:short>
'
,
go
.
views
.
delete
,
name
=
'delete'
),
# /registered - registration complete page. Cached for 15 minutes
url
(
r
'^
registered
/?$
'
,
cache_page
(
60
*
15
)(
TemplateView
.
as_view
(
template_name
=
'registered.html'
)),
name
=
'registered'
),
path
(
'
registered'
,
cache_page
(
60
*
15
)(
TemplateView
.
as_view
(
template_name
=
'registered.html'
)),
name
=
'registered'
),
# /admin - Administrator interface.
url
(
r
'^
admin
/?
'
,
admin
.
site
.
urls
,
name
=
'go_admin'
),
path
(
'
admin'
,
admin
.
site
.
urls
,
name
=
'go_admin'
),
# /manage - user approval interface
url
(
r
'^
manage
/?$
'
,
go
.
views
.
useradmin
,
name
=
'useradmin'
),
path
(
'
manage'
,
go
.
views
.
useradmin
,
name
=
'useradmin'
),
# Authentication URLs
url
(
r
'^
login
$
'
,
django
.
contrib
.
auth
.
views
.
login
,
name
=
'go_login'
),
url
(
r
'^
logout
$
'
,
django
.
contrib
.
auth
.
views
.
logout
,
{
'next_page'
:
'/'
},
name
=
'go_logout'
),
path
(
'
login'
,
django
.
contrib
.
auth
.
views
.
login
,
name
=
'go_login'
),
path
(
'
logout'
,
django
.
contrib
.
auth
.
views
.
logout
,
{
'next_page'
:
'/'
},
name
=
'go_logout'
),
# Redirection regex.
url
(
r
'^(?P<short>[-\w]+)$
'
,
go
.
views
.
redirection
,
name
=
'redirection'
),
path
(
'<slug:short>
'
,
go
.
views
.
redirection
,
name
=
'redirection'
),
]
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