Page MenuHomePhabricator
Paste P2283

flask and pywikibot
ArchivedPublic

Authored by Mpaa on Nov 5 2015, 9:35 PM.
Tags
None
Referenced Files
F2920081: flask and pywikibot
Nov 5 2015, 9:35 PM
Subscribers
import pywikibot
from flask import Flask
app = Flask(__name__)
DEBUG = True
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run()

Event Timeline

Mpaa edited the content of this paste. (Show Details)EditedNov 5 2015, 9:35 PM
Mpaa changed the title of this paste from untitled to flask and pywikibot.
Mpaa updated the paste's language from autodetect to python.
Traceback (most recent call last):
  File "/home/user/python/core/pywikibot/site.py", line 34, in <module>
    import pywikibot
  File "/home/user/python/core/pywikibot/__init__.py", line 30, in <module>
    from pywikibot.logging import (
  File "/home/user/python/core/pywikibot/logging.py", line 12, in <module>
    import logging
  File "/home/user/python/core/pywikibot/logging.py", line 17, in <module>
    from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL
ImportError: cannot import name DEBUG
Mpaa activated this paste.

maybe flask is not honouring absolute_imports ?
the fix is to rename logging to _logging

I found out I had a problem with PyDev libraries configuration in Eclipse.
Now it should be OK.