Pergunta

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?

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top