Install django-shorturls to generate simple shortpermalinks for entries :3

This commit is contained in:
Danielle McLean 2017-10-29 12:56:30 +11:00
parent 21786d6e6c
commit 7027c74035
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
6 changed files with 20 additions and 2 deletions

View file

@ -29,6 +29,7 @@ xrd = "*"
django-push = "*"
pyyaml = "*"
django-annoying = "*"
django-shorturls = "*"
[dev-packages]

8
Pipfile.lock generated
View file

@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
"sha256": "60cccca3a3edbe0c10266ab3641a32cf61223145a35203eae215af023f88d350"
"sha256": "3f9a75dcd0609cd38fc01d23b8f2e198e494f5ab7120e5bb8af08b909a16ea52"
},
"host-environment-markers": {
"implementation_name": "cpython",
@ -157,6 +157,12 @@
],
"version": "==1.7.1"
},
"django-shorturls": {
"hashes": [
"sha256:382ff617b36fea04981b30457377a46f2034d0940a40a20c6f637c55ea0bda93"
],
"version": "==2.0.0"
},
"gunicorn": {
"hashes": [
"sha256:75af03c99389535f218cc596c7de74df4763803f7b63eb09d77e92b3956b36c6",

View file

@ -1,5 +1,7 @@
{% extends 'lemoncurry/layout.html' %}
{% load static %}
{% load shorturl static %}
{% block head %}{% revcanonical entry %}{% endblock %}
{% block styles %}
<link rel="stylesheet" type="text/stylus" href="{% static 'entries/css/h-entry.styl' %}" />

View file

@ -78,6 +78,7 @@ INSTALLED_APPS = [
'django_otp.plugins.otp_totp',
'favicon',
'meta',
'shorturls',
'lemoncurry',
'entries',
@ -209,6 +210,12 @@ SITE_ID = 1
# https://pythonhosted.org/django-agent-trust/
AGENT_COOKIE_SECURE = True
# django-shorturls
# https://pypi.python.org/pypi/django-shorturls
SHORTEN_MODELS = {
'e': 'entries.entry',
}
# django-meta
# https://django-meta.readthedocs.io/en/latest/settings.html
META_SITE_PROTOCOL = 'https'

View file

@ -6,6 +6,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<link rel="canonical" href="{{ uri }}" />
{% block head %}{% endblock %}
<link rel="hub" href="{% get_push_hub %}" />
<link rel="self" href="{{ uri }}" />

View file

@ -39,6 +39,7 @@ urlpatterns = [
url('^.well-known/', include('wellknowns.urls')),
url('^admin/', otp_admin_site.urls),
url('^auth/', include('lemonauth.urls')),
url('^s/', include('shorturls.urls')),
url(r'^sitemap\.xml$', sitemap.index, maps),
url(r'^sitemaps/(?P<section>.+)\.xml$', sitemap.sitemap, maps,