R
Railway11mo 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
Percy11mo ago
Project ID: N/A
Percy
Percy11mo ago
Project ID: N/A
Girish
GirishOP11mo ago
N/A
Brody
Brody11mo ago
what command do you want to run periodically?
Girish
GirishOP11mo 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
Brody11mo ago
i didnt help you solve it already?
Girish
GirishOP11mo 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
Brody11mo ago
why do you need to, railway will run that command from the root of your project
Girish
GirishOP11mo ago
yes but how ? I have one project , and i have only one command i can give under deploy
Brody
Brody11mo ago
screenshot of project please
Girish
GirishOP11mo ago
one sec
Girish
GirishOP11mo ago
No description
Brody
Brody11mo 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
GirishOP11mo 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
Brody11mo ago
close the web popout, and click the + new button
Girish
GirishOP11mo ago
the new service is getting treated as my web app
Brody
Brody11mo ago
you haven't created a new service yet
Girish
GirishOP11mo ago
Oh Brody , sorry , what I meant was , I know to create an empty service and link my github repo
Brody
Brody11mo ago
okay so may I ask why you haven't done that yet?
Girish
GirishOP11mo 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
Brody11mo ago
this is how you create a new service in the same project
Girish
GirishOP11mo ago
ok let me try HI brody , should i give the command under build or deploy ?
Brody
Brody11mo ago
start command
Girish
GirishOP11mo ago
got it
Brody
Brody11mo ago
let's see a screenshot of your project now
Girish
GirishOP11mo ago
No description
Brody
Brody11mo ago
looks good but don't you need a database?
Girish
GirishOP11mo ago
i use sqlite
Brody
Brody11mo 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
GirishOP11mo 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
Brody11mo ago
yep, use postgres so that both those services can connect to it
Girish
GirishOP11mo 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
Brody11mo ago
okay first you need to deploy a postgres database
Girish
GirishOP11mo ago
in railway app ?
Brody
Brody11mo ago
yes
Want results from more Discord servers?
Add your server