Re: create a method that only one user can access in the same time

2009-09-30 Thread Kristaps Kūlis
Create locks and store them at cache as keys. Or implement counter as cache.incr('users_online') On Wed, Sep 30, 2009 at 3:52 AM, Nan wrote: > > Any particular reason you can't just use User.objects.count() ? > > On Sep 29, 7:16 pm, gustavo Cardoso wrote: > > Hello Folks, > > > > I need to impl

Re: Will it lost some features(middleware/contextprocessor) of Django when using Jinja2 ?

2009-10-04 Thread Kristaps Kūlis
Hi! You can use RequestContext (and also middlewares and context processor). Just pass it to jinja2 render method like this template.render(**context) See this blog post: http://lethain.com/entry/2008/jul/22/replacing-django-s-template-language-with-jinja2/ On Sun, Oct 4, 2009 at 2:36 AM, John

Re: Sites module, URLs and templates

2009-10-04 Thread Kristaps Kūlis
manage.py or patch it, because by default settings path is hardcoded in it. Sincerly yours, Kristaps Kūlis On Sat, Oct 3, 2009 at 1:41 AM, Joseph Wakeling wrote: > > Hello all, > > I'm making some first steps with Django having worked my way through > the tutorial. > > I

Re: trying to do ip based resolve

2009-10-04 Thread Kristaps Kūlis
You should and must do such things at middleware (as god intended). example: http://www.djangosnippets.org/snippets/845/ just return custom HttpResponse, not HttpResponseForbiden Kristaps Kūlis On Sun, Oct 4, 2009 at 8:41 PM, Kurt wrote: > > > I think I must be doing something fund

Re: Did the django tutorial change recently?

2009-10-04 Thread Kristaps Kūlis
Hello, I believe that http://djangobook.com/ uses books / publishers etc on examples. DjangoProject tutorial is about poll based app. Kristaps Kūlis What this country needs is a good five cent microcomputer.<http://wertarbyte.de/gigaset-rss/?limit=140&cookies=1&lang=de&

Re: Run a filter on path in {% extends %} tag?

2009-10-04 Thread Kristaps Kūlis
Hello, Just use RequestContext + context processor, which adds theme based context. Just use vars like base_template (which could be set to skin_basic_base.html by context processor). Hope you got the idea. Kristaps Kūlis What this country needs is a good five cent microcomputer.<h

Re: Creating Exchange 2007 Mailboxes via Django

2009-10-06 Thread Kristaps Kūlis
Hey, If you prefer cleaner way, then you can run django on iropython http://stackoverflow.com/questions/425990/django-on-ironpython and use .NET Powershell SDK for this purpose Kristaps Kūlis BOFH excuse #371: Incorrectly configured static routes on the corerouters.<http://wertarbyte.de/giga

Re: 3rd Party Auth or Session Management

2009-10-06 Thread Kristaps Kūlis
You can write auth backend to LDAP, so it will auth against LDAP See http://code.djangoproject.com/ticket/11526 About sessions: you can write custom session backend, with talks to OpenSSO server Kristaps Kūlis BOFH excuse #371: Incorrectly configured static routes on the corerouters.<h

Re: Creating Exchange 2007 Mailboxes via Django

2009-10-06 Thread Kristaps Kūlis
just for your knowledge : Python implementation under .NET http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython Kristaps Kūlis BOFH excuse #371: Incorrectly configured static routes on the corerouters.<http://wertarbyte.de/gigaset-rss/?limit=140&cookies=1&lang=de&

Require reverse foreign key

2009-10-09 Thread Kristaps Kūlis
Hello I have such models: Class Model1(models.Model): [content] Class Model2(models.Model): model1 = models.ForeignKey(Model1) How to ensure that Model1 has at least 1 referenced model ? data are added using django admin interface, which inlineadmins Kristaps Kūlis Reality is just a

Re: server performance

2009-10-09 Thread Kristaps Kūlis
&max_price=any&country=any Kristaps Kūlis Reality is just a crutch for people who can't handle science fiction.<http://wertarbyte.de/gigaset-rss/?limit=140&cookies=1&lang=de&lang=en&jar_id=10394735232565416737736263810940952> On Fri, Oct 9, 2009 at 12:36 PM, elmini

Re: Require reverse foreign key

2009-10-11 Thread Kristaps Kūlis
There can be multiple associated Model2 objects to Model1, but without one Model2 Model1 cannot exist. Kristaps Kūlis BOFH excuse #96: Vendor no longer supports the product<http://wertarbyte.de/gigaset-rss/?limit=140&cookies=1&lang=de&lang=en&jar_id=1039473523256541673773626

Re: High availability deployments

2011-03-24 Thread Kristaps Kūlis
See this blog post: http://rambleon.usebox.net/post/3279121000/how-to-gracefully-restart-django-running-fastcgi TL;DR : just send SIGHUP to flup process (pidfile option to fastcgi), like this: kill -SIGHUP `cat /path/to/flup.pid` I suggest using Gunicorn, as it handles graceful reloads better

Re: High availability deployments

2011-03-24 Thread Kristaps Kūlis
Hello, First of all, problem is not with lighttpd, but with flup On Mar 24, 8:29 am, Shamail Tayyab wrote: > Hi, > >    We have a setup in which we can't afford downtime (even while > deployment). > > Our setup is based on lighttpd + django (on fcgi via flup). What my > problem is, when we resta

Re: Advice: project hosting apps

2011-04-04 Thread Kristaps Kūlis
Hi, Redmine(Ruby on Rails) and Trac(Python) are two most popular alternatives. Redmine is far easier to setup for multiple projects. Both support Wiki / issue tracking and git :) Btw, Code.Djangoproject.com uses Trac. On Mon, Apr 4, 2011 at 4:25 PM, Peter Herndon wrote: > Hi all, > > I'm