AnnMarieW / dash-multi-page-app-demos

Minimal examples of multi-page apps using Dash Pages
221 stars 52 forks source link

Flask-Login app: No layout in module `pages.login` in dash.page_registry #1

Open etjkai opened 2 years ago

etjkai commented 2 years ago

Hi AnnMarie, running the multi_page_flask_login app example results in an error

dash.exceptions.NoLayoutException: No layout in modulepages.loginin dash.page_registry

Just highlighting in case you'd like to change it.

AnnMarieW commented 2 years ago

Hi @etjkai Thanks for reporting, but I can't duplicate the error. I ran it just now with both dash 2.5.1 and dash 2.6.0 and they both work just like it appears in the gif in the README.

Could you send me a link to a minimal example that duplicates the error you are seeing? What version of flask and flask_login are you using?

etjkai commented 2 years ago

I've cloned directly from the git repo, and ran app.py from the folder. I've checked, and it seems like my dash version is 2.6.0 too.

Just to check the version of the code, it's still the one with a typo in the subfolder - multi_page_fask_login right?

image

AnnMarieW commented 2 years ago

I just cloned the repo, created an new venv and installed the requirements.txt and it worked fine. Did you do the pip install python-dotenv as recommended in the error message?

And thanks for pointing out the typo in the folder name - I just fixed that :upside_down_face:

etjkai commented 2 years ago

Yepp I did have python-dotenv installed. I did the exact same steps as you, with a fresh venv, but the same error persists...

It's very strange, as other examples, e.g. multi_page_basics work as intended.

AnnMarieW commented 2 years ago

Here's what I get when I do pip list: Do you have anything different?

async-timeout 4.0.2
Brotli 1.0.9
click 8.1.3
dash 2.5.1
dash-bootstrap-components 1.2.0
dash-bootstrap-templates 1.0.5
dash-core-components 2.0.0
dash-html-components 2.0.0
dash-iconify 0.1.2
dash-labs 1.1.0
dash-mantine-components 0.10.2 dash-table 5.0.0
Deprecated 1.2.13 diskcache 5.2.1
Flask 2.1.3
Flask-Caching 1.10.1 Flask-Compress 1.12
Flask-Login 0.6.1
importlib-metadata 4.12.0 importlib-resources 5.8.0
itsdangerous 2.1.2
Jinja2 3.1.2
ldap3 2.9.1
MarkupSafe 2.1.1
numpy 1.23.1 packaging 21.3
pandas 1.4.3
pip 20.0.2 pkg-resources 0.0.0
plotly 5.9.0
pyasn1 0.4.8
pyparsing 3.0.9
python-dateutil 2.8.2
python-dotenv 0.20.0 pytz 2022.1 redis 4.3.4
setuptools 44.0.0 six 1.16.0 tenacity 8.0.1
Werkzeug 2.1.2
wrapt 1.14.1 zipp 3.8.1

etjkai commented 2 years ago

I've

and do not have

All the rest are the same versions.

AnnMarieW commented 2 years ago

well, I'd love to help, but I'm not sure how without being able to duplicate the error.

etjkai commented 2 years ago

Not an issue! Perplexing to me too, as I'm indeed seeing the layout in page.login right in front of me. Thanks anyway - much appreciated.

AnnMarieW commented 2 years ago

hmm - are you on Windows?

etjkai commented 2 years ago

Yepp - I happen to be!

AnnMarieW commented 2 years ago

ok, just had someone else on Windows try it and they got the same error. I don't know the fix yet, but it's a clue.

etjkai commented 2 years ago

Great! Let me know if I could help in any way - I'd be glad to 😊