A file upload application for DjangoRestFramework
Project description
A file upload application for DjangoRestFramework
Installation
python3 -m pip install drf-fileupload-api
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
FILE_UPLOAD_MAX_SIZE = '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.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8be461487108fd3850f9572c025a9fa9f1eb2572c5408d9d144869a3e3dea8f3 |
|
MD5 | 3f21f3e81e39e7e653a3c0f563a9937d |
|
BLAKE2b-256 | 2326a99444ff5e5a3ab4c9db82a335471340f23b47ef3918475bc065d3f17a0f |