Feature Flipping with Gargoyle and Waffle

2011-11-30 Thread Adam Nelson
We just put out a post about feature flipping using Gargoyle or Waffle: http://tech.yipit.com/2011/11/30/getting-to-continuous-deployment-in-django-feature-flipping/ --- Adam Nelson CTO, Yipit Join the Yipit Team and work with Python, Django, MongoDB, jQuery, Backbone.js and Sass @ http

Re: Boolean test on queryset

2011-11-28 Thread Adam Nelson
Jirka, That doesn't solve the problem. That will still do a very expensive count() operation on the queryset. In fact, examples.count() is what happens when you do bool(examples) anyway. Thanks, Adam On Mon, Nov 28, 2011 at 8:11 PM, Jirka Vejrazka wrote: > Hi Adam,

Boolean test on queryset

2011-11-28 Thread Adam Nelson
When one tests for the boolean value of a queryset in the following way: examples = Example.objects.all() if examples: . do something You might think (I did) that Django will call a __nonzero__ special attribute that would either execute an EXISTS SQL STATEMENT or a SELECT statement

Python pre-commit hook for git

2011-11-16 Thread Adam Nelson
Hey all, We just put out a blog post on our Python pre-commit hook for git in case anybody is interested: http://tech.yipit.com/2011/11/16/183772396/ Cheers, Adam --- Adam Nelson CTO, Yipit Join the Yipit Team and work with Python, Django, MongoDB, jQuery, Backbone.js and Sass @ http

Deploying Django with Chef

2011-11-09 Thread Adam Nelson
All, We just put out a new blog post on how to use Chef to deploy a Django environment on Amazon ec2 (although any remote Python deployment will benefit from the article, not just Django): http://tech.yipit.com/2011/11/09/how-yipit-deploys-django/ Cheers, Adam -- You received this message

Re: Serve a tracking pixel via Django

2011-04-01 Thread Adam Nelson
On Thursday, March 31, 2011 10:56:44 PM UTC-4, Javier Guerra wrote: > > On Thu, Mar 31, 2011 at 7:18 PM, Russell Keith-Magee > wrote: > > Sure. Write a view that returns the content. It's 3 lines of code (a > > couple more if you count imports and whitespace). Added bonus

Serve a tracking pixel via Django

2011-03-31 Thread Adam Nelson
We have one static file that needs to be served after business logic has run (i.e. log a view on a specific url based on a unique code). We used to use serve() in production. This has always been frowned upon but with Django 1.3, the errors are worse. Can one return an image in any other

Re: Django Web Application Cost So Many memory

2011-03-30 Thread Adam Nelson
I think 60M is fine. For us, with nginx in front of gunicorn, we can get many simultaneous connections per process. -Adam -- 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

Darpa challenge

2009-10-29 Thread Adam Nelson
change.com/ I think the first thing that needs to happen is to get a critical mass of users on the site and to use the Q capabilities of the site to figure out what tools we should use next. Cheers, Adam Nelson --~--~-~--~~~---~--~~ You received this message b

Populating ChoiceField values in Form

2009-09-11 Thread Adam Nelson
I'm trying to limit the ChoiceField values of a given Form with a queryset: class TestForm(forms.ModelForm): category = forms.ModelChoiceField(queryset=TestModel.objects.filter (filtercriterion__id=1)) class Meta: model = TestModel In this example,

Using admin to update inherited models

2009-08-20 Thread Adam Nelson
-- Adam Nelson http://unhub.com/varud --~--~-~--~~~---~--~~ 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 g

Multiple Sites with minimal configuration

2009-07-10 Thread Adam Nelson
I'm creating a new project with pretty simple requirements: 1. A core set of methods for validating data which I will build. 2. The ability for a person with minimal skills to drop HTML form pages (2 or 3) for a given hostname (www.example1.com, www.example2.com, www.example3.com) that accept

Ignore Fixtures or Skip Fixtures

2009-04-08 Thread Adam Nelson
Is there any way to ignore fixtures when running syncdb? I'm using django-command-extensions and when using runscript from a previous datadump, I get a unique index violation. I'd like to be able to ignore fixture imports. Thanks for any help, Adam

Best Practices - Model Changes on Production servers

2009-04-07 Thread Adam Nelson
Is there a page that has any sort of list of Django rollout methodologies and best practices with regards to that issue? I'm trying to deploy some major model changes and although I'm fine doing everything manually, it would be nice to have some help (even just an ALTER TABLE generator). I've

