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
Features
One-time only download ink
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 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.
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.
Trough the action button you can serve a site with all the files from Upload Files.
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
File details
Details for the file django-onetimelink-0.3.tar.gz
.
File metadata
- Download URL: django-onetimelink-0.3.tar.gz
- Upload date:
- Size: 96.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5916f588afa2bc5de2fe2153736ae92d573c471c4154d5daf98f93f2f58a96ae |
|
MD5 | 2566c98e705c2abaa363809c689460e5 |
|
BLAKE2b-256 | 09ce6eb2fba6fbd121eb1a3f39fa4d680939e5796fb4d99e4912b3772eb34bae |