On Tue, May 21, 2013 at 10:08 PM, Christopher Spears <cspears2...@yahoo.com> wrote: > I am working my way through the Django tutorial, and I have reached the part > where I am supposed to customize the look and feel of the admin. I am > supposed to do that using the mysite\settings.py file (working on a Windows > laptop). I have two questions. > > At first, I just typed the following into the file: > > TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')] > > I got an error message stating that os.path was not recognized. I solved > this by putting 'import os.path' at the top of the file. Does this mean > there is a bug in the tutorial's documentation? I do not recall seeing any > instructions that told me to add this. > > After I solved the first problem, I now get this error message: > > File "C:\Users\Chris\Documents\django_dev\mysite\mysite\settings.py", line > 7, > in <module> > TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')] > NameError: name 'BASE_DIR' is not defined > > Am I supposed to now define BASE_DIR? > > Thanks! >
BASE_DIR is only mentioned in the tutorial from the in development docs, which may not be the best place to start - chiefly because it can have issues like this. If you don't mind encountering things like this, then using the dev docs helps find issues like this that have been added since the last release, but if you want a more checked and correct django docs, use the ones from the latest release. Of course, you should always use the docs for the version that you are actually using. I would recommend not using unreleased versions of django to learn django though. Cheers Tom -- 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 http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.