A django one-time file streaming application
Project description
Description
A Django file streaming application to provide download links that only valid for one time click. Ispired by django-dynamic-link.
License
BSD-3-Clause license
Notes
Tested with Django 2.2
Tested with Django 3.1
Features
One-time only download link
Installation
Dependences
This app only
Installation
Installation with pip (recommended)
Pip will download and install the package and take care of all the dependences. If you havn’t pip on your system then install setuptools first after that run “easy_install pip”. After that you can use pip in your terminal window.
Use the stable release (recommended):
pip install django-onetimelinkWith pip you can also uninstall:
pip uninstall django-onetimelink
test your installation
Go to console and type:
python… then type:
>>> import onetimelink >>> onetimelink.CKINST() >>> help(onetimelink) >>> exit()
Setup
Add “onetimelink” to you installed apps in the settings file.
Make sure that:
Your Admin is enabled (‘django.contrib.admin’, is in your INSTALLED_APPS).
‘django.contrib.auth.context_processors.auth’, (also for admin) is in TEMPLATE_CONTEXT_PROCESSORS.
‘django.core.context_processors.request’, is in TEMPLATE_CONTEXT_PROCESSORS.
Add the following to your urls.py:
from django.conf.urls import include, url
from onetimelink import presettings
url(r’%s/’ % presettings.DYNAMIC_LINK_URL_BASE_COMPONENT, include(‘onetimelink.urls’)),
Finally run:
python manage.py makemigrations python manage.py migrate python manage.py runserver
Make it custom
Use the global settings.py in your projects root to overwrite the applications presettings with the following variables.
DYNAMIC_LINK_MEDIA
Default: settings.MEDIA_ROOT
A path to a directory. From this point you can walk down the subdirectories to choose your files to serve.
DYNAMIC_LINK_URL_BASE_COMPONENT
Default: ‘OneTimeLink’
A string that modifies your url serve path.
Example: www.example.com/DYNAMIC_LINK_URL_BASE_COMPONENT/link/3839hd8HKl3/example.zip.
DYNAMIC_LINK_UPLOAD_TO
Default: ‘’
Uploaded files base directory.
DYNAMIC_LINK_SCHEMA_PROTO
Default: ‘http’
HTTP Schema Protocal.
Usage
Open the admin interface and go to “OneTimeLink” section. The rest should be self-explanatory.
Hints
Upload Files to upload the file to DYNAMIC_LINK_MEDIA
The filename from the in Upload Files is only for human readability. You can delete or change these filenames in any way you want.
Through the action button you can serve a site with all the files from Upload Files.
Changelogs
2021-03-24
Add setting for schema protocol
Prefix links with FORCE_SCRIPT_NAME
2021-03-25
Fix several bugs
Do NOT use previous versions of this package
2021-06-08
Fix search bug in admin
clean up code
Do NOT use previous versions of this package
2022-02-04
Add setting to override HTTP Host
clean up code
Fix several bugs
Do NOT use previous versions of this package
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 django-onetimelink-1.9.tar.gz
.
File metadata
- Download URL: django-onetimelink-1.9.tar.gz
- Upload date:
- Size: 97.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.4 tqdm/4.61.0 importlib-metadata/4.5.0 keyring/23.0.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b0f1e0c88f1d01657dac790cd4b59fcc03022c3c70952181d646fb155b4aa40 |
|
MD5 | fb3a05f7987680c8a32e20d35a65d4d7 |
|
BLAKE2b-256 | 0821082553af2f6355df3a07c7cec91f781c37e20cf83ebaed5d4644c2794c81 |
Provenance
File details
Details for the file django_onetimelink-1.9-py3-none-any.whl
.
File metadata
- Download URL: django_onetimelink-1.9-py3-none-any.whl
- Upload date:
- Size: 100.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.4 tqdm/4.61.0 importlib-metadata/4.5.0 keyring/23.0.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2e48e67c6a502500fe65b1afe1900e8eb0073c2b43a5be01c675bb11873a8fc |
|
MD5 | 6053209448697bd52ff214064bce67eb |
|
BLAKE2b-256 | 31e11fca2fc412c93911a8cf20aac4ffe97a5cef58c74bfebe847f1a6e204dfd |