I'm impressed Tim and would endorse the GeoDjango idea. I've so far compiled GEOS can import it in Python, but that's hardly more than getting my feet wet.
I'm going to tell my GIS audience to make sure to visit your booth (I'm doing this on the basis of teaching core Python to ESRI product users in 2005 at a DoubleTree by Lloyds (might've been Red Lion back then?) -- spent a lot of time showing how decorator syntax could be used to take the derivative of a function, which was later decided wasn't such a great idea on edu-sig, Guido contributing). I was pushing Django heavily for that Ecotrust Foodhub proposal, which obviously sank to Davy Jones with no trace, but I'd noticed the PostGIS angle and was thinking here was room to grow -- didn't know about GeoDjango back then, wondering if FoodHub went with something like that (a long time ago, I contracted with Ecotrust to do membership tracking in Foxpro, because it ran on both Windows and Mac back then... sounds of dinosaurs stirring). Anyway, GIS/GPS is very Portland, given our reputation for most excellent planning. I wonder if Metro uses much Python (just met with Phyllis Cole yesterday but we didn't discuss it). My dad was an urban planner here in town before we moved overseas. No one had computers back then, or cell phones. How did we do it? I was learning New Math (probably why I'm pushing Gnu Math today (because the Russians are doing it?)). Thanks again to all who helped with my stupid static serve problems with Django. It's hard on my ego to feel this retarded but that's what we must go through w/r to anything new and unfamiliar (I've managed to live this long with very little need for regular expressions, whereas now they're the key to fame and glory -- found that FireFox plugin that's lets me play with 'em). Kirby On Thu, Apr 2, 2009 at 8:04 AM, Tim Welch <[email protected]> wrote: > Hi folks, we've not met, I lurk a bit. If only my Tuesday nights weren't > taken. > > I'm considering a GeoDjango talk at OS Bridge. Starting with > geodjango-basic-apps, covering ctypes bindings for the core GIS libraries > (GEOS/GDAL), spatial queries (GeoQueryset, etc.), mapping client integration > (OpenLayers). Lots of other possibilities, GeoRSS/Atom feeds, KML, > integration with map engines, case studies. > > Kirby, looks like you'll be presenting at the GIS in Action conference this > month. See you there perhaps eh. We should have an OSGeo booth setup. > I'll be moderating a marine planning session covering tools we've developed > with GeoDjango for web and PyQGIS for desktop. > > Cheers, Tim > > > Tim Welch > Applications Developer > Ecotrust > > > On Wed, Apr 1, 2009 at 11:37 PM, Dylan Reinhardt > <[email protected]>wrote: > >> If I understand your issue correctly, you want to mix new content created >> and managed by Django with legacy content that exists in the form of static >> html files. >> >> This is actually easier than it sounds. There are many possible solutions, >> but here's one. Whether it is the right one will depend on how much of >> what >> type of stuff you have. >> >> So let's say you have a model you're using for content. And let's say you >> want this model to represent a "page" whether that page is new (managed by >> Django) or legacy (exists in file). That way both types of "page" can be >> managed by the same views at similar URLs. If you want that content object >> to do double duty, here's what you might do: >> >> 1. Add a FilePathField to your model. Docs: >> http://docs.djangoproject.com/en/dev/ref/models/fields/#filepathfield >> >> 2. Add a method to your model that returns the contents of the file at the >> path specified in that field >> >> 3. In your template(s), check for the presence of a value in the >> FilePathField. If it's there, just dump out the contents of the file. If >> not, proceed to render your page as you normally would. >> >> If you end up with images that use relative paths that are no longer valid, >> you can probably fix those quickly with an entry in urls.py or an Apache >> RewriteRule. Shouldn't take much to map any legacy paths to the new static >> directory. >> >> Anyway... hope that's helpful. >> >> Dylan >> >> >> On Wed, Apr 1, 2009 at 10:59 PM, kirby urner <[email protected]> >> wrote: >> >> > Thanks Dylan, plus to those replying off list. >> > >> > I'm trying to wrap an old static HTML website in Django such that I >> > don't have to change relative paths to images in subdirectories that >> > won't really be there anymore. I'm wanting all URLs from the outside >> > world to stay the same as well i.e. all the old links will work as is. >> > >> > http://www.4dsolutions.net/ocn/cp4e.html will now point to >> > http://www.4dsolutions.net/controlroom/ocn/old/archive/cp4e.html under >> > the hood, with the later containing <img src="graphics/pix.png"> tags >> > that need to be statically served from controlroom/media/ocn/graphics >> > -- that kind of thing. >> > >> > Kind of a hack maybe, an exercise. The idea is new content would take >> > advantage of the framework more, but this is a way of grandfathering >> > in what's at the site already, basically with no changes. >> > >> > Kirby >> > >> > >> > On Wed, Apr 1, 2009 at 5:12 PM, Dylan Reinhardt >> > <[email protected]> wrote: >> > > This might help: >> > > >> > > http://docs.djangoproject.com/en/1.0/howto/static-files/ >> > > >> > > HTH, >> > > >> > > Dylan >> > > >> > > >> > > On Wed, Apr 1, 2009 at 4:59 PM, kirby urner <[email protected]> >> > wrote: >> > > >> > >> Django is driving me nuts I have to admit. It's the static media bit. >> > >> It's all on my Ubuntu laptop so if someone wants to show me where I'm >> > >> going wrong, the bagels are on me... (I had it working but then >> > >> decided to move directories around...). Write me off list maybe. I >> > >> live near the Bagdad. >> > >> >> > >> Yeah, more Python talks would be good. I'm not altogether clear what >> > >> the audience will be like but I think there's always room for "just >> > >> the basics" i.e. a good old fashioned tutorial that doesn't go too >> > >> fast. I know we're into test driven development but I think doctest >> > >> is sufficient with noobs. Indeed, Python pedagogy is effective >> > >> because interactive... >> > >> >> > >> I could see PPUG offering a standard once month free class with >> > >> rotating presenter, then spin-off more advanced topic classes that fly >> > >> when they fill, sort of Saturday Academy still. Having something like >> > >> a fixed schedule for the free ones, then scrambling amongst ourselves >> > >> to always have an instructor, would be a fun way to make PPUG a >> > >> stronger glue maybe. Just a thought. >> > >> >> > >> Kirby >> > >> _______________________________________________ >> > >> Portland mailing list >> > >> [email protected] >> > >> http://mail.python.org/mailman/listinfo/portland >> > >> >> > > -------------- next part -------------- >> > > An HTML attachment was scrubbed... >> > > URL: < >> > >> http://mail.python.org/pipermail/portland/attachments/20090401/a977a3dd/attachment.htm >> > > >> > > _______________________________________________ >> > > Portland mailing list >> > > [email protected] >> > > http://mail.python.org/mailman/listinfo/portland >> > > >> > _______________________________________________ >> > Portland mailing list >> > [email protected] >> > http://mail.python.org/mailman/listinfo/portland >> > >> -------------- next part -------------- >> An HTML attachment was scrubbed... >> URL: < >> http://mail.python.org/pipermail/portland/attachments/20090401/c9253473/attachment.htm >> > >> _______________________________________________ >> Portland mailing list >> [email protected] >> http://mail.python.org/mailman/listinfo/portland >> > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > <http://mail.python.org/pipermail/portland/attachments/20090402/325976de/attachment.htm> > _______________________________________________ > Portland mailing list > [email protected] > http://mail.python.org/mailman/listinfo/portland > _______________________________________________ Portland mailing list [email protected] http://mail.python.org/mailman/listinfo/portland
