24.5 Management Commands

When we swapped the User model in Chapter 22, we discovered that we had effectively broken the UserManager, and we extended the auth app’s implementation with our own createuser() and createsuperuser() methods.

When we did so, we partially broke the createsuperuser command for manage.py, called the createsuperuser management command. In this section, we fix that by creating our own custom management commands to create users and superusers. Before we jump into these commands, we first ease into the process by building a simpler command: createtag.

Get Django Unleashed 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.