Dash Authentication Issue


#1

Hi, I’m trying to add basic dash authentication following this tutotrial
https://dash.plot.ly/authentication

And upon doing so getting the following error locally:

Traceback (most recent call last):
File “index.py”, line 13, in
from appc import app, server
File “C:\Users\USER\Desktop\Folder\SubFolder\appc.py”, line 31, in
APP_URL
File “C:\Users\USER\Anaconda3\lib\site-packages\dash_auth\plotly_auth.py”, line 37, in init
salt=app_name
File “C:\Users\USER\Anaconda3\lib\site-packages\dash_auth\oauth.py”, line 24, in init
Auth.init(self, app)
File “C:\Users\USER\Anaconda3\lib\site-packages\dash_auth\auth.py”, line 10, in init
self._index_view_name = app.config[‘routes_pathname_prefix’]
TypeError: ‘type’ object is not subscriptable

Please note that without authentication my web app runs locally and on Heroku without an issue.
It’s a multipaged app so i’ve segmented it into different files.

index.py imports 'app' and 'server' from appc.py file.


Traceback (most recent call last):
File “index.py”, line 13, in
from appc import app, server
File “C:\Users\USER\Desktop\Folder\SubFolder\appc.py”, line 31, in
APP_URL
File “C:\Users\USER\Anaconda3\lib\site-packages\dash_auth\plotly_auth.py”, line 37, in init
salt=app_name
File “C:\Users\USER\Anaconda3\lib\site-packages\dash_auth\oauth.py”, line 24, in init
Auth.init(self, app)
File “C:\Users\USER\Anaconda3\lib\site-packages\dash_auth\auth.py”, line 10, in init
self._index_view_name = app.config[‘routes_pathname_prefix’]
TypeError: ‘type’ object is not subscriptable

Above error is seen on trying to use PlotlyAuth authentication method.

Versions:

dash 0.21.0
dash-auth 1.0.0
dash-core-components 0.13.0rc4
dash-html-components 0.10.0
dash-renderer 0.12.1
dash-table-experiments 0.6.0
dash.ly 0.17.3

Not sure if this is a bug or not.
Any help appreciated.
Thanks


Dash-Plotly App Authentication - Login Details Saved As Cookies/Heroku Hosted 'Type' Object error
#2

This isn’t right - I’d try uninstalling this package, it was left over from a previous era.


#3

Done.
Solved the problem. :slight_smile:

Thanks


#4

Hi. I also had this error and found out I had dash.ly installed in my base environment so, although it wasn’t showing up in pip list, it was still breaking app.config. When I uninstalled dash, dash.ly, flask, and whole bunch of other stuff from my base env it worked perfectly. I guess I must have installed in base before I learned better habits… So the lesson I learned is: Keep your base env lean and clean :smiley:


#5

Hello All. I was having a issue with plotly auth. Attached the error, please help me in rectifying this. Thanks much in advance. If someone could help me rectify, would be much appreciable and thankful. I have been trying to get some help to get this done for the past one month to solve this. Couldn’t find any help so far, trying to post these script in few other portals too, no solutions to it. :(:persevere:


#6

Im also having this issue. Im using a virtual environment. I dont have dash.ly isntalled on base env nor in virtual env

requirements.txt:
certifi==2018.8.24
chardet==3.0.4
Click==7.0
dash==0.28.1
dash-core-components==0.32.0
dash-html-components==0.13.2
dash-renderer==0.14.1
decorator==4.3.0
Flask==1.0.2
Flask-Compress==1.4.0
gunicorn==19.9.0
idna==2.7
ipython-genutils==0.2.0
itsdangerous==0.24
Jinja2==2.10
jsonschema==2.6.0
jupyter-core==4.4.0
MarkupSafe==1.0
nbformat==4.4.0
plotly==3.3.0
pytz==2018.5
requests==2.19.1
retrying==1.3.3
six==1.11.0
traitlets==4.3.2
urllib3==1.23
Werkzeug==0.14.1


#7

You don’t even have dash-auth, and the topic is about dash authentication. ??


#8

Wow you are right! So dumb of me. I never updated the requirements.txt to include the dash-auth.
You dont have to be so rude tough, everyone make mistakes. Thanks.


#9

Apologies, I was just confused by your post.