Django deployment Failed in build stage.

Django deployment field in build stage. The build longs are not having any info i can use. I had deployed another app testing the platform and it worked well but this time round its not working
40 Replies
Percy
Percy2y ago
Project ID: N/A
Dennis musembi
Dennis musembiOP2y ago
002662c
Brody
Brody2y ago
I assume your django app is inside of /welearn? also this isn't a project id
Dennis musembi
Dennis musembiOP2y ago
yes
Brody
Brody2y ago
in the service settings, set that folder as your root directory
Dennis musembi
Dennis musembiOP2y ago
thanks it deployed successfully but when I try to access the site am getting Internal Server Error.
Brody
Brody2y ago
what status code, and are there any errors in the logs?
Dennis musembi
Dennis musembiOP2y ago
no status code. just Internal Server Error. I am using Postgres and have not connected it here. can that be the problem. Also, the env variables in the file is not uploaded in GitHub. In build logs no any errors i can sport.
Dennis musembi
Dennis musembiOP2y ago
Brody
Brody2y ago
every http request has a status code and yes if django was not able to connect to the database stuff wont work here is a railway provided django template for you to reference https://github.com/railwayapp-templates/django
Dennis musembi
Dennis musembiOP2y ago
Brody
Brody2y ago
^ ^
Dennis musembi
Dennis musembiOP2y ago
I used the same template. Everything is as in the setting.py file. How do I set the variables here and the Postgres database
Brody
Brody2y ago
awsome setup the variable references in your service https://docs.railway.app/develop/variables#reference-variables
Dennis musembi
Dennis musembiOP2y ago
done move all the variables from my .env file using the raw editor and saved. redeploying now. How can I connect the Postgres database here.
Brody
Brody2y ago
show me a screenshot of your service variables please
Dennis musembi
Dennis musembiOP2y ago
now am getting this error. Server Error (500)
Brody
Brody2y ago
^ bruh why would you show me the values delete all your current PG*** variables do you have a postgre database added to your project?
Dennis musembi
Dennis musembiOP2y ago
yes i have it
Brody
Brody2y ago
^
Dennis musembi
Dennis musembiOP2y ago
in my backed, i have connected Postgre but i have not connected it with railway Postgre server
Brody
Brody2y ago
please just do as i say, im only trying to help and you are making things difficult
Dennis musembi
Dennis musembiOP2y ago
the variables i have already deleted. just explaining the stage i am currectly
Brody
Brody2y ago
show me a screenshot of your entire browser window, open to the railway project please
Dennis musembi
Dennis musembiOP2y ago
Brody
Brody2y ago
where is your database?
Dennis musembi
Dennis musembiOP2y ago
Brody
Brody2y ago
your database should be in the same project of the service that needs access to it, delete that database, and add a new database into the project that has your django service, of course if you need the data from that database you will need to use pg_dump and pg_restore let me know when you have done this so we can move on to the next step
Dennis musembi
Dennis musembiOP2y ago
Brody
Brody2y ago
awsome now setup the variable references in your service https://docs.railway.app/develop/variables#reference-variables and show me a screenshot of that once done
Dennis musembi
Dennis musembiOP2y ago
Brody
Brody2y ago
show me your DATABASES section of your settings.py file please (screenshot)
Dennis musembi
Dennis musembiOP2y ago
Brody
Brody2y ago
okay that looks good are you still having errors?
Dennis musembi
Dennis musembiOP2y ago
yes. Internal Server Error
Brody
Brody2y ago
what's your start command and do you have a repo for your code I could look at? maybe I will be able to see something obviously wrong
Dennis musembi
Dennis musembiOP2y ago
I have not set any I can make the repo public and share link with you
Brody
Brody2y ago
yes please do
Dennis musembi
Dennis musembiOP2y ago
you are right something is not working as it should. When I set DEBUG = True it works just fine. But when it's False for deployment I get Internal Server Error
Brody
Brody2y ago
?
Want results from more Discord servers?
Add your server