Django

Code

Changeset 4964

Show
Ignore:
Timestamp:
04/08/07 20:44:26 (2 years ago)
Author:
adrian
Message:

Added note to docs/django-admin.txt about the examples using django-admin.txt but the examples being just as relevant for manage.py. Refs #3893

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/django-admin.txt

    r4937 r4964  
    3030Django settings files. 
    3131 
     32The command-line examples throughout this document use ``django-admin.py`` to 
     33be consistent, but any example can use ``manage.py`` just as well. 
     34 
    3235Usage 
    3336===== 
     
    101104------------------------------ 
    102105 
    103 Output to standard output all data in the database associated with the named  
     106Output to standard output all data in the database associated with the named 
    104107application(s). 
    105108 
    106109By default, the database will be dumped in JSON format. If you want the output 
    107 to be in another format, use the ``--format`` option (e.g., ``format=xml``).  
    108 You may specify any Django serialization backend (including any user specified  
     110to be in another format, use the ``--format`` option (e.g., ``format=xml``). 
     111You may specify any Django serialization backend (including any user specified 
    109112serialization backends named in the ``SERIALIZATION_MODULES`` setting). 
    110113 
    111114If no application name is provided, all installed applications will be dumped. 
    112115 
    113 The output of ``dumpdata`` can be used as input for ``loaddata``.  
     116The output of ``dumpdata`` can be used as input for ``loaddata``. 
    114117 
    115118flush 
    116119----- 
    117120 
    118 Return the database to the state it was in immediately after syncdb was  
    119 executed. This means that all data will be removed from the database, any  
     121Return the database to the state it was in immediately after syncdb was 
     122executed. This means that all data will be removed from the database, any 
    120123post-synchronization handlers will be re-executed, and the ``initial_data`` 
    121124fixture will be re-installed. 
     
    179182 
    180183Django will load any and all fixtures it finds in these locations that match 
    181 the provided fixture names.  
    182  
    183 If the named fixture has a file extension, only fixtures of that type  
     184the provided fixture names. 
     185 
     186If the named fixture has a file extension, only fixtures of that type 
    184187will be loaded. For example:: 
    185188 
    186189    django-admin.py loaddata mydata.json 
    187      
    188 would only load JSON fixtures called ``mydata``. The fixture extension  
    189 must correspond to the registered name of a serializer (e.g., ``json`` or  
     190 
     191would only load JSON fixtures called ``mydata``. The fixture extension 
     192must correspond to the registered name of a serializer (e.g., ``json`` or 
    190193``xml``). 
    191194 
    192 If you omit the extension, Django will search all available fixture types  
     195If you omit the extension, Django will search all available fixture types 
    193196for a matching fixture. For example:: 
    194197 
    195198    django-admin.py loaddata mydata 
    196      
     199 
    197200would look for any fixture of any fixture type called ``mydata``. If a fixture 
    198201directory contained ``mydata.json``, that fixture would be loaded 
    199 as a JSON fixture. However, if two fixtures with the same name but different  
    200 fixture type are discovered (for example, if ``mydata.json`` and  
    201 ``mydata.xml`` were found in the same fixture directory), fixture  
    202 installation will be aborted, and any data installed in the call to  
     202as a JSON fixture. However, if two fixtures with the same name but different 
     203fixture type are discovered (for example, if ``mydata.json`` and 
     204``mydata.xml`` were found in the same fixture directory), fixture 
     205installation will be aborted, and any data installed in the call to 
    203206``loaddata`` will be removed from the database. 
    204207 
    205 The fixtures that are named can include directory components. These  
     208The fixtures that are named can include directory components. These 
    206209directories will be included in the search path. For example:: 
    207210 
    208211    django-admin.py loaddata foo/bar/mydata.json 
    209   
    210 would search ``<appname>/fixtures/foo/bar/mydata.json`` for each installed  
    211 application,  ``<dirname>/foo/bar/mydata.json`` for each directory in  
     212 
     213would search ``<appname>/fixtures/foo/bar/mydata.json`` for each installed 
     214application,  ``<dirname>/foo/bar/mydata.json`` for each directory in 
    212215``FIXTURE_DIRS``, and the literal path ``foo/bar/mydata.json``. 
    213216 
     
    220223.. admonition:: MySQL and Fixtures 
    221224 
    222     Unfortunately, MySQL isn't capable of completely supporting all the  
     225    Unfortunately, MySQL isn't capable of completely supporting all the 
    223226    features of Django fixtures. If you use MyISAM tables, MySQL doesn't 
    224     support transactions or constraints, so you won't get a rollback if  
    225     multiple transaction files are found, or validation of fixture data.  
    226     If you use InnoDB tables, you won't be able to have any forward  
    227     references in your data files - MySQL doesn't provide a mechanism to  
    228     defer checking of row constraints until a transaction is committed.     
    229      
     227    support transactions or constraints, so you won't get a rollback if 
     228    multiple transaction files are found, or validation of fixture data. 
     229    If you use InnoDB tables, you won't be able to have any forward 
     230    references in your data files - MySQL doesn't provide a mechanism to 
     231    defer checking of row constraints until a transaction is committed. 
     232 
    230233reset [appname appname ...] 
    231234--------------------------- 
     
    398401give you the option of creating a superuser immediately. 
    399402 
    400 ``syncdb`` will also search for and install any fixture named ``initial_data``.  
    401 See the documentation for ``loaddata`` for details on the specification of  
     403``syncdb`` will also search for and install any fixture named ``initial_data``. 
     404See the documentation for ``loaddata`` for details on the specification of 
    402405fixture data files. 
    403406 
     
    472475    django-admin.py dumpdata --indent=4 
    473476 
    474 Specifies the number of spaces that will be used for indentation when  
     477Specifies the number of spaces that will be used for indentation when 
    475478pretty-printing output. By default, output will *not* be pretty-printed. 
    476479Pretty-printing will only be enabled if the indent option is provided. 
     
    513516 
    514517Example usage:: 
    515     django-admin.py manage.py --adminmedia=/tmp/new-admin-style/ 
     518 
     519    django-admin.py --adminmedia=/tmp/new-admin-style/ 
    516520 
    517521Tells Django where to find the various CSS and JavaScript files for the admin