Kaydet (Commit) 119ae653 authored tarafından Batuhan Taşkaya's avatar Batuhan Taşkaya

link preview consistency

üst 9b295e27
...@@ -25,7 +25,7 @@ SECRET_KEY = 'e+4_$yoyv)m*_xs!secifabey&he#18p&e_n06=%7qdu%2)8!4' ...@@ -25,7 +25,7 @@ SECRET_KEY = 'e+4_$yoyv)m*_xs!secifabey&he#18p&e_n06=%7qdu%2)8!4'
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
ALLOWED_HOSTS = [] ALLOWED_HOSTS = ["*"]
# Application definition # Application definition
......
purima @ 02d6c308
Subproject commit b64283d2f5a6a82622bd605e745bbabcdeb62c7c Subproject commit 02d6c30863bd50233b9b0c75297e895dd67aee10
...@@ -2,7 +2,7 @@ from urllib.parse import urlparse ...@@ -2,7 +2,7 @@ from urllib.parse import urlparse
from django import template from django import template
from django.template.loader import render_to_string from django.template.loader import render_to_string
from purima.utils.get_preview import _get_preview from purima.utils.get_preview import _get_preview, construct_preview
register = template.Library() register = template.Library()
...@@ -26,6 +26,6 @@ def get_preview(url): ...@@ -26,6 +26,6 @@ def get_preview(url):
preview = _get_preview(url) preview = _get_preview(url)
except: except:
_url = urlparse(url) _url = urlparse(url)
preview = f"<a href='{url}'>URL to {_url.netloc}</a>" preview = construct_preview(url, {'title': _url.netloc})
return preview return preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment