V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Flands
V2EX  ›  Flash

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

  •  
  •   Flands · Jan 27, 2017 · 5017 views
    This topic created in 3387 days ago, the information mentioned may be changed or developed.
    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 replies    2017-01-27 17:21:21 +08:00
    4cat
        1
    4cat  
       Jan 27, 2017   ❤️ 1
    我没用过 mintty ,你是不是 export MAIL_USERNAME=<mail username> 把括号也带上了?
    只是为了调试的话直接写入 config 文件里面不行么?
    Flands
        2
    Flands  
    OP
       Jan 27, 2017
    @4cat 我擦嘞,为啥还有这问题的,还以为是需要用的括号。。
    感谢,已发铜币
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2931 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 50ms · UTC 15:27 · PVG 23:27 · LAX 08:27 · JFK 11:27
    ♥ Do have faith in what you're doing.