def index(): blogs_sent = dbHandler.getAll() if 'username' in session: return render_template("index.html", logged_in=True, username=session['username'], blogs=blogs_sent) else: return render_template("index.html", logged_in=False, username=None, blogs=blogs_sent)
def login(): blogs_sent = dbHandler.getAll() if 'username' in session: return render_template("admin.html", logged_in=True, username=session["username"], blogs=blogs_sent) elif request.method == 'POST': if dbHandler.authenticate(request): session['username'] = request.form['username'] return render_template("index.html", logged_in=True, username=session["username"], blogs=blogs_sent) else: return render_template("login.html", logged_in=False, username=None) return render_template('login.html', logged_in=False, username=None, blogs=blogs_sent)
def home(request): content = models.getAll() return render_to_response('index.html', {'content': content})
def showall(): msg = dbHandler.getAll() return render_template('abc.html', user=msg)