R
Railway10mo ago
Girish

Need help in running a python command periodically

New to development, I want help running a command in the project location using the railway cron scheduler.
35 Replies
Percy
Percy10mo ago
Project ID: N/A
Percy
Percy10mo ago
Project ID: N/A
Girish
Girish10mo ago
N/A
Brody
Brody10mo ago
what command do you want to run periodically?
Girish
Girish10mo ago
we discussed this before I guess Brody , i think it was you. I want to run this python manage.py send_maturity_emails. in the root folder of my project where i have my manage.py
Brody
Brody10mo ago
i didnt help you solve it already?
Girish
Girish10mo ago
The opther day you gave a few solutions , but i couldnt make it work yeah , do you know how i can navigate to the project folder in railway app
Brody
Brody10mo ago
why do you need to, railway will run that command from the root of your project
Girish
Girish10mo ago
yes but how ? I have one project , and i have only one command i can give under deploy
Brody
Brody10mo ago
screenshot of project please
Girish
Girish10mo ago
one sec
Girish
Girish10mo ago
No description
Brody
Brody10mo ago
you need another railway service that run the cron schedule and start command the block on the left is a service create another service in the same project
Girish
Girish10mo ago
and how do i connect that service to this project? as in this service when i create a new service and connec tmy repo,
Brody
Brody10mo ago
close the web popout, and click the + new button
Girish
Girish10mo ago
the new service is getting treated as my web app
Brody
Brody10mo ago
you haven't created a new service yet
Girish
Girish10mo ago
Oh Brody , sorry , what I meant was , I know to create an empty service and link my github repo
Brody
Brody10mo ago
okay so may I ask why you haven't done that yet?
Girish
Girish10mo ago
because , after i do that and give an over ride command in the new service, it is simply executing it but not where my project it did i make sense? i deally i want to run the command exactly where my web service is located , the same project folder
Brody
Brody10mo ago
this is how you create a new service in the same project
Girish
Girish10mo ago
ok let me try HI brody , should i give the command under build or deploy ?
Brody
Brody10mo ago
start command
Girish
Girish10mo ago
got it
Brody
Brody10mo ago
let's see a screenshot of your project now
Girish
Girish10mo ago
No description
Brody
Brody10mo ago
looks good but don't you need a database?
Girish
Girish10mo ago
i use sqlite
Brody
Brody10mo ago
then I take it you're the one I told to use a stand alone database like postgres those two services can't access the same sqlite database, your next step is move to postgres
Girish
Girish10mo ago
ahhhhhh thats what am loking for, they both cant use the same DB eh thats why my data is not reflecting when my mails are called thats wat i didnt understand last time i was thinking , ok postgress is just another db so let it be dbsqlit
Brody
Brody10mo ago
yep, use postgres so that both those services can connect to it
Girish
Girish10mo ago
ok i ll try implementing it now with this understanding so in my mails service do i have an option to connect to the postgress service ? *db
Brody
Brody10mo ago
okay first you need to deploy a postgres database
Girish
Girish10mo ago
in railway app ?
Brody
Brody10mo ago
yes
Want results from more Discord servers?
Add your server