Skip to content

Deprecated methods and Regex in current Django version #5

@bananabrann

Description

@bananabrann

The current version of Django has several changes from code outlined in this repo, resulting in the old code throwing errors.

Current Code:

from django.contrib import admin
from django.conf.urls import url
from . import views

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', views.homepage)                          # Syntax error: Invalid syntax
]

Corrected:

from django.contrib import admin
from django.urls import path
from . import views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('about/', views.about),
    path('', views.homepage)
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions