dbSQLite to PostgreSQL
Hello everyone, as you know django is using dbsqlte as default. However, as I understand we have to use postgresql in railway. However, I couldn't understand how to connect postgresql.
When I update my project on github all of the data is deleted. For example, I change only one html page on github. but all of the data of the users are deleted. How can I solve this problem? Thank you
52 Replies
Project ID:
118c0d3a-2e06-4eee-b22c-ab02d2947048
118c0d3a-2e06-4eee-b22c-ab02d2947048 this is my project ID
firstly, deploy a postgres database into your existing railway project
I uploaded
is there a table limit that I can create according to my plan
or is there a storage limit
nope, it's just a regular postgres database, the only limitations are the resources your plan allows for (cpu/mem/disk)
ok thank you for this
but is iti enough to change the variables in here to change database
I mean I am changning these variables in settings on github
but the site fails
please don't touch those
no I am not changing these varaibles
I change these settings on the source code/settings.py
is this exactly what your setting.py has?
https://github.com/railwayapp-starters/django/blob/main/mysite%2Fsettings.py#L81-L90
I mean I am changing these variables
yes, but will it be enough
it's one step needed, let me know when that's done
ok, I am doing this then write again
ok I changed with new variables
but now the site is failed
right, we aren't done yet
for all those environment variables you are using in your settings.py file, go into the apps service variables and use the auto complete drop-down to add them all to your service.
now I can not enter into my account
I didn't understand
sorry I enter
but now I didn't understand where to find app service varables
is it in there
the apps service would be the service you are deploying your code to
https://docs.railway.app/guides/variables#autocomplete-dropdown
do you mean when I write table names, I should see the my table in there?
no, I'm not talking about tables
^
then you are saying these variables
I mean I will add Session_cooki_secure to variable name and True to value part right?
no, please read my messages the docs page I linked
sorry as I understand I was opening the postgres variables, however I should add the variables in my service
that's correct
then I should add the variables in postgresql to service
use the auto complete please
please have a look at this docs section
sorry ı read the document
as I understand I need to add something to there
use the auto complete in the web service variables
I added 11 variables
there were 12 varaibles in postgres
did you use the auto complete?
yes I directly choose from
ı directly choose from there
okay perfect
but one variable is not there
add all needed variables
this was not in there
you only need to add the environment variables that are shown here
ok I added 11 variables
there 12 variables in postgre
and only ssl was not there
all of them added out of ssl
you seem to be skipping over nearly everything I'm saying, so I'm sorry but I can't continue to provide support as I'm just repeating myself at this point
ok sorry
I will carefully read what you are saying
As I understand you don't want me to add everything you want me to add only variables you sent me. Then I added only them
but my site is crashed now 😦