cburmeister / flask-bones Goto Github PK
View Code? Open in Web Editor NEWAn example of a large scale Flask application using blueprints and extensions.
Home Page: http://flask-bones.herokuapp.com/
License: MIT License
An example of a large scale Flask application using blueprints and extensions.
Home Page: http://flask-bones.herokuapp.com/
License: MIT License
User creation timestamp should probably be calculated on the db server rather than the app server:
http://stackoverflow.com/a/33532154/770425
Since you're using Postgres, this is fairly trivial--see example code in SO answer above.
https://github.com/cburmeister/flask-bones/blob/master/app/user/models.py#L17-L24
Fairly sure some of this doesn't need to happen based on
http://docs.sqlalchemy.org/en/latest/orm/constructors.html
http://stackoverflow.com/questions/13384996/how-do-i-set-attribute-default-values-in-sqlalchemy-declarative
In particular, Flask-SQLAlchemy has seen quite a few changes since 1.0... any particular reason it's pinned to such an old version?
Be nice to swap from using a custom factory to using FactoryBoy for generating fake data for tests/dev. A lot more powerful, and integrates cleanly with faker
& sqlalchemy
.
Flask blueprints have a number of template conflict issues. The suggested solution by most people is to add an additional folder to the templates path.
example:
user/templates/add.html --> user/templates/user/add.html
Details:
http://stackoverflow.com/questions/7974771/flask-blueprint-template-folder/8198325
Note also the jinja2
caching issue mentioned here:
http://stackoverflow.com/a/11145483/770425
Using Flask-DebugToolbar adds a number of helpful things, including timing pageloads (without having to manually code it) and viewing SQLAlchemy queries.
Hi
I'm using this scaffold to build my project. When I add user_access func to record user access time. but seem to it 's invalid . What is the problem?
thank you
auth/view.py
from flask_login import (current_user, login_required, user_accessed,
logout_user, UserMixin, AnonymousUserMixin,
confirm_login, login_user)
...
@user_accessed.connect_via(auth)
def when_user_accessed(sender, **extra):
user_id = session.get('user_id')
if user_id:
print 'access'
...
I've been trying to get this to work for the better part of a day and it just appears to be unuseably slow. I even stripped out the database portion.
Any ideas on what'd be slowing this down?
EDIT: I also stripped out REDIS and the problem persists.
https://pypi.python.org/pypi/cachecore/ is 404'ing for me
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.