Search code examples
pythondjangopycharm

Pycharm underlines absolute import, but it works fine


I have path server->api(folder), manage.py. Pycharm underlines my absolute import from api.views import create_user but it works! If i type like from server.api.views import create_user pycharm does not underline, but it doesn't work


Solution

  • PyCharm has option called 'Mark Directory as' when you right click your specific directory in the Project tree.

    Try to mark 'Server' folder as 'Sources root' and it should work fine.