I followed a nice FLY-SQLite tutorial alongside a good Svelte-Django tutorial but still can’t login, even though the user and password are the same that I use for local access. I think the SQLite database from my local machine is not syncing with the remote volume that’s attached to my app. Any suggestions on troubleshooting? I’m using dj_database_url, and have my DATABASE_URL secret set through fly secrets set DATABASE_URL=sqlite:///db.sqlite3 It doesn’t seem as if I am doing this correctly. I’ve tried and retried and gone around in circles. I’m using a .env file but it only contains DEBUG=True I think my myapp/settings.py is messed up around the DATABASES part:
Hi… It looks like you might perhaps have misread this piece of the tutorial (understandable!). The one there is instead sqlite:////data/db.sqlite3, with four slashes immediately after the colon and then the (crucial) data/ step in the path.
(That latter should correspond to destination under [mounts] in your fly.toml file.)
In general, the Fly.io platform doesn’t synch volumes. You’re expected to instead either start over from scratch in production (typical) or, more rarely, manually upload your initial database via SFTP.
Aside: I understand what that other tutorial is saying about the complexity of multiple machines, but having just a single one really is not recommended on Fly, . In particular, this database could be lost in its entirety, unless you watch things very assiduously…
You’re good here, although admittedly that’s not obvious…
(The fact that /data appears in the final column is the main thing. That means that it’s a separate, distinguished part of the overall filesystem tree—which is exactly what a persistent volume is supposed to be!)
Great, thanks for pointing that out. (I was focussing on the left column ) One last thing, in the manual upload instructions, you wrote server.db. which is probably one of these:
root@7811ed9f5e4378:/data# ls
db.sqlite3 db.sqlite3-shm db.sqlite3-wal lost+found
root@7811ed9f5e4378:/data#
and I would move that to old.db and then go into /tmp and move the one that I uploaded …
But I’m not going to do that since thanks to you I learned that I could create the superuser directly on the production database. Thanks once again!