Skip to main content

Django one time link generator and processor

Project description

Django tool for create ont time links


For integrate with Django need to add ua2.otl to the list of installed app:


and put into a root next line:

url(r'^l/', include('ua2.otl.urls'))

Be warning: include only compatibil with Django >= 1.8. For django before 1.8 need use following solution:

from ua2.otl.views import otl_view

urlpatterns = urlpatterns(
    url(r'^l/(?P<otp_key>\w+)/$', otl_view, name='one-time-link'),


You can use OneTimeLink with several scenario:

  • redirect to view with django backresolve (with support callback)
  • redirect to direct URL (with support callback)
  • using view to redner response


There are two way to pass resulted link to OneTimeLink object:

  • pass url resolve point with kwargs
  • pass rendered link
from ua2.otl import OneTimeLink

link = OneTimeLink.create(resolve_name='django-url-name', resolve_kwargs={'value': 1})

Example with callback and authorization:

    from ua2.otl import OntTimeLink

    def auth_callback(request, user_email):
        user = get_object_or_404(User,
        login(request, user)

    def password_restore(request):

    def send_restore_passwortd(request):
            link = OneTimeLink.create(resolve_name='url-password-reset')
            link['user_email'] = request.POST.get('user_email')


            return HttpResponse("" % link.url)

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 ua2.otl, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size ua2.otl-0.0.5.tar.gz (4.5 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