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-491ff9c0a8d911 Replies
Project ID:
47a62a38-cd1d-46d0-815a-491ff9c0a8d9
was the command successful?
Yes, it created the user from the railway cli command but it doesn't recognize in deployed app
does the user appear in the same database your django app is using?
if i can't enter how can i check it ?
check with a database tool like pgadmin
it's not postgres db but the default django sqlite3 db
that explains it, railway doesnt have persistent storage, so you will want to use the postgre database railway provides as a plugin
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 ?
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
Ok got it. THX