Set PyCharm filepath for Django settings (to outside project folder)


I'm trying to set the location of my Django settings file in PyCharm. By opening Settings > Languages & Frameworks > Django, and editing the "Settings:" field, I try to enter the absolute path of the file. My settings file does NOT reside in the project directory. PyCharm seems to have a problem parsing the path.

My project directory is "C:\Dylan\NEMO\".

My settings file is located at "C:\Dylan\NEMO_runtime\". When I enter that path, it changes it to "_runtime\" and a warning that PyCharm "Can't find settings file _runtime\".

Is there a way to set the absolute path for the file that resides OUTSIDE the project directory?


Official comment


This is how PyCharm worked from its first versions. I agree that does not have to be in *django root*, but it still must be somewhere under source roots: PyCharm would not be able to parse it and resolve references in other case.


Please create feature request:

Hello. (and everything else) should be in project directory to be supported by PyCharm

By the way, how do you use file outside of project directory? Do you add ``NEMO_runtime`` to PYTHONPATH?


Hi Ilya,

Yes, I set two environment variables for my runtime configuration:



This works great when running the application. 

It's unfortunate that PyCharm requires the file to be inside the project directory. I think this requirement should be removed from PyCharm, because the official Django documentation allows the file to be anywhere.

I am researching how to package my Django application and prepare it to be open source. Other people will not have the same settings as me, so I think the reliable way to package it is not have a file in the version controlled source tree. Instead, the person deploying the application is required to create one, and tell Django where to find it with the environment variable. (If there's a better way to do it, I'd very much like to hear about it!)

I suppose I can create a symbolic link to fix the problem on my computer.

-- Dylan


It's a bit disappointing that the settings have be in the django root folder. Would be great if one can hardcode the path to


Can you fix that shit? This is a totally artificial requirement that your product is adding without having any need to do so. Did a pycharm developer come up with this requirement without telling anyone?


+1 for this. Any project created with cookiecutter-django, considered best practices by many, will have settings outside the django project root:


Please sign in to leave a comment.