V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Flands
V2EX  ›  Flash

新手刚学 Flask,在 pycharm 下敲代码,现在到 E-mail 章无法运行?

  •  
  •   Flands · 2017-01-27 00:54:04 +08:00 · 4427 次点击
    这是一个创建于 2637 天前的主题,其中的信息可能已经有所发展或是发生改变。
    D:\Python 3.6\lib\site-packages\flask_sqlalchemy\__init__.py:800: UserWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True to suppress this warning.
      warnings.warn('SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True to suppress this warning.')
    usage: hello.py [-?] {shell,db,runserver} ...
    
    positional arguments:
      {shell,db,runserver}
        shell               Runs a Python shell inside Flask application context.
        db                  Perform database migrations
        runserver           Runs the Flask development server i.e. app.run()
    
    optional arguments:
      -?, --help            show this help message and exit
    
    Process finished with exit code 2
    

    有提到需要设置环境变量,但是在 mintty 下设置也报错 无论是

    export MAIL_USERNAME=<mail username>或者 set MAIL_USERNAME=<mail username>

    报错

    bash: syntax error near unexpected tokennewline

    我看书是不是漏了啥?

    环境变量的设置有没有办法建立临时的?不更改 windows 系统的全局环境变量? 谢谢各位帮助,祝大家新年快乐!

    2 条回复    2017-01-27 17:21:21 +08:00
    4cat
        1
    4cat  
       2017-01-27 11:23:46 +08:00   ❤️ 1
    我没用过 mintty ,你是不是 export MAIL_USERNAME=<mail username> 把括号也带上了?
    只是为了调试的话直接写入 config 文件里面不行么?
    Flands
        2
    Flands  
    OP
       2017-01-27 17:21:21 +08:00
    @4cat 我擦嘞,为啥还有这问题的,还以为是需要用的括号。。
    感谢,已发铜币
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   995 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 22:02 · PVG 06:02 · LAX 15:02 · JFK 18:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.