Django create superuser not works in production

Hi, i linked my folder to the project via railway cli and created a superuser via railway run python manage.py createsuperuser but after the railway up to redeploy the project it doesn't recognize my created username in admin panel. projectid: 47a62a38-cd1d-46d0-815a-491ff9c0a8d9
11 Replies
Percy
Percy2y ago
Project ID: 47a62a38-cd1d-46d0-815a-491ff9c0a8d9
Brody
Brody2y ago
was the command successful?
caeresoul
caeresoul2y ago
Yes, it created the user from the railway cli command but it doesn't recognize in deployed app
Brody
Brody2y ago
does the user appear in the same database your django app is using?
caeresoul
caeresoul2y ago
if i can't enter how can i check it ?
Brody
Brody2y ago
check with a database tool like pgadmin
caeresoul
caeresoul2y ago
it's not postgres db but the default django sqlite3 db
Brody
Brody2y ago
that explains it, railway doesnt have persistent storage, so you will want to use the postgre database railway provides as a plugin
caeresoul
caeresoul2y ago
Ok, this is a project i made following mozilla guidelines (https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Tutorial_local_library_website) to learn Django. So i have to switch to a postgres db, i'll try, thanks. I think it uses the default db cause it manages json files easily compared to postgres ?
Brody
Brody2y ago
sqlite isnt any better with json than postgres, the tutorial uses sqlite because having a single file as a database is easier for local development as opposed to setting up a postgres server locally
caeresoul
caeresoul2y ago
Ok got it. THX
Want results from more Discord servers?
Add your server