# django-short-url
Django Short URL
## Installation
```shell
pip install django-short-url
```
## Usage
```python
from django_short_url.views import get_surl
def xxx(request):
surl = get_surl(lurl)
```
## Urls.py
```python
urlpatterns = [
url(r'^s/', include('django_short_url.urls', namespace='django_short_url')),
]
```
or
```python
from django.urls import re_path
from django_short_url import views as surl_views
urlpatterns = [
re_path(r'^(?P<surl>\w+)', surl_views.short_url_redirect, name='short_url_redirect'),
]
```
## Settings.py
```python
INSTALLED_APPS = (
...
'django_short_url',
...
)
# Redirect url when short url not exists
DJANGO_SHORT_URL_REDIRECT_URL = ''
```
Raw data
{
"_id": null,
"home_page": "https://github.com/django-xxx/django-short-url",
"name": "django-short-url",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "django-short-url",
"author": "Hackathon",
"author_email": "kimi.huang@brightcells.com",
"download_url": "https://files.pythonhosted.org/packages/76/cf/f14f70a42792684b6b1d75b4f812a22d74a61a577c99617129ec0e9c49de/django-short-url-1.1.8.tar.gz",
"platform": null,
"description": "# django-short-url\nDjango Short URL\n\n## Installation\n```shell\npip install django-short-url\n```\n\n## Usage\n```python\nfrom django_short_url.views import get_surl\n\ndef xxx(request):\n surl = get_surl(lurl)\n```\n\n## Urls.py\n```python\nurlpatterns = [\n url(r'^s/', include('django_short_url.urls', namespace='django_short_url')),\n]\n```\nor\n```python\nfrom django.urls import re_path\nfrom django_short_url import views as surl_views\n\nurlpatterns = [\n re_path(r'^(?P<surl>\\w+)', surl_views.short_url_redirect, name='short_url_redirect'),\n]\n```\n\n## Settings.py\n```python\nINSTALLED_APPS = (\n ...\n 'django_short_url',\n ...\n)\n\n# Redirect url when short url not exists\nDJANGO_SHORT_URL_REDIRECT_URL = ''\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "Django Short URL",
"version": "1.1.8",
"split_keywords": [
"django-short-url"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3a4579bd30ff09b651b6a246abd9c6497e803a6b968f6b12015411c734f388b0",
"md5": "36b5ccb389f1fcff838647a5adcc62c9",
"sha256": "1edb1397dfabe23f9ec391a857211c461c365f6b472d712bb90f55dbf3aa8aa2"
},
"downloads": -1,
"filename": "django_short_url-1.1.8-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "36b5ccb389f1fcff838647a5adcc62c9",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 7056,
"upload_time": "2023-02-03T10:59:56",
"upload_time_iso_8601": "2023-02-03T10:59:56.812752Z",
"url": "https://files.pythonhosted.org/packages/3a/45/79bd30ff09b651b6a246abd9c6497e803a6b968f6b12015411c734f388b0/django_short_url-1.1.8-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "76cff14f70a42792684b6b1d75b4f812a22d74a61a577c99617129ec0e9c49de",
"md5": "996f139804ff4b8b76e68de6b6740685",
"sha256": "99e365b14676786682b1c4631b5dccfc333d7481074c598a366326a3942711bb"
},
"downloads": -1,
"filename": "django-short-url-1.1.8.tar.gz",
"has_sig": false,
"md5_digest": "996f139804ff4b8b76e68de6b6740685",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5133,
"upload_time": "2023-02-03T10:59:59",
"upload_time_iso_8601": "2023-02-03T10:59:59.171464Z",
"url": "https://files.pythonhosted.org/packages/76/cf/f14f70a42792684b6b1d75b4f812a22d74a61a577c99617129ec0e9c49de/django-short-url-1.1.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-03 10:59:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "django-xxx",
"github_project": "django-short-url",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "django-short-url"
}