Pages

Showing posts with label hacks. Show all posts
Showing posts with label hacks. Show all posts

2010-10-01

The web2py ide

The web2py ide is Firefox. Or Chrome, or Opera, or Safari (or Internet Explorer).

Just create a good old frameset and you can have split view between models and controller, documentation and even a preview running in one browser tab. Running the browser in full screen and the built in code editors in "full screen" (which fills the whole assigned frame), this turned out to work really well.

Example frameset:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>web2py ide - 0.1 beta :)</title>
</head>
<FRAMESET ROWS="75%, *" COLS="*, 40%">
<FRAME SRC="http://127.0.0.1:8000/admin/default/peek/yourapp/models/db.py">
<FRAME SRC="http://127.0.0.1:8000/admin/default/design/yourapp">
<FRAME SRC="http://127.0.0.1:8000/yourapp/default/index">
<FRAME SRC="http://127.0.0.1:8000/yourapp/appadmin/index">
</FRAMESET>
</html>

Can you see some quick improvements? Post them in the comments!

2010-09-29

Quick hack to develop web2py on a different machine

For security reasons web2py will not allow you to log in as administrator unless you are logging in from the same workstation. (There are exceptions, but they are cumbersome: See the official book for full details.)

However, there is a quick hack that allows you develop from any machine: Just set up a ssh tunnel:

ssh username@ip_address_or_dns_name -L 8000:127.0.0.1:8000 -N

As usually, I didn't come up with this myself. This time I found it here: http://www.revsys.com/writings/quicktips/ssh-tunnel.html

(However, if you read a few of the samples available on the internet, you'll see that may of them miss the point that in the local_port:ip_address:remote_port part you can and should use 127.0.0.1 instead of the external ip address. The reason is that this is the address that the request seems to come from in the server program at the remote computer.)