Have you ever struggled with setting up a new project?
Was it difficult to configure everything and create all the files manually?
Have you ever wished you could bootstrap your entire project with just a single command?
Now you can — with hansi.
hansi is a CLI tool for fast bootstrapping and structuring your projects.
It helps you quickly set up frameworks like Django, and soon also FastAPI and Node.js, while providing a clean, local-development-ready structure right out of the box.
- Fast and easy project initialization
- Database options: SQLite or PostgreSQL
- Optional setup with Dockerfile and Docker Compose
- Automatically handles essentials:
- Create and activate the venv
- Runs migrations
- Creates a superuser
- Generates necessary files like .gitignore and .env
- Creates a
requirements.txtfile with the most used packages
At the moment, hansi only works on Linux systems.
Before installing hansi, make sure the following are installed on your machine:
For every project you create with hansi, a guide.txt file is automatically generated in the root directory.
Before doing anything else, you should read this file to get familiar with the setup process and understand how the project works.
You can install hansi globally using npm:
npm install -g hansihansi local django inithansi local django init --db sqlite --dockerfilehansi local django init --db postgreshansi local django init --db posgres --dockerfilehansi local django init --db postgres --dockercompose
Initialize a Django project with default sqlite DB.
USAGE
$ hansi local django init [--db sqlite|postgres] [--dockerfile] [--dockercompose]
FLAGS
--db=<option> [default: sqlite] Database type
<options: sqlite|postgres>
--dockercompose Create docker-compose.yml
--dockerfile Create Dockerfile
DESCRIPTION
Initialize a Django project with optional DB, Docker, and docker-compose
Initialize a Django project with sqlite DB and a running Dockerfile
USAGE
$ hansi local django init --db sqlite --dockerfile
DESCRIPTION
Creates a Django project with SQLite database.
Generates and start a Dockerfile for containerized development.
Migrations and superuser creation are done manually inside the container.
Initialize a Django project with postgres DB.
USAGE
$ hansi local django init --db postgres
DESCRIPTION
Creates a Django project configured for PostgreSQL.
You need to update your .env file with correct DB credentials manually.
USAGE
$ hansi local django init --db postgres --dockerfile
DESCRIPTION
Creates a Django project with PostgreSQL database.
Dockerfile is created but migrations and superuser creation are NOT run automatically.
Update your .env with DB credentials and run:
USAGE
$ hansi local django init --db postgres --dockercompose
DESCRIPTION
Creates a Django project configured for PostgreSQL with docker-compose setup.
Both web and db services are defined and running.
Migrations and superuser are run automatically inside the containers.