Questions tagged [flask-extensions]

Flask extensions are pluggable helper libraries/packages, which add commonly used web application functionalities to a Flask application. Use this tag for questions regarding such Flask extensions, both existing ones, and for implementing your own.

From Flask Docs:

Flask extensions extend the functionality of Flask in various different ways. For instance they add support for databases and other common tasks.

The official Extension registry, is a moderated, and regularly updated.

Official Guide to Extension development.

91 questions
132
votes
14 answers

How to stop flask application without using ctrl-c

I want to implement a command which can stop flask application by using flask-script. I have searched the solution for a while. Because the framework doesn't provide "app.stop()" API, I am curious about how to code this. I am working on Ubuntu 12.10…
vic
  • 1,445
  • 2
  • 11
  • 8
20
votes
3 answers

How to track the current user in flask-login?

I m trying to use the current user in my view from flask-login. So i tried to g object I m assigning flask.ext.login.current_user to g object @pot.before_request def load_users(): g.user = current_user.username It works if the user is correct.…
naga4ce
  • 1,327
  • 3
  • 14
  • 21
18
votes
3 answers

How to use Flask-Security register view?

Has anyone used Flask-Security extension for authentication? How do I get register view to work? http://packages.python.org/Flask-Security/customizing.html I am referring to link above. @app.route('/register', methods=['GET']) def register(): …
Chirdeep Tomar
  • 3,513
  • 5
  • 29
  • 60
16
votes
2 answers

What's the point of the "is_authenticated" method used in Flask-Login?

I'm working through the Flask Mega-Tutorial right now and I've come across this bit of code: class User(db.Model): id = db.Column(db.Integer, primary_key = True) nickname = db.Column(db.String(64), unique = True) email =…
user1787531
  • 609
  • 2
  • 9
  • 21
16
votes
2 answers

Flask-Login - How to get Session ID

Am doing a project with Flask, Gevent and web socket using flask development server environment. I used flask_login. Here how can get i get the Unique Session ID for each connection? I want to store the SessionID in the Database and delete it once…
14
votes
1 answer

How to disable Flask-Cache caching

I meet a problem while using Flask-Cache. I need to make caching on need basis, by defining a configuration variable which user can set for enable or disable caching. I'm using Flask-Cache for caching purposes, as cache = Cache(config={'CACHE_TYPE':…
a.m.
  • 1,757
  • 1
  • 13
  • 21
13
votes
2 answers

ImportError: cannot import name 'urlencode' when trying to install flask.ext.storage

I am working with Python 3.5.1 / Window 8.1 >>pip install -e git://github.com/kvesteri/flask-storage.git#egg=Flask-Storage This is the outcome: Obtaining Flask-Storage from git+git://github.com/kvesteri/flask-storage.git#egg=Flask-Storage Updating…
Rodolfo Alvarez
  • 892
  • 1
  • 9
  • 17
13
votes
4 answers

Unable to create models on Flask-admin

I'm creating a simple blog on Flask and I'm trying to implement Flask-Admin to manage my posts. If I go to the admin area I can see a list of all my post from the DB but when I try to create a new one I got the next error: Failed to create model.…
nahl
  • 237
  • 1
  • 3
  • 10
12
votes
4 answers

How to make eclipse/pydev happy to see flask extensions on windows?

I stumbled upon this article and followed all steps. But pyDev won't see my flask extensions and that's really annoying. There's only one thing (and I think this is the key): Touch /site-packages/flaskext/__init__.py Touch is a unix util I think. Is…
floqqi
  • 1,067
  • 2
  • 9
  • 19
11
votes
4 answers

flask-admin not showing foreignkey columns

class Parent(db.Model): id = db.Column(db.Integer, primary_key = True) name = db.Column(db.String(120)) def __repr_(self): return '' % (self.name) admin.add_view(ModelView(Parent, db.session)) class…
11
votes
2 answers

how to access form data using flask?

My login endpoint looks like @app.route('/login/', methods=['GET', 'POST']) def login(): if request.method == 'POST': print request.form # debug line, see data printed below user = User.get(request.form['uuid']) if user…
daydreamer
  • 73,989
  • 165
  • 410
  • 667
9
votes
1 answer

What does `key_prefix` do for flask-cache?

For example like this, is it necessary to use key_prefix? @cache.cached(timeout=50, key_prefix='all_comments') def get_all_comments(): comments = do_serious_dbio() return [x.author for x in comments] cached_comments = get_all_comments() In…
Hanfei Sun
  • 39,245
  • 33
  • 107
  • 208
6
votes
1 answer

Passing web request context transparently to a celery task

I've a multi-tenant setup where I'd like to pass certain customer specific information, specifically request.host to the celery task, where ideally it should be available in a global variable. Is there a way to set this up, in a manner transparent…
vrtx54234
  • 1,740
  • 3
  • 24
  • 38
6
votes
1 answer

python group/user management packages

I was looking for python user/group management package.(Creation of user group and adding/removing members to that group) I found flask_dashed. https://github.com/jeanphix/Flask-Dashed/ It more or less what I was looking for. But It…
webminal.org
  • 37,814
  • 34
  • 84
  • 122
6
votes
1 answer

Explanation of the token-based password-reset functionality in Flask-Security

Can someone walk me through what's happening in flask-security's password reset token? The code is here on github: https://github.com/mattupstate/flask-security/blob/develop/flask_security/recoverable.py (There may be other parts up a…
Mittenchops
  • 15,641
  • 28
  • 103
  • 200
1
2 3 4 5 6 7