Skip to main content

A django one-time file streaming application

Project description


A Django file streaming application to provide download links that only valid for one time click. Ispired by django-dynamic-link.


BSD-3-Clause license


  • Tested with Django 2.2
  • Tested with Django 3.1


  • One-time only download link



  • This app only


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-onetimelink
  • With pip you can also uninstall:

    pip uninstall django-onetimelink

test your installation

Go to console and type:


… then type:

>>> import onetimelink
>>> onetimelink.CKINST()
>>> help(onetimelink)
>>> exit()


  • Add “onetimelink” to you installed apps in the settings file.

  • Make sure that:

    1. Your Admin is enabled (‘django.contrib.admin’, is in your INSTALLED_APPS).
    2. ‘django.contrib.auth.context_processors.auth’, (also for admin) is in TEMPLATE_CONTEXT_PROCESSORS.
    3. ‘django.core.context_processors.request’, is in TEMPLATE_CONTEXT_PROCESSORS.
  • Add the following to your

    1. from django.conf.urls import include, url
    2. from onetimelink import presettings
    3. url(r’%s/’ % presettings.DYNAMIC_LINK_URL_BASE_COMPONENT, include(‘onetimelink.urls’)),
  • Finally run:

    python makemigrations
    python migrate
    python runserver

Make it custom

Use the global in your projects root to overwrite the applications presettings with the following variables.


  • Default: settings.MEDIA_ROOT
  • A path to a directory. From this point you can walk down the subdirectories to choose your files to serve.


  • Default: ‘OneTimeLink’
  • A string that modifies your url serve path.
  • Example:


  • Default: ‘’
  • Uploaded files base directory.


  • Default: ‘http’
  • HTTP Schema Protocal.


Open the admin interface and go to “OneTimeLink” section. The rest should be self-explanatory.


  • 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.



  • Add setting for schema protocal
  • Prefix links with FORCE_SCRIPT_NAME

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-onetimelink, version 1.1
Filename, size File type Python version Upload date Hashes
Filename, size django_onetimelink-1.1-py3-none-any.whl (99.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size django-onetimelink-1.1.tar.gz (97.4 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page