I'm looking for a hosting service to run my python scripts. My python scripts take info from various API's and put them into a Mongo database. I'd like to schedule them so that they run once an hour. Right now I'm running python 2.6 and using a couple of extra packages like facebook sdk and python twitter tools. I've been looking into heroku, but I'm new to the service and I'm having trouble finding documentation on heroku and python. The other service that I came across is MongoHQ, but I'm unsure as to how that works with Python. Do you know of a hosting service that would be compatible with all of these things?
EDIT
I took the advice below and explored DotCloud a bit. For anybody who's a newb like I am, I wrote a post on it on my blog (swootsblog.cloudfoundry.com) which I hope is pretty easy to follow along with. It's a continuously running python script writing to a MongoDB all set up on DotCloud.
Heroku doesn't run Python, they only run Ruby, Node.js, Clojure and Java.
There might be other services, but I've played around with DotCloud which has a python worker type for exactly this sort of work.
Heroku Does runs python scripts, I have previously done this with python to postgres database,
Pre-req
pythonscripts.py
procfile
requirements.txt
and After add, commit and push the scripts to heroku app. Just run the following command on terminal to run the scripts.
heroku run python your_scripts.py
More if you want to run this scripts on a schedule timing. then heroku provides lots of adds-on. just search it on heroku
If you need more help, make a chat with me.
Related
I'm a newbie and learning Heroku systems. I want to run this CMS on Heroku. I ran it many times on my machine and on others' servers. But I don't have servers all the time. I want to make it on Heroku for contestants.
As always I tried to follow the docs of this app. The requirements and setup part runs fine. But the database creation and other parts I couldn't cope up with. As a result, it shows an application error. The app also uses Postgres. But the commands given for ubuntu, I don't know how I can make them in Heroku.
If it sounds stupid question please pardon me. If I have to learn about something please give me some resources to learn.
Or It it is not possible to run this app with heroku, is there any SSH tunelling trick to just make the contestant part online with heroku Or is there any way to just tunnel my localhost to heroku web app domain? Thank You Very Much.
I'm building a website with React and Firebase that utilizes an algorithm I wrote in python. The database and authentication for the project are both handled by Firebase, so I would like to keep the cloud functions in that same ecosystem if possible.
Right now, I'm using the python-shell npm package to send and receive data from NodeJS to my python script.
I have local unit testing set up so I can test the https.onCall functions locally without needing to deploy and test from the client.
When I am testing locally, everything works perfectly.
However, when I push the functions to the cloud and trigger the function from the client, the logs in the Firebase console show that the python script is missing dependencies.
What is the best way to ensure that the script has all the dependencies available to it up on the server?
I have tried:
-Copying the actual dependency folders from my library/.../site-packages and putting them in the same directory under the /functions folder with the python script. This almost works. I just run into an issue with numpy: "No module named 'numpy.core._multiarray_umath'" is printed to the logs in Firebase.
I apologize if this is an obvious answer. I'm new to Python, and the solutions I've found online seem way to elaborate or involve hosting the python code in another ecosystem (like AWS or Heroku). I am especially hesitant to go to all that work because it runs fine locally. If I can just find a way to send the dependencies up with the script I'm good to go.
Please let me know if you need any more information.
the logs in the Firebase console show that the python script is missing dependencies.
That's because the nodejs runtime targeted by the Firebase CLI doesn't have everything you need to run python programs.
If you need to run a function that's primarily written in python, you should not use the Firebase CLI and instead uses the Google Cloud tools to target the python runtime, which should do everything you want. Yes, it might be extra work for you to learn new tools, and you will not be able to use the Firebase CLI, but it will be the right way to run python in Cloud Functions.
I have been writing a pretty simple python quizz system (called game.py) and I am working to deploy it on heroku. The app functions exclusively within the confines of a python console, with no interface of any kind but that provided by a terminal.
As such, I would like to be able to have the application on Heroku simply be akin to what you obtain with a one-off dyno, available on the dashboard (or in a terminal with the CLI) with:
heroku run python game.py
The application works perfectly well in it's deployed form (exclusively from the Heroku git) and locally, but in order for the app to be available to a larger public, I would need to have such a console appear on the "https://[appname].herokuapp.com/" URL that you are given on deployment of the app.
Naively, I would think this to be unspeakably simple to pull off, but I have yet to find a way to do it.
The only reasonable thing I have found would have been to create a Procfile, but lacking any documentation on the commands available, I only have been able to try variations of:
web: run python game.py
Which doesn't create a web console. And:
web: bash
Which simply crash with error code h10, with no other information given.
Any help, any suggestion, any workaround you can think of would be extremely appreciated.
First of all, thank you ahead of time for any help on this thread. I have been meaning to ask for help with this matter for a while now and thought it was about time I asked.
For the past 6 months I have been working for this company as the only developer (full stack developer). I am running the whole shebang here. Prior to this job I have been able to deploy webapps through UBUNTU on AWS with experience in Django, Nginx, Gunicorn and Angular. Nothing too advanced.
The problem is that for the past 6 months I have been testing and developing through a very tedious manner. I would write a little bit of code, I git add,git commit, git push, and then git pull on the server followed by manage.py collectstatic. At first I went with it but now I would like to test changes locally and I am not sure how to do that. The webapp is a Django, with AWS MySQL database.
From my personal experience, I was able to run and test my own apps just by a simple python manage.py runserver but that doesn't seem to be the case here.
I am creating a Python application that uses multiple third party libraries. Since the libraries are installed on my computer, the script runs fine. However, how can I alter my script so that it will run on any computer (all major OS), even if the computer does not have the third party Python libraries installed?
By your comment:
I want the script to stay a python script if at all possible so that
it can be run on any device and run through a webpage
It appears you want some way to host a python program online.
To do this, you need:
To know how to write Python that serves a website (see Django, Flask, CherryPy, etc...)
Some way to deploy said application to the web. An easy, free (<-- this is the keyword) way to deploy Python web apps is through using Heroku or some other free hosting site. Or you could always pay for hosting or host it yourself.