Skip to main content

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:

Installation

  1. Clone the repository:

    git clone your_repository_url
    cd djangofast
    
  2. Install dependencies using Poetry:

    poetry install
    
  3. 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:

  1. The script checks if a .env file already exists.
  2. If not, it prompts you to enter the project name and other configuration details like timezone.
  3. It generates a .env file with the specified configurations.
  4. Runs Django migrations to set up the database schema.
  5. 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:

  1. Creates the app directory under apps/<app_name>.
  2. Creates a corresponding templates directory under templates/<app_name>.
  3. Generates basic files for the app, including views.py, urls.py, and optional templates for list and detail views.
  4. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dj-fast-0.1.3.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

dj_fast-0.1.3-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

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

Hashes for dj-fast-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a23df9ef6512ed3d41ee2d7fc469b13cc20efc89387acbcde4e659d090e99699
MD5 cb90c2ff07ef808965a84bfda892d2d9
BLAKE2b-256 df236705658e34cddcbedee4990e4d1a5c27166ba4ff3a307c2d90c43427fffe

See more details on using hashes here.

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

Hashes for dj_fast-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8b03d265459dcafbab28d5fbbee464656aac7f77f17dd3b8839dbea86c48344c
MD5 1b65e959aeff9c7348bacd8252100ac9
BLAKE2b-256 2c9ae3bf5e0a5990695bf04e29842d328443154dc889ed61c5ff261f37a2371c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page