imwilsonxu / fbone Goto Github PK
View Code? Open in Web Editor NEWFbone (Flask bone) is a Flask (Python microframework) starter/template/bootstrap/boilerplate application.
Fbone (Flask bone) is a Flask (Python microframework) starter/template/bootstrap/boilerplate application.
I can't run the unit test using nose. I have installed twill
through pip install twill
. Is there such requirement for specific version?
I removed Twill altogether, and it is working fine except that the test always hang at test_login
. Any hint on what is happening?
I am in pyenv2.7.10:
(pyenv2.7.10) $ fab setup
[] Executing task 'setup'
[localhost] local: virtualenv env
/bin/sh: /usr/local/bin/virtualenv: /usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/bin/p: bad interpreter: No such file or directory
Fatal error: local() encountered an error (return code 126) while executing 'virtualenv env'
Aborting.
Why is it looking for Python3? Or it has to run with Python 3?
Then changed to Python 3.4.1, at least virtual env complain goes away but now
ImportError: cannot import name 'isMappingType'
I am confused with Python version to use
$ python2.7
>>> from operator import isMappingType
>>>
$ python3.4
>>> from operator import isMappingType
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'isMappingType'
This link says Fabric is not supported in Python 3?
http://stackoverflow.com/questions/29306752/fabric-import-error-cannot-import-name-ismappingtype
Also not sure why
from werkzeug import generate_password_hash, check_password_hash
cannot import generate_password_hash and check_password_hash.
EDIT werkzeug should be:
from werkzeug.security import generate_password_hash, check_password_hash
Helps if requirements.txt is there.
On osx:
I saw:
Traceback (most recent call last):
File "tests.py", line 6, in
from fbone import create_app
File "/Users/mark.henry/Desktop/actionteam/fbone/init.py", line 3, in
from app import create_app
File "/Users/mark.henry/Desktop/actionteam/fbone/app.py", line 6, in
from user import User
File "/Users/mark.henry/Desktop/actionteam/fbone/user/init.py", line 3, in
from models import User
File "/Users/mark.henry/Desktop/actionteam/fbone/user/models.py", line 10, in
from fbone.extensions import db
File "/Users/mark.henry/Desktop/actionteam/fbone/extensions.py", line 10, in
from raven.contrib.flask import Sentry
ImportError: No module named raven.contrib.flask
Hi,
I am getting error jinja2.exceptions.UndefinedError: '_' is undefined on accessing the routes like localhost/frontend/login
return self.environment.handle_exception(exc_info, True)
File "/usr/local/morphed_sky/venv/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/morphed_sky/sky/templates/errors/page_not_found.html", line 2, in top-level template code
{% set page_title = _('Page not found') %}
jinja2.exceptions.UndefinedError: '_' is undefined
You should add "tests" to the packages in setup.py, this way everybody will be able to import the module.
I am having difficulty deploying to Heroku. I don't entirely understand the comments in wsgi.py (on how to set up dev/production config) nor am I completely sure what should be in my Procfile. I currently have web: gunicorn wsgi
, and am on a new branch (which I am pushing to Heroku too), but I know that I need add the right Procfile command. I am getting the error IOError: [Errno 2] No such file or directory: '/app/.virtualenvs/[PROJECT_NAME]/bin/activate_this.py'
with Heroku error code H10.
Before scaling or adding to this application, I wan't to be able to deploy fbone as it is. Any idea on a fab task to deploy to heroku, or a help document on integrating Heroku deployment? I'm confused about what variables need to be updated for production.
Any advice is appreciated!
How do you run the tests on tests folder?
Thanks
Hi there,
I've spent some time troubleshooting this before creating an issue here but to no avail.
I'm seeing the below error when I try to install fbone.
This is done from a fresh and updated installation of Ubuntu on a virtual machine.
All stated requirements have been meet too.
As per the readme file:
I clone the repo.
Create a new virtualenv: virtualenv env and activate it
Run fab setup
Am I doing something wrong here?
Installed /var/www/fbone/env/lib/python2.7/site-packages/fbone-0.1-py2.7.egg
Processing dependencies for fbone==0.1
Searching for mysql-python
Reading http://pypi.python.org/simple/mysql-python/
Best match: MySQL-python 1.2.4
Downloading https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.4.zip#md5=ddf2386daf10a97af115ffad2ed4a9a0
Processing MySQL-python-1.2.4.zip
Running MySQL-python-1.2.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-OziO2z/MySQL-python-1.2.4/egg-dist-tmp-GQN0B_
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
(Currently using distribute 0.6.24 (/var/www/fbone/env/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg))
error: Setup script exited with 2
Fatal error: local() encountered an error (return code 1) while executing 'python setup.py install'
Some of the code didn't obey the pep8 rule, such as 80-character rule.
It is better to add pep8 check via something like https://pypi.python.org/pypi/pyflakes
Flask-Mail
Flask-Cache
Flask-OpenID
Flask-WTF
When I reset a password I get the email follow the link, but the change_password view expects to render_template("frontend/change_password.html",form = form) There is no file change_password.html and the rendering fails.
I tried doing the obvious but it doesn't work. e.g.., if I simply create change_password.html with the following code
{% from "macros/_form.html" import render_form %}
{% set page_title = "Change password" %}
{% extends "layouts/base.html" %}
{% block body %}
<h2>Change password</h2>
{{ render_form(url_for('frontend.change_password'), form)}}
{% endblock %}
It is render correctly, but when posting with SAVE I get a Forbidden page :( message.
needed "brew install fabric" advice (etc).. and even then ...
$ fab setup
[] Executing task 'setup'
[localhost] local: virtualenv env
/bin/sh: virtualenv: command not found
Fatal error: local() encountered an error (return code 127) while executing 'virtualenv env'
Hello,
In Flask-Login==0.3.2, is_authenticated isn't a method anymore but a boolean.
Is it pythonic if we replace :
if current_user.is_authenticated():
pass
by :
if current_user.is_authenticated:
pass
If you think it's a good workaround, I can send you a pull request.
Br,
Bilal
@user.route('/profile', methods=['GET', 'POST'])
@login_required
def profile():
form = ProfileForm(obj=current_user)
if form.validate_on_submit():
form.populate_obj(user)
user.update_at = get_current_time()
......
needs to be corrected to:
@user.route('/profile', methods=['GET', 'POST'])
@login_required
def profile():
form = ProfileForm(obj=current_user)
if form.validate_on_submit():
form.populate_obj(current_user)
current_user.update_at = get_current_time()
......
I'd do a "Pull Request" myself but i'm a noob at Git.
I just download fbone and I thinks it look really promising. I'm now only confused about how to start the fbone. In fbone-master/fbone I did:
python app.py
But it then say:
Traceback (most recent call last):
File "app.py", line 8, in <module>
from .config import DefaultConfig
ValueError: Attempted relative import in non-package
Any idea what is wrong? How can I start it up?
Traceback (most recent call last):
File "manage.py", line 3, in
from flask.ext.script import Manager
ImportError: No module named flask.ext.script
I am getting this error, when I run fab d. What should I do?
Why by default does the app attempt to create a vhost in apache when running fab init? I feel like that would be part of something like fab deploy, and the fab init should be enough to install the entire project, and then begin development locally.
Simple typo about terms of service:
Currently it is
agree = BooleanField(u'Agree to the ' +
Markup('Terms of Servic'), [Required()])
You're missing an 'e' for Service.
:)
Hey!
Thanks for great layout it is really helpful! However I have one simple question - how to I actually access the app? It is created in manage.py and is not exported anywhere so when I need it somewhere, say in my models when I need app.config how do I get it?
OS X + Python 3.5:
When invoking fab setup
:
ImportError: cannot import name 'isMappingType'
It looks like Fabric isn't compatible with Python 3.5.
Hey,
I have been playing a bit with your fbone and figured out that your DenormalizedText
type doesn't work :/
>>> user = User.query.filter_by(id=1).first()
2013-11-27 18:43:57,552 INFO sqlalchemy.engine.base.Engine BEGIN (implicit)
2013-11-27 18:43:57,555 INFO sqlalchemy.engine.base.Engine SELECT users.password AS users_password, users.id AS users_id, users.name AS users_name, users.email AS users_email, users.openid AS users_openid, users.activation_key AS users_activation_key, users.created_time AS users_created_time, users.avatar AS users_avatar, users.role_code AS users_role_code, users.status_code AS users_status_code, users.user_detail_id AS users_user_detail_id, users.followers AS users_followers, users.following AS users_following
FROM users
WHERE users.id = ?
LIMIT ? OFFSET ?
2013-11-27 18:43:57,555 INFO sqlalchemy.engine.base.Engine (1, 1, 0)
>>> user.followers.add(1)
>>> user.followers
set([1])
>>> db.session.add(user) # normally you don't need to do this.. but I want to be sure that everything is added
>>> db.session.commit()
2013-11-27 18:46:23,833 INFO sqlalchemy.engine.base.Engine COMMIT
>>> user.followers
2013-11-27 18:46:35,899 INFO sqlalchemy.engine.base.Engine BEGIN (implicit)
2013-11-27 18:46:35,902 INFO sqlalchemy.engine.base.Engine SELECT users.password AS users_password, users.id AS users_id, users.name AS users_name, users.email AS users_email, users.openid AS users_openid, users.activation_key AS users_activation_key, users.created_time AS users_created_time, users.avatar AS users_avatar, users.role_code AS users_role_code, users.status_code AS users_status_code, users.user_detail_id AS users_user_detail_id, users.followers AS users_followers, users.following AS users_following
FROM users
WHERE users.id = ?
2013-11-27 18:46:35,902 INFO sqlalchemy.engine.base.Engine (1,)
set([])
>>> user = User.query.filter_by(id=1).first()
2013-11-27 18:46:44,414 INFO sqlalchemy.engine.base.Engine SELECT users.password AS users_password, users.id AS users_id, users.name AS users_name, users.email AS users_email, users.openid AS users_openid, users.activation_key AS users_activation_key, users.created_time AS users_created_time, users.avatar AS users_avatar, users.role_code AS users_role_code, users.status_code AS users_status_code, users.user_detail_id AS users_user_detail_id, users.followers AS users_followers, users.following AS users_following
FROM users
WHERE users.id = ?
LIMIT ? OFFSET ?
2013-11-27 18:46:44,414 INFO sqlalchemy.engine.base.Engine (1, 1, 0)
>>> user.followers
set([])
>>>
Or am I doing something wrong?
Just a suggestion. Pytest has become a pretty robust testing framework and I've personally found it much easier to work with. It also supports stubbing and Mock style mocking out of the box.
Below is the flask-extension for testing, similar to the existing flask-test:
I love the project and ran into some issues with the following:
Hiya, just cloned fbone and followed next instruction: 'fab setup'. This blew-up complaining about MySQL. I don't have MySQL on my wee laptop. The installation guide said fbone relies on sqlite which I do have. I've looked in some of the files but can't see where MySQL is set as the db so I can set it back to sqlite. Do you not support a sqlite version anymore? How can I modify the setup so it uses sqlite again?
Many thanks,
Suzi.
I'm deploying on DigitalOcean with a barebones Ubuntu setup and I'm getting this error:
File "/var/www/myapp/app.wsgi", line 22, in <module>
from myapp import create_app
File "/var/www/myapp/env/lib/python2.7/site-packages/myapp-0.1-py2.7.egg/myapp/__init__.py", line 3, in <module>
from app import create_app
File "/var/www/myapp/env/lib/python2.7/site-packages/myapp-0.1-py2.7.egg/myapp/app.py", line 10, in <module>
from .user import User, user
ImportError: No module named user
from the apache error logs
I've done the vHost and run fab and all that works out fine. I have added to the application, but nothing major. Am I missing something?
Thanks for the help.
in frontend.views: current_app, session
in user.views: request
in user.forms: FileField, DateField, SelectField, AnyOf
The README.md file has a link at the bottom to Celery Project. The link is missing the letter 'c' in the word "project."
I have a web-app written with fbone framework (/var/www/flaskapp) . I have a screen in the web-app, where the user can upload a new version of the web-app as a zip
my plan is to have a function in the views.py, which takes the uploaded zip file and unzips to web-app folder (/var/www/flaskapp)
Question: do i need to run fab setup ? or is there a way to just put a updated distribution egg file?
Such as bower https://github.com/bower/bower. So we don't have to update this third-party dependencies each time.
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.