mirror of
https://github.com/quantum5/qlinks.git
synced 2025-04-25 03:01:56 -04:00
10 lines
289 B
Python
10 lines
289 B
Python
from django.http import HttpResponseRedirect
|
|
from django.shortcuts import get_object_or_404, render
|
|
|
|
from qlinks.models import Link
|
|
|
|
|
|
def short_link(request, slug):
|
|
link = get_object_or_404(Link.objects.values_list('long', flat=True), short=slug)
|
|
return HttpResponseRedirect(link)
|