Django views does not exist or could not import

前端 未结 7 1585
温柔的废话
温柔的废话 2021-02-12 07:59

This morning i have been working on my project. I finished what i was doing and i pushed new code to git.

Now, i went to run my project to start working on it and index

7条回答
  •  我在风中等你
    2021-02-12 08:50

    I had the same problem.

    I had no clues, importing the module in the shell was not helpful at all: AttributeError: 'module' object has no attribute 'views'.
    But I noticed that if I imported a specific module (that is imported in the views.py) before importing views, it worked.

    I finally figured that the imported module also imported views.py, so it failed as each file was importing the other. No explicit message anywhere though.

提交回复
热议问题