Module 'rest_framework' has no attribute 'routers'
See original GitHub issueHi, you are doing great work!
The following code causes the problem for me
from rest_framework import routers
__ROUTER = routers.DefaultRouter()
main\rest_api\urls.py:4: error: Module 'rest_framework' has no attribute 'routers'
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
FastAPI - module 'app.routers.test' has no attribute 'routes'
I think you want: app.include_router(test.router, prefix="/api/v1/test"). rather than: app.include_router(test, prefix="/api/v1/test").
Read more >AttributeError: module 'routes' has no attribute 'routes' · Issue #19
I am using Linux. Used the script to install everything from a fresh installation. Configured and ran the psql service and db. No...
Read more >Routers - Django REST framework
The . routes attribute is a list of Route named tuples. The arguments to the Route named tuple are: url: A string representing...
Read more >Django Rest Framework extensions documentation
Nested routes allows you create nested resources with viewsets. For example: from rest_framework_extensions.routers import ExtendedSimpleRouter from yourapp.
Read more >AttributeError: partially initialized module has no attribute ...
The solution is not to name the Python file the same as any of the modules being imported in that Python file. Related....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Addressed those particular errors here https://github.com/mkurnikov/djangorestframework-stubs/commit/bf73f18a23042743d8055445a8ac962ac1ae399f and here https://github.com/mkurnikov/djangorestframework-stubs/commit/554ee97240ebbc2404bbe68b90bf4f4692d283e3.
Thanks a lot for your help! I’m new to python type hinting and it is hard to understand right way of doing things.