mirror of
				https://github.com/django/django.git
				synced 2025-10-30 17:16:10 +00:00 
			
		
		
		
	[1.5.x] Fixed #20247 - Added some missing paths in the tutorial.
Thanks gsavix for the suggestion and patch.
Backport of aad5661c6c from master.
			
			
This commit is contained in:
		| @@ -264,11 +264,12 @@ that, run the following command: | |||||||
|  |  | ||||||
|     python manage.py syncdb |     python manage.py syncdb | ||||||
|  |  | ||||||
| The :djadmin:`syncdb` command looks at the :setting:`INSTALLED_APPS` setting and | The :djadmin:`syncdb` command looks at the :setting:`INSTALLED_APPS` setting | ||||||
| creates any necessary database tables according to the database settings in your | and creates any necessary database tables according to the database settings | ||||||
| :file:`settings.py` file. You'll see a message for each database table it | in your :file:`mysite/settings.py` file. You'll see a message for each | ||||||
| creates, and you'll get a prompt asking you if you'd like to create a superuser | database table it creates, and you'll get a prompt asking you if you'd like to | ||||||
| account for the authentication system. Go ahead and do that. | create a superuser account for the authentication system. Go ahead and do | ||||||
|  | that. | ||||||
|  |  | ||||||
| If you're interested, run the command-line client for your database and type | If you're interested, run the command-line client for your database and type | ||||||
| ``\dt`` (PostgreSQL), ``SHOW TABLES;`` (MySQL), or ``.schema`` (SQLite) to | ``\dt`` (PostgreSQL), ``SHOW TABLES;`` (MySQL), or ``.schema`` (SQLite) to | ||||||
| @@ -532,7 +533,7 @@ API Django gives you. To invoke the Python shell, use this command: | |||||||
|  |  | ||||||
| We're using this instead of simply typing "python", because :file:`manage.py` | We're using this instead of simply typing "python", because :file:`manage.py` | ||||||
| sets the ``DJANGO_SETTINGS_MODULE`` environment variable, which gives Django | sets the ``DJANGO_SETTINGS_MODULE`` environment variable, which gives Django | ||||||
| the Python import path to your :file:`settings.py` file. | the Python import path to your :file:`mysite/settings.py` file. | ||||||
|  |  | ||||||
| .. admonition:: Bypassing manage.py | .. admonition:: Bypassing manage.py | ||||||
|  |  | ||||||
|   | |||||||
| @@ -109,9 +109,9 @@ Make the poll app modifiable in the admin | |||||||
|  |  | ||||||
| But where's our poll app? It's not displayed on the admin index page. | But where's our poll app? It's not displayed on the admin index page. | ||||||
|  |  | ||||||
| Just one thing to do: We need to tell the admin that ``Poll`` | Just one thing to do: we need to tell the admin that ``Poll`` | ||||||
| objects have an admin interface. To do this, create a file called | objects have an admin interface. To do this, open the :file:`polls/admin.py` | ||||||
| ``admin.py`` in your ``polls`` directory, and edit it to look like this:: | file, and edit it to look like this:: | ||||||
|  |  | ||||||
|     from django.contrib import admin |     from django.contrib import admin | ||||||
|     from polls.models import Poll |     from polls.models import Poll | ||||||
| @@ -375,7 +375,7 @@ of an arbitrary method is not supported. Also note that the column header for | |||||||
| underscores replaced with spaces), and that each line contains the string | underscores replaced with spaces), and that each line contains the string | ||||||
| representation of the output. | representation of the output. | ||||||
|  |  | ||||||
| You can improve that by giving that method (in ``models.py``) a few | You can improve that by giving that method (in :file:`polls/models.py`) a few | ||||||
| attributes, as follows:: | attributes, as follows:: | ||||||
|  |  | ||||||
|     class Poll(models.Model): |     class Poll(models.Model): | ||||||
| @@ -386,8 +386,8 @@ attributes, as follows:: | |||||||
|         was_published_recently.boolean = True |         was_published_recently.boolean = True | ||||||
|         was_published_recently.short_description = 'Published recently?' |         was_published_recently.short_description = 'Published recently?' | ||||||
|  |  | ||||||
| Edit your admin.py file again and add an improvement to the Poll change list page: Filters. Add the | Edit your :file:`polls/admin.py` file again and add an improvement to the Poll | ||||||
| following line to ``PollAdmin``:: | change list page: Filters. Add the following line to ``PollAdmin``:: | ||||||
|  |  | ||||||
|     list_filter = ['pub_date'] |     list_filter = ['pub_date'] | ||||||
|  |  | ||||||
| @@ -445,7 +445,7 @@ live anywhere on your filesystem that Django can access. (Django runs as | |||||||
| whatever user your server runs.) However, keeping your templates within the | whatever user your server runs.) However, keeping your templates within the | ||||||
| project is a good convention to follow. | project is a good convention to follow. | ||||||
|  |  | ||||||
| Open your settings file (``mysite/settings.py``, remember) and  add a | Open your settings file (:file:`mysite/settings.py`, remember) and add a | ||||||
| :setting:`TEMPLATE_DIRS` setting:: | :setting:`TEMPLATE_DIRS` setting:: | ||||||
|  |  | ||||||
|     TEMPLATE_DIRS = ( |     TEMPLATE_DIRS = ( | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user