Skip to content

Commit 3e15470

Browse files
alastairdbproofit404
authored andcommitted
Added info on configuration via directory local variables (#9)
1 parent 487dbd1 commit 3e15470

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.markdown

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,17 @@ directly or with compose file environment key
129129

130130
docker run -e DJANGO_SETTINGS_MODULE=project.settings web ...
131131

132+
### Configuration via .dir-locals.el
133+
134+
Another way to set the above variables is via [directory variables](https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html). The values you set will then be valid when editing all files in the directory where `.dir-locals.el` is located and all directories underneath that one. To set the same values as in the examples above, we would use the following `.dir-locals.el` file:
135+
136+
((nil
137+
(python-shell-process-environment . ("DJANGO_SETTINGS_MODULE=project.settings"))
138+
(python-shell-extra-pythonpaths . ("/path/to/the/project/"))
139+
(python-shell-virtualenv-root . "/path/to/your/venv/")))
140+
141+
Note that you should specify `nil` for the major-mode specification in the directory variables, indicating that the values will be valid in all Emacs buffers associated with files under the directory, not just, say, buffers of open Python files.
142+
132143
## Usage
133144

134145
If you open file or directory related to the project, you should see

0 commit comments

Comments
 (0)