Re: Web Platform Contest
Juergen Barth wrote: > Maybe this is interesting for some Djangoers out there? I wanted to ask but you beat me ;) So, anyone else wants to participate ? kindly regards Daniel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Locking problem with mod_python
Ivan Sagalaev wrote: > As Ian has pointed you can use file system as a device for locking > between separate processes. This is not really something specific to Django. Yes i know. There would be other solutions like shm, or global mutexes, but filelocks seem to be the best of the worst. However, on a apache with worker mpm, thread locks are definitive the best choice and allow easy usage of Semaphores etc, too. I think django should have a Lock class and maybe Semaphores, too, which check which type of server the app is running and choose the best locking method. Django already has a RWLock class under utils/sync.py, which is simply not working on all servers. If you use apache 1.3, or apache2.x with mpm-prefork or the experimental threadpool, or worker with more then one instance, thread locks are useless. I think providing a easy to use Locking class that works regardless the server used is something important for a web framework. > On Windows, if I remember correctly, you don't use fcntl but use some > exclusive locking options for open(). I don't use open, but python2.4 docs suggest using fp.lock() as a platform independent function. kindly regards Daniel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Locking problem with mod_python
Ian Holsman wrote: > aren't semaphores inter-process (not cross process)? > > try using a file handle instead.. After further investigation, i found out that locking of any kind doesn't work with apache in prefolk mode, and more or less in the threaded mode. I haven't found a nice and clean solution yet to do locking on requests, which worries me a little bit. Locking can be a important part of apps and I think django should provide a way to have working locks regardless which server backend is used. kindly regards Daniel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Locking problem with mod_python
Hi, I have a function that generates a tile for a google map overlay and writes it to disc so later requests can simply use the file. Due the nature of the map, generating the tiles previous is not a option so it has to be done on demand, which works nice on the developer server but not on apache. There are many requests for tiles and the calculation is expensive, so I want to limit apache to only generate one tile at the time. I used something like this: from threading import Semaphore # create Basemap instance. Use 'crude' resolution coastlines. GENSEM = Semaphore(settings.TOPO_MAX_TILE_THREADS) def get_topoimg(request): ... def gen(): print "Lock GENSEM" GENSEM.acquire() topoimg(x, y, zoom, typ, name, rstate) GENSEM.release() print "Unlock GENSEM" return True rv = return_cached_file(name, gen, rebuild=False) ... TOPO_MAX_TILE_THREADS is 1 In developing mode and apache2 -X the Semaphore seems to work. If topoimg raises a exception, the next request hangs. But in normal apache mode the semaphore doesn't seem to have any affect, causing very high load on the machine. What am I doing wrong ? kindly regards Daniel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
For those who like map meshups
Hi, for the open mesh network app i'm writing, I needed a way for creating a topology overlay in google maps. Using polygons was simply to slow, so I decided to render my own tiles. I use matplotlib + basemap for generating the tiles on demand. On my lokal machine that works nice, but on the totaly overloaded production server i had to disable it. But I'm working on it... Anyways, those how are interested, sources are at: http://ff-firmware.quamquam.org/trac/browser/ffsomething/trunk/apps/uptime/topoimg.py kindly regards Daniel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Checking For Existing Rows
Tyson Tate wrote: > However, raising an exception on "success" irks the part of me that > studied computer science for 3 years, so I'm wondering if anyone > knows of any other ways I might be able to achieve the above in a > better way. Compared to other languages, exception in python are very cheap operations. On C level, the function just returns a null pointer instead of a PyObject pointer and setting the two stack values for exception type and value isn't expensive eighter. In fact, it's so cheap that functions like has_key just try to access the value or return 0 on exception :) kindly regards Daniel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django-based wiki engine
iGL wrote: > Hi, > Has anybody been working on a django-based wiki engine on the lines of > django.contrib? > I'd much appreciate hints on such projects... I'm working on a django wiki, whoever it will need some weeks for a more or less useable state. It's part of a django suite for public mash networks: http://ff-firmware.quamquam.org/trac/browser/ffsomething/trunk kindly regards daniel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: Django API doc
Adrian Holovaty wrote: > Nicely done! I think for the final product we'd want Wilson's loving > design touches. Also, this does a good job of pointing out the areas > in which we need to add docstrings. this will not be fun for wilson ;) the html code really sucks at some parts. i had some more django style in it, turned out the html just doesn't fit :( and cleanup of the css is required, too. some styles i haven't seen used, but maybe generated... maybe he can make the current one better :) by the way, bug is http://code.djangoproject.com/ticket/1248 kindly regards daniel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Django API doc
Hi, i created a css to build a django styled API doc with epydoc. http://djangoapi.quamquam.org/ Beta Version :) I hope we can integrate it as http://api.djangoproject.com someday. kindly regards daniel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~--~~~~--~~--~--~---
Re: SQLite threading
David S. wrote: > So anyway, is it a reasonable assertion that if the app is actually to have > more > than 1 user--and in fact if it is going to run with Apache--then SQLite is > right > out? No, trac for example uses sqlite, too and it runs fine. I don't know about this particular behaviour, but maybe the sqlite faq will give you some answers about that. Are you creating a thread in your app that makes changes on your database ? kindly regards daniel
Re: what is the best way to capture the subdomain and send it to a view?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Le Roux wrote: > Thanks. I'll do that. It just feels like that type of thing should > happen outside of the view (and come to the view as a parameter). The > other thing is that _all_ my views will need this and to me that just > feels a bit dirty. I guess it is probably the best way, though. I suggested on the devel ml, that the urlresolver should be configurable, which would you allow to write an own which also uses the hostname to match sites. or even write one that uses a database :) hopefully they like the idea. kindly regards daniel -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2 (GNU/Linux) Comment: GnuPT 2.7.2 Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDvXFly/mkIQp7AD0RAqBXAKCq+WoHMqky1DVJyo/QRkcggJ0LTQCePClE DAER0y/KzG32BgKkvFN8yz8= =0RbJ -END PGP SIGNATURE-