Add content root - is it possible to use env vars in paths?
Is there a way to use paths like %libs%\django in the Add content root dialog? AFAIK, this is the only place where I can add per project paths to PYTHONPATH.
Please sign in to leave a comment.
Hello Eduard-Cristian,
No, it's not possible to use environment variables there. Why do you need
that?
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
The required libs are stored on a shared mercurial repo, and each dev can clone it locally into any desired location, then update the env var to point to the root of the lib repo. One of the reasons for this setup is to be sure that you can use the exact lib versions on the production server as on the dev PCs (while not hardcoding the paths used for that), and another one is the different exclusion paths that are set for the paranoic AV software used. One positive side-effect is the quicker backup compared to the each-project-with-its-own-private-lib-set approach.
Hello Eduard-Cristian,
If you store .idea files in version control (which is moderately useful with
PyCharm), you can define a path variable pointing to the root of th repo.
Then the content root will be stored relative to the path variable, and each
developer will be prompted to define the path variable when they open the
project for the first time.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
How can I define a path variable and what is the syntax to use it in Add content root?
PyCharm doesn't seem to have a settings page for that.
It requires to define the variable for every new project
and update the value in all projects in case of moving the libs repo to another folder.
An env var would be a lot easier to maintain.
Anyway, I can live with that.