score:16
- OS: Windows 7/Windows XP
- IDE: NetBeans
- Version control: TortoiseHg/NetBeans
- Debugger: winpdb
- Shell: IPython
- Publish: WinSCP/PuTTY/TortoiseHg
Scripts
Once I create a new project in web2py I add a few scripts to my main app folder:
web2py\applications\myapp\DebugWinpdb.bat:
C:\Python25\Scripts\winpdb.bat ..\..\web2py.py -i 127.0.0.1 -p8000 -mypassword
web2py\applications\myapp\DebugShell.bat:
C:\Python25\Scripts\winpdb.bat ..\..\web2py.py -S myapp -M
web2py\applications\myapp\Shell.bat:
python ..\..\web2py.py -S myapp -M
IDE
As others have stated you need to do some extra stuff to get autocomplete/intellisense for web2py no matter what IDE you use.
For me NetBeans was a good compromise between does-everything-if-only-you-can-figure-out-how (Eclipse/PyDev) and does-the-basics-but-few-extras (PyScripter).
NetBeans Setup (Project Properties):
- Python Category
- Python Platform: Python 2.x (default is Jython)
- Run Category
- Main Module:
web2py.py
- Application Arguments:
-i 127.0.0.1 -p 8000 -a mypassword
- Main Module:
NetBeans Pros:
- Tight Mercurial integration
- Highlights which lines have been added, changed, or deleted in your source file as you edit it
- Selective rollback of individual changes you've made since your last commit
- One of the nicest visual diff viewers I have used
- Python PEP8 style hints (fully customizable)
- Name "foo" is not a valid class name according to your code style (CapitalizedWords)
- Name "Bar" is not a valid function name according to your code style (lowercase_with_underscores)
- Auto-format hotkey (corrects spacing around operators, etc)
- Navigation within source file
- semantically indexes current source file
- organizes alphabetically by type (Class, method, attribute, etc)
- makes even enormous style sheets manageable
NetBeans Cons:
- Integrated Debugger doesn't work with web2py (that one really hurts)
- Long startup time (but acceptably snappy for me once up and running)
Version Control
I use and highly recommend Mercurial for source control. As mentioned earlier, NetBeans has great support for Mercurial but there are some things I'd just rather do in TortoiseHg.
TortoiseHg Pros:
- Shell overlay icons
- Repository Explorer
- view repos history with graphical display of branching/merging
- one stop shop for Incoming, Outgoing, Push, Pull, Update, etc with button for Commit tool
- Commit tool
- Hunk Selection: cherry pick changes from within a file for more focused Commits
- Add, Remove, Diff, Revert, Move, Remove, Forget
TortoiseHg Cons:
- No easy way to drop directly into a command line
- Bug that regularly prevents files from being removed during commit (waits indef for a lock to be released; running
hg addremove
from command line is a reliable workaround)
Publishing
I use a combination of WinSCP (for browsing), PuTTY (for terminal commands), and TortoiseHg (for push/pull of my repos) to work with my shared hosting account on Webfaction.
The first thing I do is set up public/private key encryption. If you are having trouble getting this set up between Windows and Linux, try these instructions from Andre Molnar. Short story is you need to generate your private key using ssh-keygen on Linux, copy it down to your Windows machine using WinSCP, then convert it for use with WinSCP and PuTTY.
Then add the following lines to your global mercurial.ini file:
[ui]
ssh = "C:\Program Files\TortoiseHg\TortoisePlink.exe" -ssh -2 -i "c:\path\to\your\privatekey.ppk"
Even if you have to connect to multiple servers, you need only copy your public key to each of the different servers. You'll also want to let WinSCP and PuTTY know where your private key is located, but those are fairly easy to figure out.
score:0
I've found the Wing IDE debugger to be very useful. It's a powerful debugger across the board, and also can be configured to do remote debugging, which is really important when you are running web2py on a no-GUI remote machine (e.g. at Amazon Web Services).
score:1
we are using web2py framework for all our web application needs and this is our setup :
OS - Ubuntu up-to-date
IDE - Aptana Studio 3.0 with pyDev
Version Control - git
Python 2.7
Browser for developing phase : Chrome
score:5
Caveats: I work in OS X, and do most of my coding in BBEdit.
That said, I've used both Wing and Komodo IDE for web2py debugging, and they've both worked quite well for me. I haven't tried NetBeans in a while now; when I did the Python support seemed a little rough around the edges. And I've never had the time or patience to come up to speed with Eclipse; it's filed in my mental file cabinet with Emacs, no doubt unjustly to Eclipse and/or Emacs.
(And I'll echo mdipierro's recommendation to try the web2py mailing list; it's really indispensable--one of web2py's strongest points.)
score:5
Have you considered using fewer tools? Both Python and web2py don't require a whole lot of code to get a lot accomplished. web2py only adds 10 or 15 new function calls (besides the HTML helpers and validators). You might find that Eclipse and other IDEs actually get in the way. Setting up new apps in web2py is simple through the admin system. Since the new app scaffolding copies the welcome app, you can customize new app setup by editing the welcome app. With Mercurial (or Git, Subversion or Bazaar) you can set up a server on your machine or with one of the public sites and either push or pull updates to your production server. Keep it simple, I say.
score:8
I'm pretty sure that the 'one-click setup script' to do all that you are looking for does not exist (at the moment). But don't be put off - you can achieve a nice development environment to suit your needs and there are lots of choices.
Although I develop on Windows, I like the setup I have as it's more of a 'Unixy' way of thinking whereby I have a number of tools each doing a specific task. Once you get a workflow setup you can be very productive - although I realise it may look a bit confusing initially coming from a Visual Studio world.
Below I outline what I've settled on. I'm sure others will have their own recommendations. Pick the options you like best.
(There should be hyperlinks to useful software below but I don't have enough reputation to include more than 1 link...)
For developing on Windows I'm enjoying using Pyscripter. It's free, fast (compared to Aptana / Eclipse / Netbeans etc) and has some nice features (dark theme, integrated python console and code explorer to name a few).
To get code completion / intellisense to work for web2py you need to add some code to your model / controller files because of the way web2py works. There are some instructions in this discussion topic on the web2py group.
web2py has a great error ticketing system built in (see the web2py book chapter 3). For more comprehensive debugging, pydb seems to be the way to go. Just put the code below as a breakpoint:
import pydb
pydb.debugger()
and it'll take you to the debugger.
I use TortoiseHg for Mercurial integration and it works wonderfully. Combine that with winscp and you can deploy easily.
score:12
Try the new web2py admin interface in trunk. It has a web based mercurial interface and a google deploy interface.
In web2py you can edit applications/admin/models/0.py and set
TEXT_EDITOR = 'amy'
And you will get the web based Amy editor with autocompletion. It is not default because because it does not work with some browsers and because autocompletion is not as good as eclipse. It may work for you.
You can use web2py with Eclipse but you need a minor workaround to let Eclipse know about the web2py environment. It is explained here.
I know other users have used other IDEs with web2py, for example WinIDE and pyCharm. I suggest you ask on the web2py mailing list where people are very helpful.
Source: stackoverflow.com
Related Query
- A good development environment setup for Web2Py
- What's a good development environment for Perl?
- Good Development setup for Spring-MVC/Hibernate/MySql
- How to setup development environment for Google Appengine Java Managed VM using Eclipse and Maven
- Looking for a good dev environment for OSGi bundles
- How to setup eclipse ide for php development with pre-existing source
- Setup Java development environment with Docker
- Which Eclipse distribution is good for web development using Python, PHP, or Perl?
- Setting up development environment in eclipse for Android Samsung SDK
- Setup Eclipse for BlackBerry development
- Python & OpenERP development environment setup howto?
- How to setup bundle development environment (Eclipse Equinox Maven)
- need a good tutorial for eclipse java ee for beginning web app development
- What framework + application server + development environment to use for Java services?
- Set up a development environment for Addon development for mozilla firefox using Addon-SDK and an IDE
- How to setup environment for SpagoBI debugging
- Why is Setting Up a Development Environment for Android 2.3 under Windows so Nightmarish?
- How to setup java development environment i.e. jdk and eclipse IDE on Mac OS X 10.7 Lion?
- GAE Development - Development Environment Setup (HotSwap)
- Accessing a local MySQL instance in your GAE development environment for java using eclipse
- Eclipse, Orion, OSGi development environment setup (Maqetta)
- Eclipse IDE setup for multi-language development
- Liclipse/Eclipse: setup debugging environment for a django project alongwith its virtualenv
- How do I setup a project in Eclipse for JSP, Servlet, JPA, Hibernate web development
- Optimal setup for OSX PHP development environment: MAMP + Eclipse + Subclipse + XDebug? Other?
- Eclim setup for Java development
- Eclipse development environment for WAS 6.1
- Programming environment for Mapreduce - Seamless iterative development
- Setup a development environment git + centos + Eclipse egit on windows
- Trying to setup environment for GeoNetwork metadata editor
More Query from same tag
- MagicDraw 18.3 developing plugins using Eclipse 4.5.2.M
- How to find and restore one single file from git?
- How to use the GNU scientific library (gsl) in nvidia Nsight eclipse
- Eclipse Helios not able to install m2e
- How do you use an array list in multiple classes?
- Running Android Applications on Smartphone with Lower Versions
- Adding to my TextView
- AVD in Eclipse not working in Emulator?
- Does opc ua sampling rate set at 0 work with an OPC UA Ecplise Milo server
- Ignore everything expect all subfolders / files in .gitignore
- Scala Type Mismatch in Eclipse but not in Console
- Eclipse Tasks - only local repo
- Don't make the application start once again after pressing "Close"
- How to visualize java code using UML notations inside Eclipse?
- What is the directory of the current workspace in Eclipse
- Eclipse has randommly stopped loading
- Eclipse - exclude file / folder from triggering workspace refresh after build
- XSD Validation error when Importing element from another XSD
- Inline comments in Java: /** opposed to /*?
- How to use Eclipse Mercurial Plugin to produce a patch?
- Running a python module using -m from within eclipse
- Pinax run it under win7 with eclipse?
- Run multiple java main methods in eclipse
- How to add keyword-hightlight feature to 'org.eclipse.ui.examples.rcp.texteditor_3.7.0.src'
- Cannot import java classes under src/main/java into src/test/java in eclipse
- What's 'API Baseline' in Eclipse PDT
- Connecting Nexus S to Eclipse under Linux
- How to share code from one project to another and control what will be compiled to the JAR file?
- Fatal Exception: main and Null pointer exception arise while running a simple android program
- eclipse - set position of view (or move view) programmatically