Django WeChat Short URL
Project description
django-short-url
Django WeChat Short URL
Installation
pip install django-short-url
Usage
from django_short_url.views import get_surl
def xxx(request):
surl = get_surl(lurl)
Urls.py
urlpatterns = [
url(r'^s/', include('django_short_url.urls', namespace='django_short_url')),
]
or
from django.conf.urls import include, url
from django_short_url import views as surl_views
urlpatterns = [
url(r'^(?P<surl>\w+)', surl_views.short_url_redirect, name='short_url_redirect'),
]
Settings.py
INSTALLED_APPS = (
...
'django_short_url',
...
)
# Redirect url when short url not exists
DJANGO_SHORT_URL_REDIRECT_URL = ''
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-short-url-1.1.7.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for django_short_url-1.1.7-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 359561eb82b5fda16834518f203fc941c907de0524eede5cd4de821825d95dbb |
|
MD5 | 8e74f98c867cc0669da053ebcd5e2883 |
|
BLAKE2b-256 | 513b2a4b6c3d74d45e2ad3d9ac05fb2d429c5d1b312fa230dbc04504d260407b |