Skip to main content

Attachments management app for django

Project description

version downloads license

Django application to manage attached files to any django model.

Install

pip install django_attachments_management

Configure

Add ‘django_attachments’ to INSTALLED_APPS.

Usage

Add GalleryField or LibraryField to django model.

from django.db import models
from django_attachments.fields import LibraryField, GalleryField


class Article(models.Model):
        title = models.CharField(max_length=100)
        attachments = LibraryField(related_name='articles_with_attachment', on_delete=models.CASCADE)
        gallery = GalleryField(related_name='articles_with_gallery', on_delete=models.CASCADE)

Use AttachmentsAdminMixin to enable attachments in admin interface.

from django.contrib import admin

from .models import Article
from django_attachments.admin import AttachmentsAdminMixin


class ArticleAdmin(AttachmentsAdminMixin, admin.ModelAdmin):
        pass


admin.site.register(Article, ArticleAdmin)

Screenshots

https://raw.github.com/wiki/mireq/django-attachments/django_attachments.png?v2022-12-11

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_attachments_management-1.2.4.tar.gz (58.4 kB view details)

Uploaded Source

Built Distribution

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

django_attachments_management-1.2.4-py3-none-any.whl (60.5 kB view details)

Uploaded Python 3

File details

Details for the file django_attachments_management-1.2.4.tar.gz.

File metadata

File hashes

Hashes for django_attachments_management-1.2.4.tar.gz
Algorithm Hash digest
SHA256 5d6d46c8f9353f9ed496eb7aefd2c7d5fd9ba2e88f29793b93b68b44bfa594a7
MD5 1f488976ff20baa7da460d3793dd3463
BLAKE2b-256 6f815d17bf4b1b8e48181a45c92ef529a6d50314c8ccc2ffa47f54d56c4eaf36

See more details on using hashes here.

File details

Details for the file django_attachments_management-1.2.4-py3-none-any.whl.

File metadata

File hashes

Hashes for django_attachments_management-1.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cb80ab11286546586204593be7f145b0652f52cbf46ebd6517fcac8bf85ffaed
MD5 26462d74450150c7a5b7c3bed489f113
BLAKE2b-256 e31824b55f4846481f61b5a13c26b4fdbbf3c95eaac8d2a133ca963ad5cb5412

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