aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views.py
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2013-10-13 10:07:51 +0200
committerCédric Bonhomme <kimble.mandel@gmail.com>2013-10-13 10:07:51 +0200
commitabec11e7ca0ce49081343bb2b2eb8520058d67a8 (patch)
tree9aeb6f19650c4d62a4b539ad0c1a9d1f83c6c843 /pyaggr3g470r/views.py
parentRemoved all .py files. (diff)
downloadnewspipe-abec11e7ca0ce49081343bb2b2eb8520058d67a8.tar.gz
newspipe-abec11e7ca0ce49081343bb2b2eb8520058d67a8.tar.bz2
newspipe-abec11e7ca0ce49081343bb2b2eb8520058d67a8.zip
Added new files. First prototype with the Flask micro-framework.
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r--pyaggr3g470r/views.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
new file mode 100644
index 00000000..98b1ccaa
--- /dev/null
+++ b/pyaggr3g470r/views.py
@@ -0,0 +1,39 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from flask import render_template, request, flash, session, url_for, redirect
+from wtforms import TextField, PasswordField, SubmitField, validators
+from flask.ext.mail import Message, Mail
+
+#from forms import ContactForm, SignupForm, SigninForm
+from pyaggr3g470r import app, db
+
+import feedgetter
+import models
+
+mail = Mail()
+
+@app.route('/')
+def home():
+ feeds = models.Feed.objects()
+ return render_template('home.html', feeds=feeds)
+
+@app.route('/fetch/', methods=['GET'])
+def fetch():
+ feed_getter = feedgetter.FeedGetter()
+ feed_getter.retrieve_feed()
+ return redirect(url_for('home'))
+
+@app.route('/about/', methods=['GET'])
+def about():
+ return render_template('about.html')
+
+@app.route('/feeds/', methods=['GET'])
+def feeds():
+ feeds = models.Feed.objects()
+ return render_template('feedss.html', feeds=feeds)
+
+@app.route('/feed/<feed_id>', methods=['GET'])
+def feed(feed_id=None):
+ feed = models.Watch.objects(id=feed_id).first()
+ return render_template('feed.html', feed=feed) \ No newline at end of file
bgstack15