mirror of
https://github.com/fergalmoran/ferglie.git
synced 2025-12-22 01:07:55 +00:00
14 lines
339 B
Python
Executable File
14 lines
339 B
Python
Executable File
# Create your views here.
|
|
from django.http.response import Http404, HttpResponseRedirect
|
|
|
|
from core import url
|
|
from shorts.models import Url
|
|
|
|
|
|
def dispatch(request, dispatch_id):
|
|
try:
|
|
u = Url.objects.get(shortened_url=dispatch_id)
|
|
return HttpResponseRedirect(u.url)
|
|
except Url.DoesNotExist:
|
|
raise Http404()
|