You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
xenua b65a45a5ff
add readme
2 years ago
leftists critical fix 2 years ago
lonk remove django_scopes 2 years ago
tests remove django_scopes 2 years ago
.gitignore initial commit 2 years ago add readme 2 years ago initial commit 2 years ago
requirements-dev.txt add dev requirements 2 years ago
requirements.txt remove django_scopes 2 years ago

lonk a simple, hackable link shortener with good enough performance

[python >= 3.8] [django >= 4.0]

How the fuck do I deploy this??


  • clone the repo
  • set up python environment
    • python3 -m venv env
      source env/bin/activate
      pip install -r requirements.txt
  • ./ migrate
  • ./ createsuperuser
  • ./ runserver


  • clone the repo
  • take a look through the file
    • follow the official documentation
      • ALLOWED_HOSTS differs for this project. either:
        • set it to ["*"] and run behind a http reverse proxy that matches by host header
        • set it to a list of all domains that should be served.
      • I personally have had a good experience with running gunicorn behind nginx.
    • or at the very least, turn off debug mode and generate a proper secret (e.g. $ openssl rand -base64 64)

(speculative) FAQ

Q: performance? in a django project?
A: yes! it does 1400 requests per second on the redirect endpoints in a basic deployment1.

Q: my other domains aren't showing up? how do I tell lonk that they exist?
A: simply access lonk on those domains! it'll pick them up by http host headers2

Q: how do I remove domains?
A: currently, through the backend shell. Front end domain management will be added in a future release.

  1. gunicorn -w 2 lonk.wsgi:application, no proxy

  2. specifically, it uses request.get_host(), see the documentation for details