hustlzp / flask-boost Goto Github PK
View Code? Open in Web Editor NEWFlask application generator for boosting your development.
License: MIT License
Flask application generator for boosting your development.
License: MIT License
ImportError: cannot import name isMappingType
Search in Google I was taken to http://stackoverflow.com/questions/18736274/python-3-support-for-fabric
The problem and not solved, but the fact is - out of the box does not start.
I noticed the database object file in ‘/home/yileye/project/monitor/application/models‘
And after I run the command ’boost new model‘ ,I can see the new model file in this path
But how I use this file to generate the table in mysql?
本地环境中一切正常。
但在sae中,因为要引入第三方库,在sae中需要在wsgi最前面加入下面这一段
root = os.path.dirname(file)
sys.path.insert(0, os.path.join(root, 'site-packages'))
然后template中的模板里的static函数就用不了了,打开网页下方提示静态资源404
请教fis之后资源文件被打上md5标签
但是pages里面的template文件引用的资源名称没变
这个怎么处理?
When I run the command: python manage.py live
I have a ImportError like this : No module named flask.ext.script
Do you have any ideas?
For example, I generate an API controller with boost new controller api
then I tried to generate the action users/me with boost new action api users/me
. The code generated was
@bp.route('/api/users/me')
def users/me():
pass
clearly wrong. So, my question is, how to generate this kind of action? In case of an API I should use another approach, like generate other controllers and somehow put them together?
PS: I know that I can just change def users/me()
to def users_me()
but I'm asking about the right approach for this...
Hi bro, do you think you could info about how to deploy a web app made using flask-boost on apache?
Some decoding and encoding code is not compatible with python 3.x
I think I will contribute some code to fix it
after:
my_boost$ python manage.py db upgrade
I get user table but with no user, so no way to login:
mysql root@localhost:my_boost> select * from `user`;
+------+--------+---------+----------+------------+------------+--------------+
| id | name | email | avatar | password | is_admin | created_at |
|------+--------+---------+----------+------------+------------+--------------|
+------+--------+---------+----------+------------+------------+--------------+
0 rows in set
Time: 0.003s
mysql root@localhost:my_boost>
Should I create it myself ?
I have the error below with Python3.4
rodrigo@rodrigo-xubuntu:~/projects$ boost new your_project_name
Start generating project files.
Traceback (most recent call last):
File "/usr/local/bin/boost", line 9, in
load_entry_point('Flask-Boost==0.4.4', 'console_scripts', 'boost')()
File "/usr/local/lib/python3.4/dist-packages/flask_boost/cli.py", line 80, in main
execute(args)
File "/usr/local/lib/python3.4/dist-packages/flask_boost/cli.py", line 69, in execute
_rewrite_and_copy(src_file, dst_file, project_name)
File "/usr/local/lib/python3.4/dist-packages/flask_boost/cli.py", line 102, in _rewrite_and_copy
for line in old_file:
File "/usr/lib/python3.4/codecs.py", line 313, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdc in position 594: invalid continuation byte
env: windows/python2.7
error1: when install, exception throwed: tmpfile move exception. then I modify the source code, hard cord the args with "new project balabala"
error2:
from application import create_app
from application.models import db
no application found.
...
After I run the command boost new boost-test
, I got this error:
Start generating project files.
New: ~/workspace/python/boost-test/
New: ~/workspace/python/boost-test/.gitignore
Traceback (most recent call last):
File "/usr/local/bin/boost", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/flask_boost/cli.py", line 297, in main
generate_project(args)
File "/usr/local/lib/python2.7/site-packages/flask_boost/cli.py", line 87, in generate_project
_rewrite_and_copy(src_file, dst_file, project_name)
File "/usr/local/lib/python2.7/site-packages/flask_boost/cli.py", line 320, in _rewrite_and_copy
with open(abs_path, 'w', encoding='utf-8') as new_file:
TypeError: 'encoding' is an invalid keyword argument for this function
Hi Zhipeng, thanks for this awesome package.
I'm used to design my own database tables, relationships and primary keys, and then use SQLAlchemy autoloading function to create table models. The database is shared among other applications, so I like to do migrations manually, without using Flask-Migration and Alembic.
This is a example model (before using Flask-Boost), accounts.py
from app import app, db
main_engine = db.get_engine(app, bind=None)
class Accounts(db.Model):
__tablename__ = 'accounts'
__table_args__ = {'autoload':True, 'autoload_with':main_engine}
Now that I'm using Flask-Boost, first I type boost new model accounts
to generate the model, and then use tools like sqlacodegen to complete the model's definition. Each time I update my database schema, I need to regenerate my models.
Is there a way to use SQLAlchemy autoloading feature with Flask-Boost?
Thanks in advance.
(venv)rodrigo@rodrigo-xubuntu:/projects/flask_boost_site$ python3 manage.py db upgrade/projects/flask_boost_site$
Traceback (most recent call last):
File "manage.py", line 4, in
from application import create_app
File "/home/rodrigo/projects/flask_boost_site/application/init.py", line 19, in
from config import load_config
File "/home/rodrigo/projects/flask_boost_site/config/init.py", line 18
except ImportError, e:
^
SyntaxError: invalid syntax
(venv)rodrigo@rodrigo-xubuntu:
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.