Fixtures for django.contrib.sites.Site

2009-04-01 Thread Adam Nelson
}, ] And I get this error: ... File "/Library/Python/2.5/site-packages/django/utils/simplejson/decoder.py", line 221, in JSONArray raise ValueError(errmsg("Expecting object", s, end)) ValueError: Expecting object: line 10 column 1 (char 124) Any ideas for the correct model

Getting multiple values from a QuerySet

2009-03-13 Thread Adam Nelson
If I have a QuerySet like this: >>> o1 = Store.objects.all() >>> for o2 in o1: ...o2.employees.all() ... [, ...] Is there any way to get all employees for all stores without having to do the for (in other words some sort of one line solution)? I seem to need to do this frequently and it

Values from Reverse Generic Relations on multiple objects

2009-03-10 Thread Adam Nelson
http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#reverse-generic-relations I'm working with Reverse Generic Relations and I was wondering if there is a way to get the related objects for multiple objects in a simple way. For instance, based on the bookmark example of that link,

Self Join using QuerySet

2009-03-05 Thread Adam Nelson
Is it possible to do a self join using QuerySet? I'm looking to simulate a query like this: SELECT b.created_on, SUM(a.vote) FROM votes a JOIN votes b ON a.created_on <= b.created_on WHERE a.object_id = 1 GROUP BY 1 Which finds the sums for votes before the datetime of each vote.

Best way to deal with dictionaries of lists (equivalent of SQL GROUP BY)

2009-02-10 Thread Adam Nelson
I'm looking at the documentation here: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#regroup And am looking for the best practices way to deal with doing that from within the manager. This seems like a common issue: 1. I have two models, one foreign keys to the other (comments

Re: A Very Puzzling MySQL Issue Performance...

2009-02-06 Thread Adam Nelson
On Feb 5, 12:36 pm, dan0 wrote: > Hello, > > I am having an issue with my msyqld process responding to a query > after a moderate period of inactivity. I'll issue a simple query such > as "Person.objects.filter(name__icontains='Dan')", which would map to > about 5000

Re: A Very Puzzling MySQL Issue Performance...

2009-02-06 Thread Adam Nelson
Also, you could limit the result set to the number of records you actually need. 5k seems like an absurdly large result set. One final thing would be if you could pre-cull the Person data by narrowing it down to active users or something. The active_user field (if there is one), could quickly

Re: Installing Django to a newer version of python

2009-02-06 Thread Adam Nelson
> > how can I get mod_python, which is needed by apache, to load in the > > python 25 directoty and not in the 24 directory? > > If no prebuilt binary of mod_python is available that was compiled > against Python 2.5 then you must build mod_python from source code > yourself against Python 2.5. >

Re: Which Python are people using on OSX?

2009-02-06 Thread Adam Nelson
> 4. Use the macpython .dmg I've been using the app from http://wiki.python.org/moin/MacPython/Leopard and it works great. That's a nice clean 2.5.4 install. All my libs/ apps I get using pip and virtualenv which is a recent thing. On a recent install I did with a friend, we left the stock

Best Practices for debugging URL problems

2009-01-21 Thread Adam Nelson
I recently had what is a common issue for many Django developers: "No module named urls" What turned out to be the issue is that I had deleted one of the urls.py files accidentally because I deleted an app that I thought I was no longer being used but was in fact being called by the top level

TextMate Django Bundle

2008-12-17 Thread Adam Nelson
Does anybody have this working in TextMate? "Python Django Templates.tmbundle" >From http://macromates.com/svn/Bundles/trunk/Bundles/ I've installed other bundles and the Python Django.tmbundle, but the Templates one simply doesn't appear in the Bundles menu. Thanks, Adam

Re: Django Suitability

2008-10-23 Thread Adam Nelson
Matt, I feel your pain. It's probably not best on the Django forum to say this but: 1. Any modern framework is fine (Cake/PHP, Django/Python, Merb/Ruby, etc...) 2. Use a framework of some sort (don't just roll with 'Java' without some sort of web-specific framework for your needs) 3. Any real

Re: Setting up Django on CentOS5 with flup and fastcgi

2008-10-21 Thread Adam Nelson
I've had great luck with wsgi. http://code.djangoproject.com/wiki/django_apache_and_mod_wsgi http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango This article relates how to reverse proxy that with Nginx if you're interested (for speed, isolation):