Skip to main content

Reusable Django models and storages

Project description

DjangoEssentials

DjangoEssentials is a Python library designed to streamline and enhance the development process of Django applications. It offers a collection of commonly used Django models and deployment settings, encapsulating repetitive patterns and configurations into a reusable package. The library is intended to evolve with contributions from the community, making it a collaborative project.

Features

  • TimeBasedStampModel: An abstract model providing time-based fields for tracking creation, update, and deletion times of model instances.
  • MyS3Storage: A custom storage class for Django, facilitating integration with Amazon S3 for media storage, with features such as non-overwriting of files with the same name and public read access by default.

Getting Started

Below are instructions on how to install DjangoEssentials and examples of how to use its features in your Django projects.

Installation

Install DjangoEssentials using pip:

pip install DjangoEssentials

Usage

  • TimeBasedStampModel

Inherit from TimeBasedStampModel to add automatic creation, update, and soft deletion timestamps to your models.

from django.db import models
from DjangoEssentials.models import TimeBasedStampModel

class YourModel(TimeBasedStampModel):
    name = models.CharField(max_length=255)
    # Add your fields here
  • MyS3Storage

Configure your Django project to use MyS3Storage for handling media files with Amazon S3.

# settings.py

DEFAULT_FILE_STORAGE = 'DjangoEssentials.storage.MyS3Storage'

Advanced Usage

DjangoEssentials aims to provide more utilities and helpers over time, driven by community contributions and the evolving needs of Django developers.

Contributing

We welcome contributions from the community, whether it's adding new features, improving documentation, or reporting bugs. Please follow these steps to contribute:

Fork the repository.

  • Create your feature branch (git checkout -b feature/AmazingFeature).
  • Commit your changes (git commit -am 'Add some AmazingFeature').
  • Push to the branch (git push origin feature/AmazingFeature).
  • Open a Pull Request.

Contact

For questions or additional information, please reach out to codermungan@gmail.com

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

DjangoEssentials-0.1.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

DjangoEssentials-0.1.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file DjangoEssentials-0.1.1.tar.gz.

File metadata

  • Download URL: DjangoEssentials-0.1.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.0

File hashes

Hashes for DjangoEssentials-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e6316e4306ec4986d0e28f5e250b45e95c1ee315db3efe34f7b520cd64f2a3f8
MD5 4e8b851b4c47d4856c06069fc8d59461
BLAKE2b-256 a2eff24f6f516ff6b8c100a59f32b391e8b605dfb55f43c0cbc0fe4b5c6a6b34

See more details on using hashes here.

File details

Details for the file DjangoEssentials-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for DjangoEssentials-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 53639404889c633b831342a5a55272d4d7e92ca060c3f4ccc55a65ad428d0bb7
MD5 234fa1834046f2aea11e14227945c0ae
BLAKE2b-256 b8443b1233572db2245f7476d30cd010cf2b2711fab9b911c45942f2775aee05

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