![]() ![]() The example assumes that a virtualenv exists in a directory named my_project and the env directory contains a directory named my_project (e.g., in my case, ~/envs/my_project/my_project). The example creates a Tmuxinator project file named my_project.yml, which generates a my_project.tmux file and creates the command start_my_project that you can use to start the Tmux session. manage.py runserver - logs : layout : even-horizonal panes : - tail -f /opt/local/var/log/nginx/access.log - tail -f /opt/local/var/log/nginx/error.log - sudo python -m smtpd -n -c DebuggingServer localhost:25 Explanation of the Example manage.py dbshell - server : venvwrapper & workon my_project & cd my_project &. manage.py shell - database : venvwrapper & workon my_project & cd my_project &. project_name : my_project project_root : ~/ tabs : - zsh : ls -l - shell : venvwrapper & workon my_project & cd my_project &. A Django Example # ~/.tmuxinator/my_project.yml # you can make as many tabs as you wish. The following is a Django example in which I create a Tmux session with multiple windows (an explanation follows the example). The Tmuxinator docs use a Rails-inspired example. $ tmuxinator new my_projectĪ file should now open in your text editor. Now, use Tmuxinator to create a “project file” (a YAML file containing shorthand configuration settings for Tmux). Create a Project Fileīefore taking this step, make sure you’ve followed the Tmuxinator installation instructions and have exported your EDITOR shell variable, e.g.: $ export EDITOR=vim Next, install Tmuxinator (instructions here).Īs a side note, I recommend using RVM to manage your Ruby versions. It’s available in apt-get, MacPorts, etc. Install Tmux with your package management software of choice. ![]() I will skip explaining how to install those tools or use them, since many tutorials on those subjects exist already, in addition to the virtualenv docs and virtualenvwrapper docs.Īfter this point I will assume you have created a virtualenv for your Python code in a directory named my_project and have configured virtualenvwrapper so that you can execute workon my_project to activate the virtualenv. If you don’t use these tools, remove the venvwrapper & workon my_project portion of the examples. They just make working with multiple Python projects easier. Note that you do not need to use either of those tools to set up or tear down a Django development environment with Tmux. My example uses virtualenv and virtualenvwrapper. If you are a Screen user, then I suggest you try Tmux, but you can probably achieve a similar method to the one described in this post using Screen and one of the automation scripts designed to work with it. So, I tried Tmux, and I haven’t gone back. However, I grew dissatisfied with the pace of development in the project, the lack of new features, and the inconsistent availability of vertical splits across different platforms. Until earlier this year, I had used GNU Screen for managing persistent terminal sessions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |