Grouping commands by app in ./manage.py help

31 views
Skip to first unread message

George Karpenkov

unread,
Jul 10, 2011, 5:14:15 AM7/10/11
to django-d...@googlegroups.com
Hi everyone,

Recently I'm becoming more and more annoyed with ./manage.py help behavior -- in projects with many dependencies it's virtually impossible to find the command you need as there are just too many, and searching for the one you need takes ages (and ages and ages).

So I thought that grouping by app can make the output much better, and implemented grouping-by-apps in the help command. 

One detail I'm not too sure about is that in get_command() for some(?) reason 'startapp' command maps to ProjectCommand, while every other command maps to the corresponding app. I've hardcoded the special-case-check for ProjectCommand, but it would be nice to know why it was done this way in the first place.

Corresponding ticket with patch - https://code.djangoproject.com/ticket/16445

See below for the example of how much difference it makes:

Available subcommands:

  backfill_api_keys
  build_solr_schema
  changepassword
  clean_predicates
  clean_pyc
  clean_relations
  cleanup
  clear_index
  collectstatic
  compile_pyc
  compilemessages
  convert_to_south
  create_app
  create_command
  create_jobs
  createcachetable
  createsuperuser
  css_slate
  csv_report
  customdashboard
  custommenu
  datamigration
  dbshell
  delete_orphaned_references
  describe_form
  diffsettings
  dumpdata
  dumpscript
  export_emails
  fetch_training_dates
  find_template
  findstatic
  flush
  generate_secret_key
  graph_models
  graphmigrations
  haystack_info
  inspectdb
  loaddata
  loadmongodata
  lumpy_migration
  mail_debug
  makemessages
  migrate
  migrate_legacy
  migrate_to_mongo
  mongostack_update
  passwd
  print_user_for_session
  rebuild_index
  rebuild_mptt
  rebuild_mptt_direct
  repair_tree
  reset
  reset_db
  runfcgi
  runjob
  runjobs
  runprofileserver
  runscript
  runserver
  runserver_plus
  schemamigration
  set_fake_emails
  set_fake_passwords
  shell
  shell_plus
  show_recent_edits
  show_templatetags
  show_urls
  sql
  sqlall
  sqlclear
  sqlcustom
  sqldiff
  sqlflush
  sqlindexes
  sqlinitialdata
  sqlreset
  sqlsequencereset
  startapp
  startmigration
  sync_media_s3
  syncdata
  syncdb
  test
  testserver
  thumbnail_cleanup
  unreferenced_files
  update_index
  update_rsscontent
  validate


Compare that to:

Available subcommands:

admin_tools.dashboard:
        customdashboard

admin_tools.menu:
        custommenu

bios:
        csv_report

compressor:
        css_slate

django.contrib.auth:
        changepassword
        createsuperuser

django.contrib.staticfiles:
        collectstatic
        findstatic
        runserver

django.core:
        cleanup
        compilemessages
        createcachetable
        dbshell
        diffsettings
        dumpdata
        flush
        inspectdb
        loaddata
        makemessages
        reset
        runfcgi
        shell
        sql
        sqlall
        sqlclear
        sqlcustom
        sqlflush
        sqlindexes
        sqlinitialdata
        sqlreset
        sqlsequencereset
        startapp
        validate

django_extensions:
        clean_pyc
        compile_pyc
        create_app
        create_command
        create_jobs
        describe_form
        dumpscript
        export_emails
        find_template
        generate_secret_key
        graph_models
        mail_debug
        passwd
        print_user_for_session
        reset_db
        runjob
        runjobs
        runprofileserver
        runscript
        runserver_plus
        set_fake_emails
        set_fake_passwords
        shell_plus
        show_templatetags
        show_urls
        sqldiff
        sync_media_s3
        syncdata
        unreferenced_files

easy_thumbnails:
        thumbnail_cleanup

feincms:
        rebuild_mptt
        rebuild_mptt_direct
        update_rsscontent

feincmstools:
        lumpy_migration
        repair_tree

haystack:
        build_solr_schema
        clear_index
        haystack_info
        rebuild_index
        update_index

legacy:
        clean_predicates
        clean_relations
        fetch_training_dates
        migrate_legacy
        migrate_to_mongo

mongoadmin:
        show_recent_edits

mongointegrity:
        delete_orphaned_references

mongostack:
        mongostack_update

mongoutils:
        loadmongodata

south:
        convert_to_south
        datamigration
        graphmigrations
        migrate
        schemamigration
        startmigration
        syncdb
        test
        testserver

tastypie:
        backfill_api_keys

Russell Keith-Magee

unread,
Jul 10, 2011, 7:13:53 AM7/10/11
to django-d...@googlegroups.com
On Sunday, July 10, 2011, George Karpenkov <true.c...@gmail.com> wrote:
> Hi everyone,
> Recently I'm becoming more and more annoyed with ./manage.py help behavior -- in projects with many dependencies it's virtually impossible to find the command you need as there are just too many, and searching for the one you need takes ages (and ages and ages).
> So I thought that grouping by app can make the output much better, and implemented grouping-by-apps in the help command.
> One detail I'm not too sure about is that in get_command() for some(?) reason 'startapp' command maps to ProjectCommand, while every other command maps to the corresponding app. I've hardcoded the special-case-check for ProjectCommand, but it would be nice to know why it was done this way in the first place.
> Corresponding ticket with patch - https://code.djangoproject.com/ticket/16445

As I have noted on the ticket; this has been proposed in the past - see #11745.

Yours,
Russ Magee %-)

George Karpenkov

unread,
Jul 10, 2011, 7:20:58 AM7/10/11
to Django developers
What do you think is required to get it into the trunk?

I don't think the objections on #11745 are valid --
1) If an app overrides builtin command, it would be quite confusing to
see that command still under built-in app, as that would give you no
hint that the command was overwritten.
2) I'm not quite sure how ./manage.py help --list would help -- if
someone is parsing the list, they'll have to change their script
anyway.

On Jul 10, 9:13 pm, Russell Keith-Magee <russ...@keith-magee.com>
wrote:
> On Sunday, July 10, 2011, George Karpenkov <true.chesh...@gmail.com> wrote:
> > Hi everyone,
> > Recently I'm becoming more and more annoyed with ./manage.py help behavior -- in projects with many dependencies it's virtually impossible to find the command you need as there are just too many, and searching for the one you need takes ages (and ages and ages).
> > So I thought that grouping by app can make the output much better, and implemented grouping-by-apps in the help command.
> > One detail I'm not too sure about is that in get_command() for some(?) reason 'startapp' command maps to ProjectCommand, while every other command maps to the corresponding app. I've hardcoded the special-case-check for ProjectCommand, but it would be nice to know why it was done this way in the first place.
> > Corresponding ticket with patch -https://code.djangoproject.com/ticket/16445
Reply all
Reply to author
Forward
0 new messages