Skip to main content

Django Simple Attachment Model

Project description

Django 图片存储

Getting Started

Install Packages

$ pip install sorl-thumbnail
$ pip install django-taggit
$ pip install django-extra-fields
$ pip install djangorestframework
$ pip install django-simple-attachments

Update settings.py

INSTALLED_APPS = [
    ...
    'taggit',
    'rest_framework',
    'attachments',
    ...
]

Update urls.py

from attachments.views import media_view

urlpatterns = [
    ...
    path('attachments/', include('attachments.urls')),
    re_path(r'^media/attachments/(?P<path>.*)(/?)?', media_view),
    ...
]

Usage

Realtime resize image source

<img src="/media/attachments/0001.png?width=100&height=100" />

Next

  • AutoClean
  • Premissions

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-simple-attachments-0.0.1.tar.gz (7.9 kB view hashes)

Uploaded Source

Built Distribution

django_simple_attachments-0.0.1-py3-none-any.whl (13.3 kB view hashes)

Uploaded Python 3

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