-
Notifications
You must be signed in to change notification settings - Fork 2
Using Eclipse
Trey Stafford edited this page Jun 27, 2014
·
17 revisions
Eclipse is an Integrated Development Environment (IDE) that can be used to write and debug code. To set up Eclipse to work on an OPS development Virtual Machine, see Installing and Configuring Eclipse.
In addition to this page, please consult the PyDev and [Eclipse] (http://help.eclipse.org/luna/index.jsp) documentation for how to use eclipse with Python code.
- Use the command
eclipse&
as root to start eclipse from a terminal. - The standard 'PyDev' perspective is useful for browsing and writing code.
- Use
Window -> Open Perspective -> Other -> Debug
to open the standard debugging perspective. - Eclipse is highly customizable and includes many features out of the box. Use Window -> Preferences to adjust settings.
- New plugins for Eclipse can be installed using the Help -> Install New Software wizard.
- In the PyDev Package Explorer, one can right-click the OPS project and use
Django -> Shell with django environment
to start a Django shell. This is the equivalent of doing the following in a terminal:
cd /var/django/ops
source /usr/bin/venv/bin/activate
python manage.py shell
- One can save custom manage.py commands by right clicking the OPS project in the PyDev package Explorer and using the
Django -> Custom command
interface. This makes executing frequent manage.py commands a snap. Here are the Django manage.py commands.
Use the Debug perspective for debugging.
- The 'Console' View in the Debug perspective shows output, notices and warnings/errors. One can add a new console by pressing the 'Open Console' button at the upper left side of the Console view. ..* The PyDev console can be used to enter python code (use of the Django shell is recommended - see above). ..* A Debug console can be opened during a debugging session. This will allow one to enter commands within the context of the currently running process.