Comments (6)
Ah, okay. I thought you had it running on your local machine and were trying to enable external access. Being on a VPS already should make this easier.
That server that launches on 127.0.0.1:5000 is only meant for local development. It's not the recommended way to deploy an app like this.
I'd suggest looking into http://gunicorn.org/. You'll run a command like gunicorn hnrss:app
which'll load the app and listen on 127.0.0.1:8000. Then you'll configure Apache to pass incoming requests from the outside world to 127.0.0.1:8000.
There are more moving pieces with this method, but it'll be pretty robust. Plus it's the standard way of launching Python web apps so there are a ton of online docs to help you out.
An alternative, not recommended way is to change the line to something like app.run(host='0.0.0.0', port=5000, debug=False)
which'll make the local development server listen on all available IP addresses. You'll then be able to connect via http://:5000/newest.
Definitely read the docs on this to make sure you understand why it isn't recommended for production use, though. But it can be useful as its a simpler setup than the gunicorn option.
Good luck!
from hnrss.
Hi Sascha — I'd recommend you buy a cheap VPS plan from a provider like DigitalOcean, Rackspace, Linode, etc. and host your local copy of hnrss there. With enough time and energy you might be able to host it on your local machine in a way that external services can find it, but it'll be a real hassle to get there.
Running it on a VPS won't be much different than how you're running it now, it'll just be much easier for the "outside world" to access it.
Hope this helps!
from hnrss.
Thanks for your answer,
I've already a VPS running, with apache and some other services working fine.
I am just wondering, which is the best way to get your python implementation running.
I found sites, describing how to integrate python executed as CGI scripts into apache. I think this would allow your scripts to be run by external requests.
But on the other hand: Your implementation is launching its own web server running on 127.0.0.1:5000. So why integrate it into apache?
Isn't the easiest way mapping the internal server on 127.0.0.1:5000 to some external port?
As described above, an IPTables entry didn't work.
Maybe I missed something. Therefore my question here...
If you can't help - thanks anyway!
from hnrss.
Many thanks this great explanation, it sounds really promising! I'll have a try with it,
from hnrss.
Again, many thanks!
During the last about 90 minutes I was able to install Gunicorn, configure apache to pass request to your Python application "hnrss" and habe it run automatically on boot.
Finally a nice way to integrate Hacker News into News Aggregetors (in my case Flipboard mobile app).
Perfect!
from hnrss.
Awesome! Glad to hear everything worked out.
from hnrss.
Related Issues (20)
- Rate Limit very aggressive HOT 2
- using 'count' with Search Parameter not working HOT 1
- Am I rate-limited or blocked? HOT 1
- Count param not working with user's favorite stories HOT 2
- Rate limit? HOT 1
- Frontpage Feed Isn't Updating HOT 7
- Have HnRSS.org link to discussion instead of post link HOT 1
- Can I donate to you regularly on patreon? HOT 4
- Expose /highlights feed
- Feature request: only include one URL in description
- Favourites endpoint is not returning results HOT 2
- [Feature Requuest] Domain Name HOT 1
- Number of comments flat doesn't always work
- Every pubDate is now set to now() HOT 3
- The best feed is empty HOT 7
- Frontpage feed is not updating HOT 1
- Fetching replies to stories/submissions (top-level)
- Feature request /shownew feed
- /bestcomments has no feed items
- Favorites feed does not return anything HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hnrss.