A template for Django/Svelte single-page apps
This gives you JSON Web Token auth and a few extra files to help you deploy with heroku. I've left a few TODO
s in the code, so you can set up your own app. You can see what the template looks like here, but I'm not sure why you would want to, because it only lets you log in
DATABASE_URL
. For example, my local value ispostgres:https://christiandrappi@localhost:5432/django_svelte
PYTHONPATH
. Point it to the outerbackend
dir, since our python does not live in the root directoryDJANGO_SECRET_KEY
. Create one with:$ python >>> from django.core.management.utils import get_random_secret_key >>> get_random_secret_key()
Backend Django server (port 8000):
$ python backend/manage.py runserver --settings=backend.settings.dev
Frontend Svelte server (port 8080):
$ cd frontend
$ npm run dev
- Use the buildpack negativetwelve/heroku-buildpack-subdir:
$ heroku buildpacks:set https://github.com/negativetwelve/heroku-buildpack-subdir
- This uses the
.buildpacks
definition in the app root