Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/document cli #925

Merged
merged 2 commits into from Aug 4, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 12 additions & 2 deletions cms/management/commands/cms.py
Expand Up @@ -14,12 +14,22 @@ class Command(SubcommandsCommand):
make_option('--noinput', action='store_false', dest='interactive', default=True,
help='Tells django-cms to NOT prompt the user for input of any kind. '),
)

args = '<subcommand>'

command_name = 'cms'

help = 'Various django-cms commands'
subcommands = {
'uninstall': UninstallCommand,
'list': ListCommand,
'moderator': ModeratorCommand,
}
}

@property
def help(self):
lines = ['django CMS command line interface.', '', 'Available subcommands:']
for subcommand in sorted(self.subcommands.keys()):
lines.append(' %s' % subcommand)
lines.append('')
lines.append('Use `manage.py cms <subcommand> --help` for help about subcommands')
return '\n'.join(lines)
4 changes: 2 additions & 2 deletions cms/management/commands/subcommands/list.py
Expand Up @@ -9,9 +9,9 @@ class ListApphooksCommand(NoArgsCommand):

help = 'Lists all apphooks in pages'
def handle_noargs(self, **options):
urls = Title.objects.values_list("application_urls", flat=True)
urls = Title.objects.filter(application_urls__gt='').values_list("application_urls", flat=True)
for url in urls:
self.stdout.write(url+'\n')
self.stdout.write('%s\n' % url)

class ListPluginsCommand(NoArgsCommand):

Expand Down
74 changes: 74 additions & 0 deletions docs/advanced/cli.rst
@@ -0,0 +1,74 @@
######################
Command Line Interface
######################

.. highlight:: bash

You can invoke the django CMS command line interface using the ``cms`` Django
command::

python manage.py cms

**********************
Informational commands
**********************

.. _cms-list-command:

``cms list``
============

The ``list`` command is used to display information about your installation.

It has two subcommands:

* ``cms list plugins`` lists all plugins that are used in your project.
* ``cms list apphooks`` lists all apphooks that are used in your project.


**************************************
Plugin and apphook management commands
**************************************

``cms uninstall``
=================

The ``uninstall`` subcommand can be used to make an uninstallation of a CMS
Plugin or an apphook easier.

It has two subcommands:

* ``cms uninstall plugins <plugin name> [<plugin name 2> [...]]`` uninstalls
one or several plugins by **removing** them from all pages where they are
used. Note that the plugin name should be the name of the class that is
registered to the django CMS. If you are unsure about the plugin name, use
the :ref:`cms-list-command` to see a list of installed plugins.
* ``cms uninstall apphooks <apphook name> [<apphook name 2> [...]]`` uninstalls
one or several apphooks by **removing** them from all pages where they are
used. Note that the apphook name should be the name of the class that is
registered to the django CMS. If you are unsure about the apphook name, use
the :ref:`cms-list-command` to see a list of installed apphook.

.. warning::

The uninstall command **permanently deletes** data from your database.
You should make a backup of your database before using them!




******************
Moderator commands
******************

``cms moderator``
=================

If you turn :setting:`CMS_MODERATOR` to ``True`` on an existing project, you
should use the ``cms moderator on`` command to make the required changes in the
database, otherwise you will have problems with invisible pages.

.. warning::

This command **alters data** in your database. You should make a backup of
your database before using it!
1 change: 1 addition & 0 deletions docs/index.rst
Expand Up @@ -37,6 +37,7 @@ Advanced
advanced/i18n
advanced/sitemap
advanced/templatetags
advanced/cli


*****************
Expand Down