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
Percy
Percy2y ago
Project ID: 6d3dcd9d-6add-43f8-b239-970510362389
Andres
AndresOP2y ago
6d3dcd9d-6add-43f8-b239-970510362389
Brody
Brody2y ago
please send your Procfile
Andres
AndresOP2y ago
MantisInABox
MantisInABox2y ago
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.
MantisInABox
MantisInABox2y ago
There is a railway.json file which will help you setup your start command which is better to use than a procfile
usman
usman2y ago
remember procfile is in capital P nd no extension as well
Brody
Brody2y ago
beat me to it
usman
usman2y ago
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)
Andres
AndresOP2y ago
ok change the profile by the railway.json however it did not work Okay I'm going to try The Change Error
Brody
Brody2y ago
what does that mean
Andres
AndresOP2y ago
The error is no longer the same as before, change
usman
usman2y ago
let me see your procfile file. in file and in screen shot of the name of the file
Brody
Brody2y ago
use this as a nixpacks.toml file
[phases.setup]
aptPkgs = ["...", "libmysqlclient-dev"]
[phases.setup]
aptPkgs = ["...", "libmysqlclient-dev"]
haha I appreciate it, but not everything can be solved with a Procfile
usman
usman2y ago
ohk sir
MantisInABox
MantisInABox2y ago
Are you able to share your project repo? Maybe we can help a bit more with that
Brody
Brody2y ago
they was just missing the mysql driver
Andres
AndresOP2y ago
GitHub
GitHub - Felipe0206/Softseguroz
Contribute to Felipe0206/Softseguroz development by creating an account on GitHub.
Brody
Brody2y ago
did you try using the nixpacks.toml file I provided you?
Andres
AndresOP2y ago
I use it with the Procfile or without the Procfile
Brody
Brody2y ago
Procfile stays just add the file to your project folder
Andres
AndresOP2y ago
ok
Andres
AndresOP2y ago
ready I put the file nixpacks.toml however it persists
Brody
Brody2y ago
different error haha
Andres
AndresOP2y ago
cryingman
Brody
Brody2y ago
honestly just switch to postgres lol, postgres uses much less memory
Andres
AndresOP2y ago
if I'm going to change database rather😅
Brody
Brody2y ago
imo, you should vin agrees with me on that
MantisInABox
MantisInABox2y ago
Yes. Use Postgres! Especially on railway.
Andres
AndresOP2y ago
people already solve it, just do not put the dependency mysqlclient rather use PyMySQL Thanks to everyone who helped me, they are the best
Brody
Brody2y ago
that works too
Want results from more Discord servers?
Add your server