drffileuploadapi 1.0.1
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
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.