for more detail about shorten URL system you can check my blog: 短網址系統開發心得
like goo.gl, paste a URL and click -> get shortened URL!
enable custom title,description and thumbnail for facebook (and other social media) link preview.
enable to track views.
example site
$ git clone https://github.com/kehanlu/shorten_url
$ cd django
# should have django 2.0 enviroment
$ python manage.py migrate
$ python manage.py runserver
# localhost:8000/links
# enjoy!
is quite easy!
put app & template folder to the right place
$ python manage.py migrate
yoursite/settings.py
INSTALLED_APP = [
# ...
'links',
]
# finely set STATIC_URL and MEDIA_URL
# see django doc:
# https://docs.djangoproject.com/en/2.0/howto/static-files/
links/views.py
# BASE should start with 'http://' or 'https://'
BASE_URL = 'https://yourdomain.com/links/'
BASE_SHORT_URL = 'https://yourdomain.com/u/'
# hash_salt for generate permanent url
HASH_SALT = 'meow'
# default value for custom url
DEFAULT_NAME = ''
DEFAULT_TITLE = ''
DEFAULT_DESCRIPTION = ''
static/images/default_thumbnail.png
put a image for default thumbnail!
Bulma (CSS framework) Chart js(draw Chart)
i have no idea now, maybe open an issue! tks