// use case

Share a Django dev server publicly without deploying

django manage.py runserver listens on 127.0.0.1 by default. You can bind 0.0.0.0 but that's only your LAN. lrok puts the runserver on a public HTTPS URL with one command.
  1. Run Django as usual

    $ python manage.py runserver 8000
  2. Tunnel — note the --hint flag for a stable URL

    $ lrok http 8000 --hint mysite-dev
  3. Add the host to ALLOWED_HOSTS

    Django rejects requests from unknown hosts in production-mode settings. Add the lrok subdomain to settings.ALLOWED_HOSTS = ['mysite-dev.lrok.io', 'localhost'].

// why lrok for this

Django's CSRF middleware requires the request URL's scheme to be https for cookie-based auth to work. lrok terminates real TLS at the edge so CSRF works the same as in production.

Related workflows