Browse Source

Modified the urls to use path function instead of using url function with regex

pull/168/head
M Sajid Mansoori 5 years ago
parent
commit
8e30161186
1 changed files with 9 additions and 4 deletions
  1. +9
    -4
      project/urls.py

+ 9
- 4
project/urls.py View File

@ -1,7 +1,7 @@
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.urls import path # This path is much easier to use without using regular expressions and supported in django 3.0 and higher
from welcome.views import index, health
urlpatterns = [
@ -9,9 +9,14 @@ urlpatterns = [
# url(r'^$', 'project.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', index),
url(r'^health$', health),
url(r'^admin/', include(admin.site.urls)),
# Below commented urls will also work but the latest support for path function is much efficient to use
# url(r'^$', index),
# url(r'^health$', health),
# url(r'^admin/', include(admin.site.urls)),
path('',index),
path('health/',health),
path('admin/',include(admin.site.urls))
]
if settings.DEBUG:


Loading…
Cancel
Save