Skip to content

Commit

Permalink
issue #23 milestone
Browse files Browse the repository at this point in the history
  • Loading branch information
mxdevmanuel committed Jan 22, 2016
1 parent 212408e commit 1c1b12a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Default.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@
"caption": "Django: Search in Docs",
"command": "django_search_docs"
},
{
"caption": "Django: Set Project Interpreter",
"command": "set_project_interpreter"
},
{
"caption": "Django: Shell",
"command": "django_shell"
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,27 @@ Currently supports following commands:
* `Django: Pip Freeze To File`
* `Django: Pip Install Packages`
* `Django: Pip Install Requirements`
* `Django: Set Project Interpreter`

### Settings

* `python_bin`: path to python interpreter
* `python_version` : default python interpreter version
* `python_virtualenv_paths`: list of paths where virtualenvs are located (ex:`~/.virtualenvs/`)*
* `python_virtualenv_paths`: list of paths where virtualenvs are located (ex:`~/.virtualenvs/`)*\*
* `server_host`: host for the runserver command
* `server_port`: port for the server to listen
* `linux_terminal`: Only Linux setting for command line emulator
* `linux_terminal`: Only Linux setting for command line emulator\*\*
* `project_override`: (Boolean) Per project setting "python_interpreter" overrides "python_bin"

* `server_custom_command`: Per project setting to specify a custom server to run (ex: {"command": "gunicorn", "args":["--workers=3"]}) __use any script you want__
* `server_custom_command`: Per project setting to specify a custom server to run (ex: {"command": "gunicorn", "args":["--workers=3"]})\*\*\*

\*It's important to set your envs directories

\*The folders in this list should be the parent folder of the virtualenv folder, not the virtualenv folder itself

__It's important to set your envs directories__
\*\*Check that your 'linux\_terminal' setting uses an underscore "\_"

__Check that your 'linux\_terminal' setting uses an underscore "\_"__
\*\*\*use any script you want

### Please report any issue, bug, enhacement or comment [here](https://github.com/vladimirnani/DjangoCommands/issues)
### We'll be glad to read and work on all of them
Expand Down
4 changes: 4 additions & 0 deletions django-commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,10 @@ def set_project_interpreter(self, venvs, index):
if index == -1:
return
project = self.window.project_data()
if "settings" in project.keys():
pass
else:
project["settings"] = {}
project["settings"]["python_interpreter"] = os.path.join(venvs[index][1], 'python')
self.window.set_project_data(project)

Expand Down

0 comments on commit 1c1b12a

Please sign in to comment.