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
Percy
Percy10mo ago
Project ID: 118c0d3a-2e06-4eee-b22c-ab02d2947048
aydin26532
aydin26532OP10mo ago
118c0d3a-2e06-4eee-b22c-ab02d2947048 this is my project ID
Brody
Brody10mo ago
firstly, deploy a postgres database into your existing railway project
aydin26532
aydin26532OP10mo ago
No description
aydin26532
aydin26532OP10mo ago
I uploaded is there a table limit that I can create according to my plan or is there a storage limit
Brody
Brody10mo ago
nope, it's just a regular postgres database, the only limitations are the resources your plan allows for (cpu/mem/disk)
aydin26532
aydin26532OP10mo ago
ok thank you for this but is iti enough to change the variables in here to change database
aydin26532
aydin26532OP10mo ago
No description
aydin26532
aydin26532OP10mo ago
I mean I am changning these variables in settings on github but the site fails
Brody
Brody10mo ago
please don't touch those
aydin26532
aydin26532OP10mo ago
no I am not changing these varaibles I change these settings on the source code/settings.py
aydin26532
aydin26532OP10mo ago
No description
aydin26532
aydin26532OP10mo ago
I mean I am changing these variables yes, but will it be enough
Brody
Brody10mo ago
it's one step needed, let me know when that's done
aydin26532
aydin26532OP10mo ago
ok, I am doing this then write again ok I changed with new variables but now the site is failed
Brody
Brody10mo ago
right, we aren't done yet
aydin26532
aydin26532OP10mo ago
No description
Brody
Brody10mo ago
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.
aydin26532
aydin26532OP10mo ago
No description
aydin26532
aydin26532OP10mo ago
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
aydin26532
aydin26532OP10mo ago
No description
aydin26532
aydin26532OP10mo ago
is it in there
Brody
Brody10mo ago
the apps service would be the service you are deploying your code to https://docs.railway.app/guides/variables#autocomplete-dropdown
aydin26532
aydin26532OP10mo ago
do you mean when I write table names, I should see the my table in there?
Brody
Brody10mo ago
no, I'm not talking about tables ^
aydin26532
aydin26532OP10mo ago
No description
aydin26532
aydin26532OP10mo ago
then you are saying these variables I mean I will add Session_cooki_secure to variable name and True to value part right?
Brody
Brody10mo ago
no, please read my messages the docs page I linked
aydin26532
aydin26532OP10mo ago
sorry as I understand I was opening the postgres variables, however I should add the variables in my service
Brody
Brody10mo ago
that's correct
aydin26532
aydin26532OP10mo ago
then I should add the variables in postgresql to service
Brody
Brody10mo ago
use the auto complete please please have a look at this docs section
aydin26532
aydin26532OP10mo ago
sorry ı read the document as I understand I need to add something to there
aydin26532
aydin26532OP10mo ago
No description
aydin26532
aydin26532OP10mo ago
No description
Brody
Brody10mo ago
use the auto complete in the web service variables
aydin26532
aydin26532OP10mo ago
I added 11 variables there were 12 varaibles in postgres
Brody
Brody10mo ago
did you use the auto complete?
aydin26532
aydin26532OP10mo ago
yes I directly choose from
No description
aydin26532
aydin26532OP10mo ago
ı directly choose from there
Brody
Brody10mo ago
okay perfect
aydin26532
aydin26532OP10mo ago
but one variable is not there
Brody
Brody10mo ago
add all needed variables
aydin26532
aydin26532OP10mo ago
No description
aydin26532
aydin26532OP10mo ago
this was not in there
Brody
Brody10mo ago
you only need to add the environment variables that are shown here
aydin26532
aydin26532OP10mo ago
ok I added 11 variables there 12 variables in postgre and only ssl was not there all of them added out of ssl
Brody
Brody10mo ago
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
aydin26532
aydin26532OP10mo ago
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
aydin26532
aydin26532OP10mo ago
No description
aydin26532
aydin26532OP10mo ago
but my site is crashed now 😦
Want results from more Discord servers?
Add your server