9 Management commands

This chapter covers

  • Management commands built into Django
  • Writing your own management commands
  • Passing command-line arguments to management commands
  • Creating unit tests for management commands

Management commands are Python scripts that allow you to control your Django project from the command line. Over two dozen commands are included with Django, and you can also write your own. This chapter covers management commands you haven’t seen so far, along with details on how to build and test custom commands.

9.1 Management commands in practice

You’ve already used a number of management commands throughout this book. You’ve seen how to create a Django project, create a Django app, create a superuser, create and migrate ...

Get Django in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.