|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
abompard commented 7 years ago I think that the relative import issues you're getting come from the fact that you're trying to run the app as a script. The Flask docs now recommend another way, see the very beginning of http://flask.pocoo.org/docs/0.11/quickstart/ | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
abompard commented 7 years ago That is styling, I guess? PEP8 authorizes both ways. (at least flake8 does not report the current one). | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
abompard commented 7 years ago Ah, right, thanks, I did not test the POST yet, it would have failed. | ||
|
||
|
||
|
||
abompard commented 7 years ago Agreed 100%, naming is important. | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
abompard commented 7 years ago Hmm, if you move this in its own "app" module, then you'll have | ||
|
||
|
||
|
||
|
||
|
||
|
||
abompard commented 7 years ago What's the rationale for this change? I thought PEP8 recommended imports to be sorted alphabetically? | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
abompard commented 7 years ago Agreed again, I used the code from Supybot but full names are much better. | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
Had to make some changes so that the app would run including:
ag -i '(from\ +\.\ *(\w+))|(import\ +\.\ *(\w+))'
) since they were causing errorsmethods
argument to @APP.route
so that POST will work, flask will also return a 405 if it receives a request not in the list so remove the last if statement.APP.run
so I can make requests to the APIAlso adds flake8 and style fixes.
Ah, right, that's been in my global gitignore file since forever :-)