Changeset 4964
- Timestamp:
- 04/08/07 20:44:26 (2 years ago)
- Files:
-
- django/trunk/docs/django-admin.txt (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/docs/django-admin.txt
r4937 r4964 30 30 Django settings files. 31 31 32 The command-line examples throughout this document use ``django-admin.py`` to 33 be consistent, but any example can use ``manage.py`` just as well. 34 32 35 Usage 33 36 ===== … … 101 104 ------------------------------ 102 105 103 Output to standard output all data in the database associated with the named 106 Output to standard output all data in the database associated with the named 104 107 application(s). 105 108 106 109 By 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 110 to be in another format, use the ``--format`` option (e.g., ``format=xml``). 111 You may specify any Django serialization backend (including any user specified 109 112 serialization backends named in the ``SERIALIZATION_MODULES`` setting). 110 113 111 114 If no application name is provided, all installed applications will be dumped. 112 115 113 The output of ``dumpdata`` can be used as input for ``loaddata``. 116 The output of ``dumpdata`` can be used as input for ``loaddata``. 114 117 115 118 flush 116 119 ----- 117 120 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 121 Return the database to the state it was in immediately after syncdb was 122 executed. This means that all data will be removed from the database, any 120 123 post-synchronization handlers will be re-executed, and the ``initial_data`` 121 124 fixture will be re-installed. … … 179 182 180 183 Django 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 184 the provided fixture names. 185 186 If the named fixture has a file extension, only fixtures of that type 184 187 will be loaded. For example:: 185 188 186 189 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 191 would only load JSON fixtures called ``mydata``. The fixture extension 192 must correspond to the registered name of a serializer (e.g., ``json`` or 190 193 ``xml``). 191 194 192 If you omit the extension, Django will search all available fixture types 195 If you omit the extension, Django will search all available fixture types 193 196 for a matching fixture. For example:: 194 197 195 198 django-admin.py loaddata mydata 196 199 197 200 would look for any fixture of any fixture type called ``mydata``. If a fixture 198 201 directory 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 202 as a JSON fixture. However, if two fixtures with the same name but different 203 fixture type are discovered (for example, if ``mydata.json`` and 204 ``mydata.xml`` were found in the same fixture directory), fixture 205 installation will be aborted, and any data installed in the call to 203 206 ``loaddata`` will be removed from the database. 204 207 205 The fixtures that are named can include directory components. These 208 The fixtures that are named can include directory components. These 206 209 directories will be included in the search path. For example:: 207 210 208 211 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 213 would search ``<appname>/fixtures/foo/bar/mydata.json`` for each installed 214 application, ``<dirname>/foo/bar/mydata.json`` for each directory in 212 215 ``FIXTURE_DIRS``, and the literal path ``foo/bar/mydata.json``. 213 216 … … 220 223 .. admonition:: MySQL and Fixtures 221 224 222 Unfortunately, MySQL isn't capable of completely supporting all the 225 Unfortunately, MySQL isn't capable of completely supporting all the 223 226 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 230 233 reset [appname appname ...] 231 234 --------------------------- … … 398 401 give you the option of creating a superuser immediately. 399 402 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``. 404 See the documentation for ``loaddata`` for details on the specification of 402 405 fixture data files. 403 406 … … 472 475 django-admin.py dumpdata --indent=4 473 476 474 Specifies the number of spaces that will be used for indentation when 477 Specifies the number of spaces that will be used for indentation when 475 478 pretty-printing output. By default, output will *not* be pretty-printed. 476 479 Pretty-printing will only be enabled if the indent option is provided. … … 513 516 514 517 Example usage:: 515 django-admin.py manage.py --adminmedia=/tmp/new-admin-style/ 518 519 django-admin.py --adminmedia=/tmp/new-admin-style/ 516 520 517 521 Tells Django where to find the various CSS and JavaScript files for the admin
