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?



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


Please sign in to leave a comment.