Skip to main content

A Django app (custom) that modifies the startapp command to ensure all apps are created inside a directory defined by DEFAULT_APPS_DIR in settings.py.

Project description

Django Create App

This Django package customizes the startapp command to create new apps inside a directory specified by the DEFAULT_APPS_DIR setting in your settings.py. This ensures that all your Django apps are neatly organized within a designated folder structure, helping you maintain a cleaner project structure.

Features

  • Modifies the startapp command to create apps inside a configurable directory (DEFAULT_APPS_DIR) in settings.py.
  • Simplifies managing apps within large Django projects by keeping them inside a specific directory.
  • Reduces the need to manually move apps after they are created.

Installation

To install the package, add it to your project’s requirements.txt or run the following command:

pip install django-create-app

Configuration

  1. Install the django-create-app like any python packages.

    pip install django-create-app
    
  2. Update settings.py

    Add DEFAULT_APPS_DIR variable inside your settings.py. This will define the directory where all the apps are to be included. If you left undeclared, "apps" will be used by default.

    # settings.py
    ...
    DEFAULT_APPS_DIR = "apps"
    ...
    
  3. Now, you can use modified startapp command to create new apps inside DEFAULT_APPS_DIR directory.

Further Configuration

By Default, django-create-app adds DEFAULT_APPS_DIR at the end of the sys.path but sometime we need to add it to different index. For such case, create DEFAULT_APP_DIR_INDEX variable and assign the index at which the DEFAULT_APPS_DIR is inserted.

Example,

DEFAULT_APPS_DIR = "apps"
DEFAULT_APPS_DIR_INDEX = 0 # This causes python to look for any modules or packages inside "apps" directory first.

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

django_create_app-1.0.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_create_app-1.0.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file django_create_app-1.0.1.tar.gz.

File metadata

  • Download URL: django_create_app-1.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.0

File hashes

Hashes for django_create_app-1.0.1.tar.gz
Algorithm Hash digest
SHA256 31bc99ca68507760c4527acd8ee3f344d824299bb5d2b6852585d4137579660b
MD5 c4ae2aafb0a2a9daed2b8e1e6378e56e
BLAKE2b-256 d9904f379348418d42ac80b21f734bfa89135b4fc5d926af3387d08b9c0fff6f

See more details on using hashes here.

File details

Details for the file django_create_app-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_create_app-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 80889e575fcd9683ab3c25f037a1269184499587a2c9c5a38368fc6ab4b01a34
MD5 edbab159a55f939cd117e0b2a09c4ae1
BLAKE2b-256 d092c0dc9fb463020bca3430e79dd2318841bd7f8555a07b4d270735cc9d2f77

See more details on using hashes here.

Supported by

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