Hi i am new in Python and Django and I follow the django workshop guide.
I just installed Python 3.5 and Django 1.9 and get a lot of error messages ...
Just now I found a lot of dokumentations but now stuck.
I want to add views and and so I added following code in urls.py:
from django.conf.urls import include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
urlpatterns = [
# Uncomment the admin/doc line below to enable admin documentation:
Support for string view arguments to url() is deprecated and will be removed in Django 1.10 (got recipes.views.index). Pass the callable instead.
This is a deprecation warning, which means the code would still run for now. But to address this, just change
#First of all explicitly import the view from recipes import views as recipes_views #this is to avoid conflicts with other view imports
and in the URL patterns,
url(r'^rezept/(?P<slug>[-\w]+)/$', recipes_views.detail), url(r'^$', recipes_views.index),
In the modern era, we have updated the tutorial to instead recommend importing your views module and referencing your view functions (or classes) directly. This has a number of advantages, all deriving from the fact that we are using normal Python in place of “Django String Magic”: the errors when you mistype a view name are less obscure, IDEs can help with autocompletion of view names, etc.