django-zero command line tool will help you manage your project. It is not the
script that is available in usual
django projects, although you can run the django management tool from the CLI.
You can run the CLI either from the console script, or by executing the module. The two following commands are equivalent:
$ python -m django_zero
The CLI consists of "subcommands", available from the entrypoint command described above. You can obtain more
informations by setting python's logging level to DEBUG, using the
--debug flag (or
$ django-zero [--debug|-D] <subcommand>
or using the module...
$ python -m django_zero [--debug|-D] <subcommand>
django-zero contains some
cookiecutter templates to help you scaffold your projects.
To create a new
$ django-zero create project <project-name>
Command will create a new directory with the provided name, ready to roll.
Once you're in a project, you can use the app creation script:
$ django-zero create app <app-name>
By convention, the application will live in
Lifecycle commands will help you during development and deployment.
Updates project dependencies, both local (to your project) and global (to one
django-zero install, in a virtualenv
for example). Python package install is not enough, as this will also install Node.js modules.
$ django-zero install
Cleanup Node.js modules.
$ django-zero uninstall
honcho manager with the necessary subprocesses to have de development server. This will launch django's
development server, but also webpack in "watch" mode (so your ES6/SCSS assets are recompiled when they change) and
maybe some more processes (for example, if you enable celery, it will run both celery beat and a celery worker).
$ django-zero start
django-zero's library path.
$ django-zero path
Most things done by the CLI requires to delegate work to subprocesses, after a bit of environment setup. Instead of
celery, etc. you should prefer the delegate subcommands so
you're certain the environment is correct.
One of the trickiest parts is that instead of just relying on the project's
node_modules directory, we setup the
environment so that Node.js will use both your project's
node_modules directory but also
All delegates commands allow to pass arbitrary parameters to the actual binary handler. For example, if you want to
--wonderfull flag to
webpack, just run
django-zero webpack --wonderfull.
$ django-zero manage ...
$ django-zero gunicorn ...
gunicorn to be installed)
$ django-zero daphne ...
daphne to be installed)
$ django-zero celery ...
celery to be installed and enabled)
$ django-zero webpack ...