Python

Hien Ha
Hien Ha
148 Points

Django URLS in the content is diffence from real django

Hello In Urls lession the code was from django.conf.urls import include,url from django.contrib import admin from . import views

Urlpattrern= url(r'âdmin' ,...

but in real django version it is from django.contrib import admin from django.urls import path urlpatterns = [ path('admin/', admin.site.urls), ]

2 Answers

Dylan Thunn
Dylan Thunn
18,421 Points

Ya they need really to update Django. 2.0 was released in 2017, they should at least mention it in all those tutorials. Love TreeHouse but they are kind of slacking in the Django department.

Jeff Muday
MOD
Jeff Muday
Treehouse Moderator 23,379 Points

Dylan Thunn is correct-- there are definitely some differences in Django 2.x and if you are creating a new project from scratch, I would totally recommend doing it in Django 2.x. There is still quite a bit of utility in learning Django 1.x (1.9 is installed in Workspaces) and Django LTS (long-term-support) version is 1.11. Since most new Django developers first job opportunity will be maintaining existing code, it is a good experience to be familiar with LTS versions.

https://www.djangoproject.com/weblog/2015/jun/25/roadmap/