I agree. Anyone experienced in Django would not be confused. I have been away from Python for over ten years and totally new to Django. There are a number of such issues in the tutorial that got me "off track".
A useful feature for the total novice would be a link to a folder with a correct copy of all "mysite" files at the end of each section. If the novice fails to include a file or made some other simple mistake they could get back "on track". I did not get "off track" on this one but I did on several others. They were careless mistakes, but for a novice, the only way out is usually to completely start over. The tutorial says "*When starting your first real project, however, you may want to use a more scalable database like PostgreSQL, to avoid database-switching headaches down the road.*". That is an invitation to the novice to simultaneously take a much more complex path. A link to some basic PostgreSQL issues like how to drop the "mysite" PostgresSQL database and start over would be helpful. With sqlite3 it is easy to erase everything and start over. With Postgres, the changes to the database are not so easily undone. I finally figured out how to change the "mysite" user and drop the database, but it was not easy. A simple "DROP DATABASE "mysite"; does not do the job without changing the database owner and killing other users of the database before dropping the database. Simple UX comments from novices concerning the Tutorial could make the life of those who follow much easier. No expert is a good UX judge of any tutorial from the perspective of a novice. jimfuqua On Saturday, August 26, 2017 at 2:51:51 AM UTC-5, Mike Dewhirst wrote: > > A potential new Django user (a programmer of many decades experience) > tried Django at my suggestion and struck a problem. Eventually he > tracked me down and challenged me to prove the problem. > > I found the problem and feel that the Polls tutorial docs can be easily > improved. > > https://docs.djangoproject.com/en/1.11/intro/tutorial01/ > > In the "Write your first view" section it says ... > > The next step is to point the root URLconf at the |polls.urls| module. > In |mysite/urls.py|, add an import for |django.conf.urls.include| and > insert an |include()| > <https://docs.djangoproject.com/en/1.11/ref/urls/#django.conf.urls.include> > > in the |urlpatterns| list, so you have: > > mysite/urls.py > > from django.conf.urls import include, url from django.contrib > import admin > > urlpatterns = [ > url(r'^polls/', include('polls.urls')), > url(r'^admin/', admin.site.urls), > ] > > > The problem is we have two mysite dirs. The docs are helpful in > suggesting you copy code to paste into urls.py so the focus is on the > code rather than where to put it. On not finding a urls.py in the outer > mysite dir he created one. > > The suggestion for improving the docs here is to change the heading line > above from > mysite/urls.py > to > mysite/mysite/urls.py > > Alternatively, make a pointed reference to the earlier section in the > page where startproject created the *inner* mysite dir containing the > target urls.py. For example, by adding words to the effect that the > inner mysite/urls.py file will be instrumental in the "hello world" step > later in the tutorial. > > Cheers > > Mike > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e613b227-cc88-46ce-927c-d635ac1c51f5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.