Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #34501 > unrolled thread

Running a Python app on a remote server and displaying the output files

Started byJason Hsu <jhsu802701@gmail.com>
First post2012-12-08 12:22 -0800
Last post2012-12-09 08:27 -0800
Articles 3 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  Running a Python app on a remote server and displaying the output files Jason Hsu <jhsu802701@gmail.com> - 2012-12-08 12:22 -0800
    Re: Running a Python app on a remote server and displaying the output files Chris Angelico <rosuav@gmail.com> - 2012-12-09 11:38 +1100
    Re: Running a Python app on a remote server and displaying the output files Miki Tebeka <miki.tebeka@gmail.com> - 2012-12-09 08:27 -0800

#34501 — Running a Python app on a remote server and displaying the output files

FromJason Hsu <jhsu802701@gmail.com>
Date2012-12-08 12:22 -0800
SubjectRunning a Python app on a remote server and displaying the output files
Message-ID<b2f59c32-e503-46ae-8605-0cb916dd8c04@googlegroups.com>
I have a Python 2.7 script at https://github.com/jhsu802701/dopplervalueinvesting . When I run the screen.py script locally, the end result is a new screen-output sub-directory (within the root directory) and a results.csv file within it.

What I'm trying to do is put this script on a remote server, run this screen.py script every night, and make the results.csv file publicly readable.

I've tried to do this on Google App Engine, but I can't get it to work. The Google App Engine tutorial revolves around trying to dynamically create a web site, and I haven't been able to figure out how to make anything other than an index.html file in the root directory work. HOW DO I MAKE OTHER FILES PUBLICLY READABLE?

Is Google App Engine the way to go, or am I barking up the wrong tree? I understand that another route is using WebFaction, a web hosting provider that offers a whole Linux system. (Running my app on my current web host, MDDHosting, is not an option because lxml is not available without a much more costly VPS.)

In summary, my questions are: 
1. How do I run my Python script in Google App Engine and make the output results.csv file publicly available? 
2. If Google App Engine isn't the solution for me, should I use WebFaction? (I already tried Heroku, and it didn't work for me.) 
3. What are my other options?

I'm willing to pay for a solution, but only if I get web hosting as well. (I'm not willing to pay for MDDHosting for my dopplervalueinvesting.com web site AND another host for running my script.)

[toc] | [next] | [standalone]


#34511

FromChris Angelico <rosuav@gmail.com>
Date2012-12-09 11:38 +1100
Message-ID<mailman.637.1355013509.29569.python-list@python.org>
In reply to#34501
On Sun, Dec 9, 2012 at 7:22 AM, Jason Hsu <jhsu802701@gmail.com> wrote:
> I have a Python 2.7 script at https://github.com/jhsu802701/dopplervalueinvesting . When I run the screen.py script locally, the end result is a new screen-output sub-directory (within the root directory) and a results.csv file within it.
>
> What I'm trying to do is put this script on a remote server, run this screen.py script every night, and make the results.csv file publicly readable.

Sounds like a cron job and a web server.

> I've tried to do this on Google App Engine, but I can't get it to work. The Google App Engine tutorial revolves around trying to dynamically create a web site, and I haven't been able to figure out how to make anything other than an index.html file in the root directory work. HOW DO I MAKE OTHER FILES PUBLICLY READABLE?

I don't know Google App Engine, but the normal way to do these things
is to simply drop a file into your web server's designated root - for
instance, /var/www/results.csv would be accessible as
http://yourserver/results.csv - just put it next to index.html. But
you may need to configure it, if it's set to a more secure default
setup that allows only html files.

> 1. How do I run my Python script in Google App Engine and make the output results.csv file publicly available?
> 2. If Google App Engine isn't the solution for me, should I use WebFaction? (I already tried Heroku, and it didn't work for me.)
> 3. What are my other options?
>
> I'm willing to pay for a solution, but only if I get web hosting as well. (I'm not willing to pay for MDDHosting for my dopplervalueinvesting.com web site AND another host for running my script.)

Here's a possible solution for you. Make your screen.py web-accessible
(maybe with a password or IP address check, if you don't want it
public) as your means of regenerating the file, and create another one
that returns it. You can then have a cron job on any other computer in
the world - your own home box, for instance - that runs:

wget http://yourserver/screen.py

You can store the csv file as an actual file, or in a database, or
whatever's convenient. You just need the other script to be able to
find it.

ChrisA

[toc] | [prev] | [next] | [standalone]


#34523

FromMiki Tebeka <miki.tebeka@gmail.com>
Date2012-12-09 08:27 -0800
Message-ID<64eff182-70ab-4934-a805-24eb7890fffb@googlegroups.com>
In reply to#34501
On Saturday, December 8, 2012 12:22:35 PM UTC-8, Jason Hsu wrote:
> 1. How do I run my Python script in Google App Engine and make the output results.csv file publicly available? 
Probably https://developers.google.com/appengine/docs/python/blobstore/, however https://developers.google.com/appengine/docs/python/gettingstarted/staticfiles might work as well.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web