A file upload application for DjangoRestFramework
Project description
A file upload application for DjangoRestFramework
Installation
python3 -m pip install drf_fileupload
Usage
- edit
project/settings.py
INSTALL_APPS += [
'drf_fileupload',
]
MEDIA_ROOT = 'data/' # default: /
FILE_UPLOAD_TO = 'upload/%Y/%m/%d' # support strftime format, default: MEDIA_ROOT
MAX_FILE_UPLOAD = '10M' # limit max file size, default: None
- edit
project/urls.py
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('api/admin/', admin.site.urls),
path('api/fileupload/', include('drf_fileupload.urls')),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
API
)
Demo
git clone https://github.com/suqingdong/drf_fileupload
cd demo
python3 -m pip install -r requirements.txt
python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py createsuperuser
python3 manage.py runserver
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for drf_fileupload_api-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 715d6a01b326c2ff417a97de3711dc4caf2db8cb5171d4cb7b6187d4c99364f6 |
|
MD5 | b3d7cb3f35a896aa7f02ae7290e214e6 |
|
BLAKE2b-256 | 6da4beedadb3bf7f6dc566691ad7d7588ac754ff4cb206f3a6523e6c197cc2db |