Commit 5391518f authored by David Haynes's avatar David Haynes 🙆

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
......@@ -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/?',, name='go_admin'),
path('admin',, 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'),
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment