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
File details
Details for the file drf_fileupload_api-1.0.0.tar.gz
.
File metadata
- Download URL: drf_fileupload_api-1.0.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f076b7736c54082f82c592d45eda87043a5bd5d06b33be2c9695d0e223ac8da |
|
MD5 | 91401447d33693c61dc6b9c5e625ffd1 |
|
BLAKE2b-256 | 0998b77f5917ca7f73e496993e6a53d88c317faadb3e00b1031d4a292763c252 |
File details
Details for the file drf_fileupload_api-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: drf_fileupload_api-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 715d6a01b326c2ff417a97de3711dc4caf2db8cb5171d4cb7b6187d4c99364f6 |
|
MD5 | b3d7cb3f35a896aa7f02ae7290e214e6 |
|
BLAKE2b-256 | 6da4beedadb3bf7f6dc566691ad7d7588ac754ff4cb206f3a6523e6c197cc2db |