Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.2.X] Fixed #14173 -- Added sections about contrib apps-provided co…

…mmands to django-admin.py docs.

Added documentation about changepassword, pointers to GeoDjango and sitemaps
commands, grouped them by app.

Backport of [14327] from trunk

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@14328 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit af3de6a712117cebe20afe05ffe96fd7c8c163d5 1 parent 67ba914
Ramiro Morales authored October 23, 2010
14  docs/ref/contrib/sitemaps.txt
@@ -33,12 +33,12 @@ To install the sitemap app, follow these steps:
33 33
 
34 34
     1. Add ``'django.contrib.sitemaps'`` to your :setting:`INSTALLED_APPS`
35 35
        setting.
36  
-       
  36
+
37 37
     2. Make sure ``'django.template.loaders.app_directories.Loader'``
38 38
        is in your :setting:`TEMPLATE_LOADERS` setting. It's in there by default,
39 39
        so you'll only need to change this if you've changed that setting.
40 40
 
41  
-    3. Make sure you've installed the 
  41
+    3. Make sure you've installed the
42 42
        :mod:`sites framework <django.contrib.sites>`.
43 43
 
44 44
 (Note: The sitemap application doesn't install any database tables. The only
@@ -294,7 +294,7 @@ Pinging Google
294 294
 ==============
295 295
 
296 296
 You may want to "ping" Google when your sitemap changes, to let it know to
297  
-reindex your site. The sitemaps framework provides a function to do just 
  297
+reindex your site. The sitemaps framework provides a function to do just
298 298
 that: :func:`django.contrib.sitemaps.ping_google()`.
299 299
 
300 300
 .. function:: ping_google
@@ -313,14 +313,14 @@ that: :func:`django.contrib.sitemaps.ping_google()`.
313 313
 
314 314
     The :func:`ping_google` command only works if you have registered your
315 315
     site with `Google Webmaster Tools`_.
316  
-        
  316
+
317 317
 .. _`Google Webmaster Tools`: http://www.google.com/webmasters/tools/
318  
-        
  318
+
319 319
 One useful way to call :func:`ping_google` is from a model's ``save()``
320 320
 method::
321 321
 
322 322
    from django.contrib.sitemaps import ping_google
323  
-  
  323
+
324 324
     class Entry(models.Model):
325 325
         # ...
326 326
         def save(self, force_insert=False, force_update=False):
@@ -340,6 +340,8 @@ each time you call ``save()``.
340 340
 Pinging Google via `manage.py`
341 341
 ------------------------------
342 342
 
  343
+.. django-admin:: ping_google
  344
+
343 345
 .. versionadded:: 1.0
344 346
 
345 347
 Once the sitemaps application is added to your project, you may also
136  docs/ref/django-admin.txt
@@ -37,26 +37,26 @@ Usage
37 37
 
38 38
 .. code-block:: bash
39 39
 
40  
-    django-admin.py <subcommand> [options]
41  
-    manage.py <subcommand> [options]
  40
+    django-admin.py <command> [options]
  41
+    manage.py <command> [options]
42 42
 
43  
-``subcommand`` should be one of the subcommands listed in this document.
  43
+``command`` should be one of the commands listed in this document.
44 44
 ``options``, which is optional, should be zero or more of the options available
45  
-for the given subcommand.
  45
+for the given command.
46 46
 
47 47
 Getting runtime help
48 48
 --------------------
49 49
 
50 50
 .. django-admin-option:: --help
51 51
 
52  
-Run ``django-admin.py help`` to display a list of all available subcommands.
53  
-Run ``django-admin.py help <subcommand>`` to display a description of the
54  
-given subcommand and a list of its available options.
  52
+Run ``django-admin.py help`` to display a list of all available commands.
  53
+Run ``django-admin.py help <command>`` to display a description of the
  54
+given command and a list of its available options.
55 55
 
56 56
 App names
57 57
 ---------
58 58
 
59  
-Many subcommands take a list of "app names." An "app name" is the basename of
  59
+Many commands take a list of "app names." An "app name" is the basename of
60 60
 the package containing your models. For example, if your ``INSTALLED_APPS``
61 61
 contains the string ``'mysite.blog'``, the app name is ``blog``.
62 62
 
@@ -80,8 +80,8 @@ Use :djadminopt:`--verbosity` to specify the amount of notification and debug in
80 80
 that ``django-admin.py`` should print to the console. For more details, see the
81 81
 documentation for the :djadminopt:`--verbosity` option.
82 82
 
83  
-Available subcommands
84  
-=====================
  83
+Available commands
  84
+==================
85 85
 
86 86
 cleanup
87 87
 -------
@@ -124,34 +124,6 @@ backend. See :doc:`/topics/cache` for more information.
124 124
 The :djadminopt:`--database` option can be used to specify the database
125 125
 onto which the cachetable will be installed.
126 126
 
127  
-createsuperuser
128  
----------------
129  
-
130  
-.. django-admin:: createsuperuser
131  
-
132  
-.. versionadded:: 1.0
133  
-
134  
-Creates a superuser account (a user who has all permissions). This is
135  
-useful if you need to create an initial superuser account but did not
136  
-do so during ``syncdb``, or if you need to programmatically generate
137  
-superuser accounts for your site(s).
138  
-
139  
-When run interactively, this command will prompt for a password for
140  
-the new superuser account. When run non-interactively, no password
141  
-will be set, and the superuser account will not be able to log in until
142  
-a password has been manually set for it.
143  
-
144  
-.. django-admin-option:: --username
145  
-.. django-admin-option:: --email
146  
-
147  
-The username and e-mail address for the new account can be supplied by
148  
-using the ``--username`` and ``--email`` arguments on the command
149  
-line. If either of those is not supplied, ``createsuperuser`` will prompt for
150  
-it when running interactively.
151  
-
152  
-This command is only available if Django's :doc:`authentication system
153  
-</topics/auth>` (``django.contrib.auth``) is installed.
154  
-
155 127
 dbshell
156 128
 -------
157 129
 
@@ -175,7 +147,6 @@ manually.
175 147
 The :djadminopt:`--database` option can be used to specify the database
176 148
 onto which to open a shell.
177 149
 
178  
-
179 150
 diffsettings
180 151
 ------------
181 152
 
@@ -315,7 +286,6 @@ only works in PostgreSQL and with certain types of MySQL tables.
315 286
 The :djadminopt:`--database` option may be used to specify the
316 287
 database to introspect.
317 288
 
318  
-
319 289
 loaddata <fixture fixture ...>
320 290
 ------------------------------
321 291
 
@@ -870,7 +840,7 @@ templates.
870 840
 
871 841
 Use ``--addrport`` to specify a different port, or IP address and port, from
872 842
 the default of 127.0.0.1:8000. This value follows exactly the same format and
873  
-serves exactly the same function as the argument to the ``runserver`` subcommand.
  843
+serves exactly the same function as the argument to the ``runserver`` command.
874 844
 
875 845
 Examples:
876 846
 
@@ -895,10 +865,92 @@ validate
895 865
 Validates all installed models (according to the ``INSTALLED_APPS`` setting)
896 866
 and prints validation errors to standard output.
897 867
 
  868
+Commands provided by applications
  869
+=================================
  870
+
  871
+Some commands are only available when the ``django.contrib`` application that
  872
+:doc:`implements </howto/custom-management-commands>` them has been
  873
+:setting:`enabled <INSTALLED_APPS>`. This section describes them grouped by
  874
+their application.
  875
+
  876
+``django.contrib.auth``
  877
+-----------------------
  878
+
  879
+changepassword
  880
+~~~~~~~~~~~~~~
  881
+
  882
+.. django-admin:: changepassword
  883
+
  884
+.. versionadded:: 1.2
  885
+
  886
+This command is only available if Django's :doc:`authentication system
  887
+</topics/auth>` (``django.contrib.auth``) is installed.
  888
+
  889
+Allows changing a user's password. It prompts you to enter twice the password of
  890
+the user given as parameter. If they both match, the new password will be
  891
+changed immediately. If you do not supply a user, the command will attempt to
  892
+change the password whose username matches the current user.
  893
+
  894
+Example usage::
  895
+
  896
+    django-admin.py changepassword ringo
  897
+
  898
+createsuperuser
  899
+~~~~~~~~~~~~~~~
  900
+
  901
+.. django-admin:: createsuperuser
  902
+
  903
+.. versionadded:: 1.0
  904
+
  905
+This command is only available if Django's :doc:`authentication system
  906
+</topics/auth>` (``django.contrib.auth``) is installed.
  907
+
  908
+Creates a superuser account (a user who has all permissions). This is
  909
+useful if you need to create an initial superuser account but did not
  910
+do so during ``syncdb``, or if you need to programmatically generate
  911
+superuser accounts for your site(s).
  912
+
  913
+When run interactively, this command will prompt for a password for
  914
+the new superuser account. When run non-interactively, no password
  915
+will be set, and the superuser account will not be able to log in until
  916
+a password has been manually set for it.
  917
+
  918
+.. django-admin-option:: --username
  919
+.. django-admin-option:: --email
  920
+
  921
+The username and e-mail address for the new account can be supplied by
  922
+using the ``--username`` and ``--email`` arguments on the command
  923
+line. If either of those is not supplied, ``createsuperuser`` will prompt for
  924
+it when running interactively.
  925
+
  926
+``django.contrib.gis``
  927
+----------------------
  928
+
  929
+ogrinspect
  930
+~~~~~~~~~~
  931
+
  932
+This command is only available if :doc:`GeoDjango </ref/contrib/gis/index>`
  933
+(``django.contrib.gis``) is installed.
  934
+
  935
+Please refer to its :djadmin:`description <ogrinspect>` in the GeoDjango
  936
+documentation.
  937
+
  938
+``django.contrib.sitemaps``
  939
+---------------------------
  940
+
  941
+ping_google
  942
+~~~~~~~~~~~
  943
+
  944
+This command is only available if the :doc:`Sitemaps framework
  945
+</ref/contrib/sitemaps>` (``django.contrib.sitemaps``) is installed.
  946
+
  947
+Please refer to its :djadmin:`description <ping_google>` in the Sitemaps
  948
+documentation.
  949
+
898 950
 Default options
899 951
 ===============
900 952
 
901  
-Although some subcommands may allow their own custom options, every subcommand
  953
+Although some commands may allow their own custom options, every command
902 954
 allows for the following options:
903 955
 
904 956
 .. django-admin-option:: --pythonpath
15  docs/topics/auth.txt
@@ -37,11 +37,12 @@ Authentication support is bundled as a Django application in
37 37
     2. Run the command ``manage.py syncdb``.
38 38
 
39 39
 Note that the default :file:`settings.py` file created by
40  
-:djadmin:`django-admin.py startproject` includes ``'django.contrib.auth'`` and
41  
-``'django.contrib.contenttypes'`` in :setting:`INSTALLED_APPS` for convenience.
42  
-If your :setting:`INSTALLED_APPS` already contains these apps, feel free to run
43  
-:djadmin:`manage.py syncdb` again; you can run that command as many times as
44  
-you'd like, and each time it'll only install what's needed.
  40
+:djadmin:`django-admin.py startproject <startproject>` includes
  41
+``'django.contrib.auth'`` and ``'django.contrib.contenttypes'`` in
  42
+:setting:`INSTALLED_APPS` for convenience.  If your :setting:`INSTALLED_APPS`
  43
+already contains these apps, feel free to run :djadmin:`manage.py syncdb
  44
+<syncdb>` again; you can run that command as many times as you'd like, and each
  45
+time it'll only install what's needed.
45 46
 
46 47
 The :djadmin:`syncdb` command creates the necessary database tables, creates
47 48
 permission objects for all installed apps that need 'em, and prompts you to
@@ -358,8 +359,8 @@ Changing passwords
358 359
 .. versionadded:: 1.2
359 360
    The ``manage.py changepassword`` command was added.
360 361
 
361  
-:djadmin:`manage.py changepassword <username>` offers a method of
362  
-changing a User's password from the command line. It prompts you to
  362
+:djadmin:`manage.py changepassword *username* <changepassword>` offers a method
  363
+of changing a User's password from the command line. It prompts you to
363 364
 change the password of a given user which you must enter twice. If
364 365
 they both match, the new password will be changed immediately. If you
365 366
 do not supply a user, the command will attempt to change the password
2  docs/topics/testing.txt
@@ -240,7 +240,7 @@ in different circumstances.
240 240
 Running tests
241 241
 =============
242 242
 
243  
-Once you've written tests, run them using the :djadmin:`test` subcommand of
  243
+Once you've written tests, run them using the :djadmin:`test` command of
244 244
 your project's ``manage.py`` utility::
245 245
 
246 246
     $ ./manage.py test

0 notes on commit af3de6a

Please sign in to comment.
Something went wrong with that request. Please try again.