[Tutor] Using Python for a client interactive map application

Hugo Arts hugo.yoshi at gmail.com
Thu Jan 5 17:23:41 CET 2012


On Thu, Jan 5, 2012 at 5:04 PM, James Reynolds <eire1130 at gmail.com> wrote:
>
>
> On Thu, Jan 5, 2012 at 10:58 AM, Alexander <rhettnaxel at gmail.com> wrote:
>>
>> Dear friends,
>> I'm emailing regarding a general question about working with Python and a
>> web-browser based interactive map application. Over the summer I had asked a
>> similar question and heard some things about the Django framework, does
>> anybody have any other suggestions? For example there is a server with all
>> the info about a map, and from a browser a user will be able to view and
>> interact with the map at high speeds.
>> And please remember to reply to all.
>> Thanks,
>> --
>> Alexander
>> 7D9C597B
>>
>
>
> Django will (most likely) do what it is you want it to do, but you will also
> need some javascript. For my current project, I'm using JQuery, but I happen
> to know that Dojo has an interactive map feature in their toolset, so I
> would check that out dojo.
>

It sounds like the web server should do two jobs in this case:

1. deliver the javascript and assorted code that will draw the map,
along with a little html/css
2. respond to ajax requests from the javascript to deliver map data

any reasonable web framework will be able to do this just fine. Django
might even be a bit heavyweight for such a relatively simple task
(simple on the server side, that is). But there's nothing wrong with
using it anyway, if you're comfortable with it. Performance isn't
going to be an issue. You have a myriad of other options as well:
web2py, web.py, turbogears, pylons, cherrypy, you name it. Any of
these will do the job. If you already know one, I'd say pick that.
Otherwise, find one that looks simple and just go with it.

As for the format you'll be sending the map data in, I'd suggest json.
It's simple, easily read by humans and both python and javascript have
excellent tools for parsing and dumping (check out the json built-in
library for python).

HTH,
Hugo


More information about the Tutor mailing list