A fast and easy Django project setup tool.
Project description
DjangoFast
DjangoFast is your all-in-one Django toolkit, designed to get you up and running with minimal fuss. If you're tired of repetitive setups and just want to start building, you've come to the right place.
Getting Started
These instructions will guide you through setting up and running DjangoFast on your local machine. Let's keep it simple and straightforward.
Prerequisites
Make sure you have these installed:
- Python 3.8+
- Poetry
Installation
-
Clone the repository:
git clone your_repository_url cd djangofast
-
Install dependencies using Poetry:
poetry install
-
Activate the virtual environment:
poetry shell
CLI Commands
DjangoFast comes with a few handy CLI commands. Here's what you need to know:
Initialize a New Project
To kick off a new DjangoFast project, just run:
python djangofast.py init
This command does a lot for you:
- Prompts you for the project name.
- Creates a
.env
file with the necessary environment variables. - Runs initial migrations.
- Optionally creates a superuser.
Steps Involved:
- The script checks if a
.env
file already exists. - If not, it prompts you to enter the project name and other configuration details like timezone.
- It generates a
.env
file with the specified configurations. - Runs Django migrations to set up the database schema.
- Optionally creates a Django superuser.
Create a New App with Optional Views
To create a new Django app with optional list and detail views, use the startapp
command:
python djangofast.py startapp <app_name> --list --detail
Replace <app_name>
with the name of your app. The optional --list
and --detail
flags create list and detail views, respectively.
Steps Involved:
- Creates the app directory under
apps/<app_name>
. - Creates a corresponding templates directory under
templates/<app_name>
. - Generates basic files for the app, including
views.py
,urls.py
, and optional templates for list and detail views. - Updates the main project's
urls.py
and settings to include the new app.
Precommit Checks
To run precommit checks, which include sorting imports with isort
and running Django tests, use the precommit
command:
python djangofast.py precommit
This command will:
- Run
isort
to automatically sort your imports. - Run Django tests to ensure everything is working correctly.
How It Works
Initialization (init
):
- Prompts the user for initial setup information.
- Creates and configures the project environment.
- Sets up the database and superuser.
Start App (startapp
):
- Automates the creation of a new Django app.
- Generates necessary files and directories.
- Adds basic views and templates if specified.
Precommit (precommit
):
- Ensures code quality and correctness by sorting imports and running tests.
Example Usage
Initialize the Project:
python djangofast.py init
Create a New App:
python djangofast.py startapp myapp --list --detail
Run Precommit Checks:
python djangofast.py precommit
Additional Information
Project Structure:
apps/
: Contains all the Django apps for the project.templates/
: Contains the templates for each app.main/
: Contains the main project settings and configuration files.
Configuration:
- The
.env
file stores environment-specific settings. - Use
dotenv
to load environment variables from the.env
file.
This setup provides a streamlined way to manage your Django projects, ensuring consistency and reducing the overhead of repetitive tasks.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file dj-fast-0.1.3.tar.gz
.
File metadata
- Download URL: dj-fast-0.1.3.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a23df9ef6512ed3d41ee2d7fc469b13cc20efc89387acbcde4e659d090e99699 |
|
MD5 | cb90c2ff07ef808965a84bfda892d2d9 |
|
BLAKE2b-256 | df236705658e34cddcbedee4990e4d1a5c27166ba4ff3a307c2d90c43427fffe |
File details
Details for the file dj_fast-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: dj_fast-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b03d265459dcafbab28d5fbbee464656aac7f77f17dd3b8839dbea86c48344c |
|
MD5 | 1b65e959aeff9c7348bacd8252100ac9 |
|
BLAKE2b-256 | 2c9ae3bf5e0a5990695bf04e29842d328443154dc889ed61c5ff261f37a2371c |