문제

I created a django project and as it was recommended in django tutorial I placed static files like .js in separate folder as well as template directory.

The result structure is like:

MyProject >
  scripts # place for .py files
  static # .js, .jpg etc
  templates

Now when I open MyProject directory in PyCharm, it wants all imports starting with "scripts". Like from scripts.myapp.mymodule import MyFunc. But it is ugly.

Is it possible to open all 3 directories as one project or tell PyCharm where the sources are?

도움이 되었습니까?

해결책

Go to Settings | Project Structure and mark the 'scripts' directory as a source root.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top