I am trying to inistiate a Python server which uses the Flask framework. I'm having a hard time setting up the flask extention HTTPBasicAuth. I'm not sure how I can get this extension setup properly. Please help!
CMD output:
C:\Dev Workspaces\RestTutorial\REST-tutorial-master>python rest-server.py Traceback (most recent call last): File "rest-server.py", line 3, in from flask.ext.httpauth import HTTPBasicAuth File "C:\Python27\lib\site-packages\flask\exthook.py", line 87, in load_module
raise ImportError('No module named %s' % fullname) ImportError: No module named flask.ext.httpauth
Thanks!
Probably too late to answer. But putting it here for others.
Only installing Flask will not install httpauth you have to install it explicitly. Run the following command to install globally:
$ pip install flask-httpauth
or
$ flask/bin/pip install flask-httpauth
where flask/bin is your virtual environment running flask
Here you could find the reason.
In my case, the correct import for my flask version was the following one:
from flask_httpauth import HTTPBasicAuth
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With