This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>To get started with Django in PyDev, the pre-requisite is that Django is installed in the Python/Jython/IronPython interpreter you want to use (so, "import django" must properly work).</p>
<p>To get started with Django in PyDev, the pre-requisite is that Django is installed in the Python / Jython / IronPython interpreter you want to use (so, "import django" must properly work – if you're certain that Django is there and PyDev wasn't able to find it during the install process, you must go to the interpreter configuration and reconfigure your interpreter so that PyDev can detect the change you did after adding Django).</p>
<p>If you don't have Django installed, follow the steps from <ahref="http://www.djangoproject.com/" class="external-link" rel="nofollow">http://www.djangoproject.com/</a>.</p>
<p>Note that this tutorial won't teach you Django, only how the Django integration is available in PyDev, so, if you're not familiar with Django, it's useful to learn a bit about how it works and then use this help to know how the PyDev Django integration can help you. </p>
<p>Note that this tutorial won't teach you Django. It'll only show how the Django integration is available in PyDev, so, if you're not familiar with Django, it's useful to learn a bit about how it works and then use this help to know how the PyDev Django integration can help you. </p>
<h1><aname="PyDevDjango-Abitoninternals"></a>A bit on internals</h1>
@@ -19,11 +19,11 @@ <h1><a name="PyDevDjango-Abitoninternals"></a>A bit on internals</h1>
<p>1. The project must be marked as a Django project inside of PyDev.</p>
<p>2. A 'DJANGO_MANAGE_LOCATION' string substitution variable must point to the project-relative location of manage.py.</p>
<p>2. A <b>DJANGO_MANAGE_LOCATION</b> string substitution variable must point to the project-relative location of manage.py.</p>
<p>3. A 'DJANGO_SETTINGS_MODULE' string substitution variable must contain the name of the settings module in that project.</p>
<p>3. A <b>DJANGO_SETTINGS_MODULE</b> string substitution variable must contain the name of the settings module in that project.</p>
<p>And that's it, with those properly configured, all the Django-related actions should work (and the steps below will explain how those can be configured).</p>
<p>And that's it, with those properly configured, all the Django-related actions should work (provided the project is already configured as a Django project, there's an UI to configure those settings in the project properties: right-click your <b>project > properties > PyDev - Django</b>)</p>
<h1><aname="PyDevDjango-Creatinganewproject"></a>Creating a new project</h1>
@@ -76,13 +76,43 @@ <h1><a name="PyDevDjango-Run%2FDebugasDjango"></a>Run/Debug as Django</h1>
<p>This will create a default Run configuration, so, you may edit it later through run > run configurations (or debug > debug configurations) if you want to change a parameter.</p>
<p>Note: to know how to rerun the last launch see: Rerun Last Launchon Launching_</p>
<p>Note: to know how to rerun the last launch see: the <b>Rerun Last Launch</b> topic on <ahref="manual_adv_launch.html" title="PyDev Launching">PyDev Launching</a></p>
<p>Note 2: if the --noreload is not passed, only the parent process will be killed from Eclipse and the others will only be killed when they'd be reloaded (i.e.: on a code-change). </p>
<h1><aname="PyDevDjango-Run%2FDebugasDjangowithautoreload"></a>Run/Debug as Django with autoreload</h1>
<h1><aname="PyDevDjango-RunDjangowithautoreload"></a>Run Django with autoreload</h1>
<p>If you don't want to se the --noreload flag, please take a look at the <ahref="manual_adv_remote_debugger.html" title="PyDev Remote Debugger">Remote Debugger</a> for instructions on how to make the debugging work properly with the auto reload feature.</p>
<p>It's possible to run Django using it's auto-reload feature, but as stated above, doing so by default will have a bad side effect in which it'll actually leave spawned processes alive in the auto-reload. A workaround is provided by doing:</p>
patch_remote_debugger<spanstyle="color: #666666">=</span><spanstyle="color: #008000">False</span>, <spanstyle="color: #408080; font-style: italic">#Note that the remote debugger patch setting should be False on a regular run</span>
<p>just <b>before</b> the <b>if _<em>name</em>_ == "_<em>main</em>_":</b> in your manage.py module.</p>
<p>This will make the spawned children processes have their own console outside of Eclipse, where Ctrl+C may be properly used to kill the Django process (don't forget to remove the --noreload that PyDev added automatically to the launch configuration).</p>
<h1><aname="PyDevDjango-DebugDjangowithautoreload"></a>Debug Django with autoreload</h1>
<p>To debug Django with the autoreload feature, the <ahref="manual_adv_remote_debugger.html" title="PyDev Remote Debugger">Remote Debugger</a> must be used and a patch must be applied to your code (just <b>before</b> the <b>if _<em>name</em>_ == "_<em>main</em>_":</b> in your manage.py module):</p>
<p>So, doing that, starting the remote debugger and making a regular run should enable all the regular breakpoints that are put inside Eclipse to work in the Django process with the Remote Debugger (don't forget to remove the --noreload that PyDev added automatically to the launch configuration).</p>
</div>
<br/><br/><ahref="https://wiki.appcelerator.org/display/tis/PyDev+Django">See wiki page</a>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2><aname="PyDevInteractiveConsole-NewonPyDev2.5.0%3AInteractionwithVariablesView"></a>New on PyDev 2.5.0: Interaction with Variables View</h2>
<p>From PyDev 2.5.0 onwards, the interactive console may be connected to the variables/expressions view (as if it was a debug process... but without breakpoints).</p>
<p>To enable that feature, go to window > preferences > PyDev > Interactive Console and check 'Connect console to Variables Debug View?'.</p>
<p>With that setting in place, when a new interactive console is created and the debug perspective is shown, it's possible to see the variables available in the console through the variables view and even add expressions to be resolved in the expressions view.</p>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>To do that, edit the launch that PyDev created (run > run configurations > PyDev Django) and remove the noreload flag and edit your manage.py so that the lines:</p>
<divclass="highlight" style="background: #f8f8f8"><prestyle="line-height: 125%"><spanstyle="color: #408080; font-style: italic">#Add pydevd to the PYTHONPATH (may be skipped if that path is already added in the PyDev configurations)</span>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters