New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Patterns" and multiple discrepancies. #49
Comments
from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ this works! |
Thank you for pointing this out. The main tutorial was updated to Django 1.9 (which gives you this style of urls by default) but the extensions haven't been so it's out of sync now. @rege-django we'd welcome a pull request if you would like to submit one (note that the |
In the mysite/urls.py, the code is completely different than how the Django Girls tutorial ends:
It looks like:
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'', include('blog.urls')),
]
The "Homework: secure your website" shows:
from django.conf.urls import include, url
import django.contrib.auth.views
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/login/$', django.contrib.auth.views.login, name='login'),
url(r'^accounts/logout/$', django.contrib.auth.views.logout, name='logout', kwargs={'next_page':
'/'}),
url(r'', include('blog.urls')),
)
When importing "patterns", Python throws an error that it is deprecated since v1.10.
The text was updated successfully, but these errors were encountered: