mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
[1.6.x] Fixed #21116 -- Made usage of manage.py in docs more consistent.
Thanks daniel.quattro at gmail.com for the report.
d1c9802811
from master.
This commit is contained in:
parent
d7ae0bc372
commit
d1047c8b4c
10 changed files with 26 additions and 27 deletions
|
@ -36,11 +36,11 @@ Django comes with a utility called :djadmin:`inspectdb` that can create models
|
|||
by introspecting an existing database. You can view the output by running this
|
||||
command::
|
||||
|
||||
python manage.py inspectdb
|
||||
$ python manage.py inspectdb
|
||||
|
||||
Save this as a file by using standard Unix output redirection::
|
||||
|
||||
python manage.py inspectdb > models.py
|
||||
$ python manage.py inspectdb > models.py
|
||||
|
||||
This feature is meant as a shortcut, not as definitive model generation. See the
|
||||
:djadmin:`documentation of inspectdb <inspectdb>` for more information.
|
||||
|
@ -59,12 +59,12 @@ this generated model definition:
|
|||
|
||||
.. parsed-literal::
|
||||
|
||||
class Person(models.Model):
|
||||
id = models.IntegerField(primary_key=True)
|
||||
first_name = models.CharField(max_length=70)
|
||||
class Meta:
|
||||
**managed = False**
|
||||
db_table = 'CENSUS_PERSONS'
|
||||
class Person(models.Model):
|
||||
id = models.IntegerField(primary_key=True)
|
||||
first_name = models.CharField(max_length=70)
|
||||
class Meta:
|
||||
**managed = False**
|
||||
db_table = 'CENSUS_PERSONS'
|
||||
|
||||
If you wanted to modify existing data on your ``CENSUS_PERSONS`` SQL table
|
||||
with Django you'd need to change the ``managed`` option highlighted above to
|
||||
|
@ -84,7 +84,7 @@ Install the core Django tables
|
|||
Next, run the :djadmin:`syncdb` command to install any extra needed database
|
||||
records such as admin permissions and content types::
|
||||
|
||||
python manage.py syncdb
|
||||
$ python manage.py syncdb
|
||||
|
||||
Test and tweak
|
||||
==============
|
||||
|
|
|
@ -147,7 +147,7 @@ for gathering static files in a single directory so you can serve them easily.
|
|||
|
||||
2. Run the :djadmin:`collectstatic` management command::
|
||||
|
||||
./manage.py collectstatic
|
||||
$ python manage.py collectstatic
|
||||
|
||||
This will copy all files from your static folders into the
|
||||
:setting:`STATIC_ROOT` directory.
|
||||
|
|
|
@ -76,7 +76,7 @@ manually using ``manage.py runserver``):
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
python -Wall manage.py test
|
||||
$ python -Wall manage.py test
|
||||
|
||||
After you have run the tests, fix any failures. While you have the release
|
||||
notes fresh in your mind, it may also be a good time to take advantage of new
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue