How would you set up a custom command in Django that can be run using the manage.py file?

  • a. Create a Python script with your command logic, save it in the Django project directory, and add an entry in the commands list in the project's __init__.py.
  • b. Create a Python script with your command logic and place it in the management/commands directory of your Django app.
  • c. Modify the Django source code to add your custom command.
  • d. Use a third-party package for custom commands.
To set up a custom management command in Django, you should create a Python script in the management/commands directory of your app. Django will automatically discover and make it available through manage.py. Options a, c, and d are not standard practices.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *