django-createproject is a Django project creation command, designed to quickly set up project templates that I frequently use. It includes additional configurations for database setup, Docker, and code formatters.
- Config Directory: The project's configuration files will be placed inside a
configdirectory, which is created in the current working directory along withmanage.py. This allows you to set up a virtual environment (venv) or Poetry before running the command, and the project will be created in the current location. You don't need to move any files around. - Database configuration: Choose your database backend, and I will automatically generate the corresponding configuration in
settings.py. Currently supported options are:sqlite,mysql, orpostgres. Default issqlite. - Docker support: Optionally include a
Dockerfileanddocker-compose.yamlfor containerization. - Code formatters: Optionally include
blackandruffformatters in thepyproject.tomlconfiguration file.
To install the package, run:
pip install git+https://github.com/mark0613/django-createproject.gitOnce installed, you can use the django-createproject command to create a new Django project:
django-createproject my_project --db=postgres --docker --formatter--db: Specify the database backend. Options are:sqlite(default)mysqlpostgres
--docker: Include aDockerfileanddocker-compose.yamlfor containerization.--formatter: Include configuration for theblackandruffformatters inpyproject.toml.
Create a new Django project with SQLite as the database:
django-createproject my_projectCreate a new Django project with SQLite as the database and Docker support:
django-createproject my_project --dockerCreate a new Django project with PostgreSQL as the database and Docker support:
django-createproject my_project --db=postgres --dockerCreate a new Django project with PostgreSQL as the database, Docker support, and code formatters:
django-createproject my_project --db=postgres --docker --formatterThis project is licensed under the MIT License.