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
Metadata
Release files for drf-fileupload-api 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| drf_fileupload_api-1.0.1.tar.gz | 5.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| drf_fileupload_api-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.9 kB
Release files / drf_fileupload_api-1.0.1.tar.gz
| Download URL | drf_fileupload_api-1.0.1.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d065bafaeee7c3755878f6fd95ff5020ffd3b608fa0313e2288d6c0f1c8d2109
|
|
BLAKE2b-256 checksum How to use checksums |
2897ffa7f3c31393a0e9c68e8ad3997e644910961e0685463a16bd6a69a6affd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / drf_fileupload_api-1.0.1-py3-none-any.whl
| Download URL | drf_fileupload_api-1.0.1-py3-none-any.whl |
|---|---|
| Size | 6.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8be461487108fd3850f9572c025a9fa9f1eb2572c5408d9d144869a3e3dea8f3
|
|
BLAKE2b-256 checksum How to use checksums |
2326a99444ff5e5a3ab4c9db82a335471340f23b47ef3918475bc065d3f17a0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|