Skip to content

Instantly share code, notes, and snippets.

@ebdavison
Last active March 23, 2018 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebdavison/da84843577137ef7b4b624fdf5a39fa2 to your computer and use it in GitHub Desktop.
Save ebdavison/da84843577137ef7b4b624fdf5a39fa2 to your computer and use it in GitHub Desktop.
urlpatterns
Page not found (404)
Request Method: GET
Request URL: https://www.example.com/wfpsite/blog
Using the URLconf defined in az.urls, Django tried these URL patterns, in this order:
^$
^admin/
^aztrack/
^wfpsite/ ^$ [name='home']
^wfpsite/ ^wfpsite/blog [name='blog']
^wfpsite/ ^wfpsite/view/(?P<slug>[^\.]+) [name='view_blog_post']
^wfpsite/ ^wfpsite/category/(?P<slug>[^\.]+) [name='view_blog_category']
^wfpsite/ ^wfpsite/
The current path, wfpsite/blog, didn't match any of these.
"""az URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include, re_path
from wfpsite import views
admin.autodiscover()
urlpatterns = [
#re_path(r'', include('wfpsite.urls')),
re_path(r'^$', views.index),
re_path(r'^admin/', admin.site.urls),
re_path(r'^aztrack/', include('aztrack.urls')),
re_path(r'^wfpsite/', include('wfpsite.urls')),
] #+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
from django.urls import path, include, re_path
from . import views
urlpatterns = [
re_path(r'^blog$', views.blog, name='blog'),
re_path(r'^view/(?P<slug>[^\.]+)$', views.view_post, name='view_blog_post'),
re_path(r'^category/(?P<slug>[^\.]+)$', views.view_category, name='view_blog_category'),
re_path(r'^$', views.index),
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment