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