#20480 closed Uncategorized (invalid)
Change to django tutorial docs
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Documentation | Version: | 1.4 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Hi,
I was wondering if we can update the documentation here.
https://docs.djangoproject.com/en/dev/intro/tutorial02/#customize-the-admin-look-and-feel
Specifically, I am concerned about the part of the documentation that reads as follows:
Open your settings file (mysite/settings.py, remember) and add a TEMPLATE_DIRS setting:
TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
TEMPLATE_DIRS is an iterable of filesystem directories to check when loading Django templates; it’s a search path.
If I just add the line:
TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
to the settings.py file, then I will get an error message.
The code that needs to get added to the settings.py file should like something like this:
import os.path BASE_DIR = 'C:\Users\Chris\Documents\django_dev\mysite' TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
Change History (2)
comment:1 by , 11 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 by , 11 years ago
You are correct.
C:\Users\Chris\Documents\django_dev\mysite>python manage.py runser
C:\Users\Chris\Documents\django_dev\mysite
C:\Users\Chris\Documents\django_dev\mysite
Validating models...
0 errors found
May 22, 2013 - 11:49:52
Django version 1.5.1, using settings 'mysite.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
[22/May/2013 11:50:01] "GET /admin/ HTTP/1.1" 200 1865
[22/May/2013 11:50:12] "POST /admin/ HTTP/1.1" 200 2028
[22/May/2013 11:50:19] "POST /admin/ HTTP/1.1" 302 0
[22/May/2013 11:50:19] "GET /admin/ HTTP/1.1" 200 5066
[22/May/2013 11:50:36] "GET /admin/logout/ HTTP/1.1" 200 1135
I will change BASE_DIR in my settings.py file accordingly and see how that works. Thanks!
You must be using Django 1.5 while following the tutorial for the development version (future 1.6).
BASE_DIR
is defined here: https://github.com/django/django/blob/master/django/conf/project_template/project_name/settings.py#L11-L13