2 years ago
Hi,
I am attempting to move a Django website hosted locally and using sqlLite3 to using a railway postgresql database.
I have successfully connected it to the postgres database but unfortunately I cannot view any of my database items on the railway website as they do in tutorials. Why is this?
6 Replies
2 years ago
Its not showing up on my railway data area, yet I can use the app:
Please note, my old database I used locally had a LOT more items in it. Thus, I know that it is using the railway postgres server.
It also takes longer now since I have to connect to railway and I have a slow connection. Which also confirms that I am using the railway server.
Attachments
2 years ago
I think the tables are not created at all on the railway postgresql. As you know we use Django's "makemigrations" and "migrate" commands to create update the tables of a database.
You should prepare a docker entry point, something like this:
# docker-entrypoint.sh
#!/usr/bin/env bash
set -e
# Apply database migrations
echo "Applying database migrations..."
python manage.py migrate --noinput
# Collect static files
echo "Collecting static files..."
python manage.py collectstatic --noinput
# Initial data
echo "Loading initial database data..."
python manage.py loaddata somefixture
exec "$@"2 years ago
They said they can use the app so I assume migrations have been ran.
The data tab will only show tables from the default database name, but they could be using a different database name, so I would recommend using another database client like dbgate to manage the data.
2 years ago
I have run the django makemigrations and migrate.
It is even pulling the data through to my site
2 years ago
Your app might be using a different database name than the default name and thus the dashboard isn't showing you the tables for it.
Going to mark this as solved as the link project was deleted.
Status changed to Solved brody • over 1 year ago