pycharm+flask项目运行出现from: can't read /var/mail/app

参照 Flask Web Development

里面的第7章大型程序的结构,在pycharm里面建立了名为flasky的程序,结果运行的时候报错,请教是什么问题?
不好意思已经完成
from: can't read /var/mail/app
错误内容如下:

./manage.py: line 2: import: command not found
from: can't read /var/mail/app
from: can't read /var/mail/app.models
from: can't read /var/mail/flask.ext.script
from: can't read /var/mail/flask.ext.migrate
./manage.py: line 9: syntax error near unexpected token `('
./manage.py: line 9: `app = create_app(os.getenv('FLASKY_CONFIG') or 'default')'

附录manage.py的代码如下:

import os
from app import create_app, db
from app.models import User, Role
from flask.ext.script import Manager, Shell
from flask.ext.migrate import Migrate, MigrateCommand


app = create_app(os.getenv('FLASKY_CONFIG') or 'default')
manager = Manager(app)
migrate = Migrate(app)


def make_shell_context():
    return dict(app=app, db=db, User=User, Role=Role)
manager.add_command("shell", Shell(make_context=make_shell_context()))
manager.add_command('db', MigrateCommand)


if __name__ == '__main__':
    manager.run()

ps:鸣谢 罗西南迪的陪伴eric之前的问题解决了,非常感谢

阅读 13.1k
3 个回答

各位我已经解决了这个问题了,谢谢

新手上路,请多包涵

请问你是如何解决的?我也遇到类似的问题。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