I'm having trouble deploying a Django api
Decidí subir mi proyecto Django en railway, busque la documentacion y decía que tengo que :
1) descargar pip install gunicorn
2) crear el documento pip freeze > requirements
3) crear el documento procfile pip freeze > requirements
4)crear el documento runtime.txt
5) editar la variable ALLOWED_HOST = ['*'] en el archivo settings.py
6)En el archivo settings.py anexar unas variables para los archivos estaticos
7)Finally, we collect our static files in a folder using the following command
Python manage.py CollectStatic
8) mount it to Github
9) Create the database and give it the credentials
I already performed all the steps and reviewed the code about 10 times to see if I have any error without envargo in the first attempt I created the tables in the database automatically and managed to interact with it from my local environment but when I go to deploy the application I get some errors that I have tried to correct but persist
33 Replies
Project ID:
6d3dcd9d-6add-43f8-b239-970510362389
6d3dcd9d-6add-43f8-b239-970510362389
please send your Procfile
Also, check out https://github.com/railwayapp-templates/django
GitHub
GitHub - railwayapp-templates/django: 1-Click Django on Railway
1-Click Django on Railway. Contribute to railwayapp-templates/django development by creating an account on GitHub.
There is a railway.json file which will help you setup your start command which is better to use than a procfile
remember procfile is in capital P nd no extension as well
beat me to it
pardon!
what i mean. make sure the procfile file. has no extention. py,. txt etc
nd make sure the name start in capital as (Procfile)
and make sure inside the file after the (web: ) there is space b4 you add anything like gunicorn.(e. g web: gunicorn project_name. wsgi)
ok change the profile by the railway.json however it did not work
Okay I'm going to try
The Change Error
what does that mean
The error is no longer the same as before, change
let me see your procfile file. in file and in screen shot of the name of the file
use this as a nixpacks.toml file
haha I appreciate it, but not everything can be solved with a Procfile
ohk sir
Are you able to share your project repo? Maybe we can help a bit more with that
they was just missing the mysql driver
GitHub
GitHub - Felipe0206/Softseguroz
Contribute to Felipe0206/Softseguroz development by creating an account on GitHub.
did you try using the nixpacks.toml file I provided you?
I use it with the Procfile
or without the Procfile
Procfile stays
just add the file to your project folder
ok
ready I put the file nixpacks.toml however it persists
different error haha
honestly just switch to postgres lol, postgres uses much less memory
if I'm going to change database rather😅
imo, you should
vin agrees with me on that
Yes. Use Postgres! Especially on railway.
people already solve it, just do not put the dependency mysqlclient rather use PyMySQL
Thanks to everyone who helped me, they are the best
that works too