Questions tagged [blueprint]

Blueprint is a CSS framework that comes with an easy-to-use grid, sensible typography, useful plugins, and a stylesheet for printing.

Blueprint is a CSS framework designed to reduce development time and ensure cross-browser compatibility when working with Cascading Style Sheets (CSS).

It also serves as a foundation for many tools designed to make CSS development easier and more accessible to beginners.

Blueprint is released under a modified version of the MIT License, making it free software. It can be either used as is, or further adapted for use via a compression tool that is written in Ruby.

359 questions
44
votes
7 answers

flask: error_handler for blueprints

Can error_handler be set for a blueprint? @blueprint.errorhandler(404) def page_not_found(error): return 'This page does not exist', 404 edit: https://github.com/mitsuhiko/flask/blob/18413ed1bf08261acf6d40f8ba65a98ae586bb29/flask/blueprints.py…
blueblank
  • 4,724
  • 9
  • 48
  • 73
20
votes
4 answers

How to pass arbitrary arguments to a flask blueprint?

I have a flask api which I have wrapped up in an object. Doing this has made unit testing a breeze, because I can instantiate the api with a variety of different settings depending on whether it is in production, test, or whatehaveyou. I am now…
melchoir55
  • 6,842
  • 7
  • 60
  • 106
18
votes
3 answers

Flask blueprint unit-testing

Is there a good practice to unit-test a flask blueprint? http://flask.pocoo.org/docs/testing/ I didn't found something that helped me or that is simple enough. // Edit Here are my code: # -*- coding: utf-8 -*- import sys import os import…
danbruegge
  • 2,104
  • 3
  • 20
  • 27
16
votes
1 answer

flask - blueprint - sqlalchemy - cannot import name 'db' into moles file

I'm new in bluprint, and have problem with importing db into mydatabase.py file which is models file. I've faced with this error: ImportError: cannot import name 'db' The tree of my project nikoofar/ run.py bookshelf/ __init__.py …
niloofar
  • 2,244
  • 5
  • 23
  • 44
16
votes
5 answers

Apache Camel Endpoint injection to direct route "No consumers available on endpoint"

I want to use Camel to take a message from ActiveMQ and then, based on the message contents (a protobuf), send one or more messages to Twitter. I've written a bean that is called from within a route and which uses injection to send multiple…
Jeremy Gooch
  • 939
  • 4
  • 16
  • 28
10
votes
1 answer

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 create_app function to create a flask app and return it to outside caller, so the caller can…
jeffrey
  • 238
  • 7
  • 15
10
votes
1 answer

How to load from more then one template_folder for Flask blueprint?

I learned how to create Flask Blueprints and can create blueprint for non flask products that uses Jinja2 templates and use them inside flask projects. I do something like this: # blueprint code from flask import Blueprint from pkg_resources import…
Mikhail Kashkin
  • 1,521
  • 14
  • 29
9
votes
1 answer

Log camel exchange body as string using log4j

I'm trying to log exchange body as a string using log4j. but it's not logging as string 15:09:05,403 | INFO | qtp938841692-57 |…
tvshajeer
  • 1,299
  • 2
  • 12
  • 26
9
votes
2 answers

Flask register_blueprint error (Python)

I have a project on Flask. And when I include Blueprint on my Flask app I have errors. The code is from a book, Miguel Grinberg about Flask. Project tree: . ├── app │   ├── __init__.py │   ├── main │   │   ├── errors.py │   │   ├── __init__.py │  …
8
votes
2 answers

Configure SQL datasource through properties in Camel Blueprint (within Karaf)

Given a very simple Camel bundle for Karaf, generated with the camel-archetype-blueprint, I want to add a datasource that is configured via properties and not within the blueprint.xml. I tried configuring a PropertiesComponent and accessing the…
maxdev
  • 2,491
  • 1
  • 25
  • 50
8
votes
2 answers

flask-login can not be used in Blueprint object?

I have a question regarding flask-login and blueprint. admin.py admin = Blueprint('admin', __name__) login_manager = LoginManager() login_manager.setup_app(admin) @login_manager.user_loader def load_user(userid): return…
user2331095
  • 6,577
  • 8
  • 36
  • 56
7
votes
2 answers

Flask Blueprint Initialization - Initializing some global variables

I'm new to Flask and I'm about to write a larger application. So far I'v divided functionality into blueprints. Now I want to be able to set some global variable from within a blueprint during initialization of it (so outside of a request context).…
j 34
  • 73
  • 1
  • 1
  • 3
7
votes
3 answers

How can i both register blueprint and add that app to flask-admin

my Code: __init__.py from flask import Flask from flask_admin import Admin from flask_admin.contrib.sqla import ModelView from flask.ext.sqlalchemy import SQLAlchemy app = Flask(__name__) app.config.from_object('config') db = SQLAlchemy(app) from…
Chan
  • 117
  • 2
  • 6
7
votes
1 answer

flask blueprints list routes

I have a flask app with the below tree: root/ - modules/ __init__.py - common/ __init__.py - citrixlb/ __init__.py # blueprint code citrixlb.py # module class - aws/ __init__.py # blueprint code …
Simply Seth
  • 3,246
  • 17
  • 51
  • 77
7
votes
2 answers

UndefinedError: 'current_user' is undefined

I have a app with flask which works before But Now I use Blueprint in it and try to run it but got the error so i wonder that is the problem Blueprint that g.user Not working? and how can I fix it Thnx :) app/layout/__ init __.py : from flask…
Linda
  • 551
  • 2
  • 7
  • 16
1
2 3
23 24