Modify build command
How would I modify the build command so it does a pip install of
psycopg2
?
I was told to remove that package from my requirements.txt and only use it to connect to the postgres db in production.11 Replies
Project ID:
3b4c3c14-6b11-4e8a-8f52-bb11ff2f2554
3b4c3c14-6b11-4e8a-8f52-bb11ff2f2554
you put that package in your requirements.txt file and railway's default install command will install all the packages listed in that file
if this is something chatgpt told you, I would recommend stackoverflow instead
no i asked my former teacher and he said this:
"you do not want to use psycopg2 in development its doesn't play nice with an M1, and we only need to to connect to a postgres db, so by installing it separately in production only, we kind of protect ourselves from accidentally installing it in dev"
would you not need psycopg2 to connect to the railway database locally so you can run migrations and seed it?
i don't think so. he was specifically talking about the postgres instance
locally is sqlite
yes but you need to run migrations/seeds on the railway postgres instance too
i have to use the railway cli in order to do that
so ideally, build command would install requirements, install psycopg2 and do flask upgrade and seed
yes you do, but like I've said, that command is ran on your own computer, thus you need to be able to connect to postgres from your own computer
ideally you would do the migration and seed from your computer
also python apps don't really have a build command, you are thinking about nodejs
so i was able to deploy my project with database on render
i really wanted to try railway but it's just giving me too many issues rn
railway deploys your code as is
render has been known to do little monkeypatches to get code to run properly