Category "flask"

Blueprint and factory pattern work together?

I am working on a restful service using flask-restful, and I want to leverage both factory pattern and blueprint in my project. in app/__init__.py I have a crea

Redirect to another page in blueprints

Im looking for a way to redirect to another page while using flask blueprints from flask import Blueprint, request, render_template, redirect, url_for import j

Dynamically generate Flask routes

I am trying to dynamically generate routes in Flask from a list. I want to dynamically generate view functions and endpoints and add them with add_url_rule. T

How to wire up migrations in Flask with declarative base?

I'm using the declarative Base in flask_sqlalchemy. In my database.py file I have the following: from sqlalchemy import create_engine # from sqlalchemy.orm imp

Using <input> inside for loop in jinja flask

I am struggling to figure out how to access individual <input> elements, that have been created through a for loop. For example: <form id="score" metho

Changing the active class of a link with the twitter bootstrap css in python/flask

I got the following html snippet from my page template.html. <ul class='nav'> <li class="active"><a href='/'>Home</a></li>

AssertionError: View function mapping is overwriting an existing endpoint function: main

Does anyone know why I can't overwrite an existing endpoint function if i have two url rules like this app.add_url_rule('/', view_func=Main.as

Insert a document with Flask-PyMongo

I have a MongoDB database and I want to use Flask-PyMongo to work with it in my Flask app. How do I add a database and a collection so I can add user documents

flask just refresh templated portion of page

I have a simple flask app that uses templates. Every time I click somewhere on the navigation (in the base.html) it refreshes the entire page, I'd rather it j