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
config
directory, 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
Dockerfile
anddocker-compose.yaml
for containerization. - Code formatters: Optionally include
black
andruff
formatters in thepyproject.toml
configuration file.
To install the package, run:
pip install git+https://github.com/mark0613/django-createproject.git
Once 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)mysql
postgres
--docker
: Include aDockerfile
anddocker-compose.yaml
for containerization.--formatter
: Include configuration for theblack
andruff
formatters inpyproject.toml
.
Create a new Django project with SQLite as the database:
django-createproject my_project
Create a new Django project with SQLite as the database and Docker support:
django-createproject my_project --docker
Create a new Django project with PostgreSQL as the database and Docker support:
django-createproject my_project --db=postgres --docker
Create a new Django project with PostgreSQL as the database, Docker support, and code formatters:
django-createproject my_project --db=postgres --docker --formatter
This project is licensed under the MIT License.