createsuperuser with sqlite

I have a low priority django app that just uses a sqlite db instead of postgres so I have a volume attached to my service for it. Locally I have linked the service, but when I try and run railway run python manage.py createsuperuser I get errors. django.db.utils.OperationalError: unable to open database file Far as I can tell there is no way to run anything directly on the service, which really sucks because that seems to be why this isn't working.
Solution:
some kind of logic that creates a superuser from environment variables if a superuser account doesnt already exist
Jump to solution
14 Replies
Percy
Percy8mo ago
Project ID: 2299c72c-3f0b-4b23-9a78-e606aad6bd60
ketzlquatl
ketzlquatlOP8mo ago
2299c72c-3f0b-4b23-9a78-e606aad6bd60
Brody
Brody8mo ago
Far as I can tell there is no way to run anything directly on the service, which really sucks because that seems to be why this isn't working.
Correct, thats why its always best to go with postgres
ketzlquatl
ketzlquatlOP8mo ago
I have no need for a full on database though and don't really want to pay for one when all I need is sqlite.
Brody
Brody8mo ago
then your app would need to be able to create its own superuser account
Solution
Brody
Brody8mo ago
some kind of logic that creates a superuser from environment variables if a superuser account doesnt already exist
ketzlquatl
ketzlquatlOP8mo ago
Ahhhh yeah I’ve done that once before… Forgot about that. Thanks Hey while you’re here… The $5 plan specifies it comes with $5 of usage, does the $20 plan come with $20 of usage or $5?
Brody
Brody8mo ago
it doesn't come with any usage 😬
ketzlquatl
ketzlquatlOP8mo ago
It says all hobby plan features though and hobby plan says $5 included…
Brody
Brody8mo ago
yeah it's a bit misleading depending on how you interpret that sentence
ketzlquatl
ketzlquatlOP8mo ago
Yeah seems like a pretty big gray area there… Might want to reword it or specify it somehow for legalese purposes..
Brody
Brody8mo ago
personally I don't regard credits as a feature but yeah definitely could be worded better
ketzlquatl
ketzlquatlOP8mo ago
I found a comment on this thread https://help.railway.app/feedback/allow-ssh-access-to-containers-via-cli-e4985f6f that say that ability to connect directly to the containers is planned, any idea when it might come about? You're in on that thread too 😮
Railway Help Station
Allow SSH access to containers via CLI
I have a project that works in my local environment but not once pushed to Railway. If I could login to the container like I can locally, I could determine what the differences are that are causing the problem. Add a function like the "connect" command in the CLI to connect to the actual container.
Brody
Brody8mo ago
no ETA sorry
Want results from more Discord servers?
Add your server