khaganat-web/utils.py

11 lines
196 B
Python
Raw Permalink Normal View History

from django.urls.exceptions import Resolver404
from django.urls import resolve
def is_link_legit(url):
try:
resolve(url)
except Resolver404:
return False
return True