Re: models and NULL in postgres

2012-03-15 Thread Donald Stufft
Django uses an empty string instead of a NULL for an empty value for CharField and Charfield subclasses On Thursday, March 15, 2012 at 10:18 PM, hack wrote: > Something is a little strange with my database. My models have fields where > the value is set as blank=True to allow null values.

Re: Why can't forms access the request object?

2012-03-11 Thread Donald Stufft
On Sunday, March 11, 2012 at 12:43 PM, shacker wrote: > On Sunday, March 11, 2012 6:24:30 AM UTC-7, skhohlov wrote: > > Of course form does not have access to the object. > > > skholov - Thanks, but you misunderstand my question. Again, I know that forms > don't have access to request, and

Re: Why can't forms access the request object?

2012-03-11 Thread Donald Stufft
Forms aren't only usable from inside a view. On Sunday, March 11, 2012 at 4:32 AM, shacker wrote: > I recently needed to access request.user in a form, and found that I > couldn't. Found many articles describing ways to accomplish this, such as > James Bennett's [1]. > > I did get it

Re: Homakov-esque Django Vulnerabilities

2012-03-06 Thread Donald Stufft
On Tuesday, March 6, 2012 at 7:11 PM, Russell Keith-Magee wrote: > > On 07/03/2012, at 7:55 AM, Joey Espinosa wrote: > > > I agree with you on some of your points. Security can be improved if people > > would email the support team INSTEAD OF filing a bug report (this goes for > > any

Re: I need a package.

2012-02-03 Thread Donald Stufft
https://github.com/eldarion/user_messages On Friday, February 3, 2012 at 3:16 AM, coded kid wrote: > Anyone knows about a django package that can be use by users to send > private messages to each other? -- You received this message because you are subscribed to the Google Groups "Django

Re: Social conference website?

2012-01-12 Thread Donald Stufft
There's https://github.com/pinax/symposion but i'm not sure what you mean by "social". On Thursday, January 12, 2012 at 1:18 PM, Alec Taylor wrote: > Good morning, > > I am building up a social-conference website in Django for a > university clubs' comedy-revue. > > I will open-source it

Re: Directory layout for a large Django application (not project)

2012-01-10 Thread Donald Stufft
On Tuesday, January 10, 2012 at 1:13 PM, IgorS wrote: > First of all, thanks a lot to everyone who replied :-) > > Tom: > > As i mentioned, i am new to Django and could be missing big parts. > Please do not hate me too much for my naivete :-) > > The approach you suggested regarding the

Re: Interface implementation in python

2012-01-04 Thread Donald Stufft
Why not use zone.interface On Wednesday, January 4, 2012 at 7:07 AM, huseyin yilmaz wrote: > Hi everybody, > > I want to implement interface functionality in python. I wrote > following sample code > > https://gist.github.com/1559689 > > Here I use an abc as an interface. > Couple of my

Re: {% elif %} error

2011-12-27 Thread Donald Stufft
Or back port the elif tag (which may or may not be non trivial). On Wednesday, December 28, 2011 at 1:50 AM, Russell Keith-Magee wrote: > On Wed, Dec 28, 2011 at 2:44 PM, Tsung-Hsien (mailto:jasoniem9...@gmail.com)> wrote: > > Hi, > > I want to use {% elif %} > > my

Re: DoS susceptability via email logging

2011-12-08 Thread Donald Stufft
On Thursday, December 8, 2011 at 7:33 PM, Russell Keith-Magee wrote: > On Thu, Dec 8, 2011 at 8:42 PM, Sam Berry (mailto:samkbe...@googlemail.com)> wrote: > > Hello there, > > > > I am currently running a number of small sites using logging via email > > to notify me

Re: filesystem path in settings.py

2011-12-08 Thread Donald Stufft
The static files app doesn't serve static files (except in development). What it's primary purpose is to take a list of "finders", and locate all of the static files from a variety of places, and collect them into one directory. This allows reusable apps to package static files within their

Re: Caching at model class level

2011-11-03 Thread Donald Stufft
Normally this is cached using the Django caching framework, this lets you save it in memcache, redis, etc On Thursday, November 3, 2011 at 10:22 AM, Thomas Guettler wrote: > Hi, > > I try to reduce the number of db-queries in my app. > > There is a model which changes almost never. It is

Re: Long usernames in auth_user?

2011-10-26 Thread Donald Stufft
This is a known limitation and it's something that people _want_ to get fixed (but just merely increasing the length isn't helpful, because soon someone comes along with the new length + 1 and the same problem occurs). The issue is that the django.contrib.auth User model while providing a

Re: Templates available to a cluster

2011-10-19 Thread Donald Stufft
mplate Loader too. I'm mainly concerned with this being a large > bottle neck for our front-facing pages so I'm not sure which path to choose. > Maybe some R is in order :) Thanks! > > On Wed, Oct 19, 2011 at 5:52 PM, Donald Stufft <donald.stu...@gmail.com > (mailto:donald.

Re: Templates available to a cluster

2011-10-19 Thread Donald Stufft
The template system uses pluggable loaders that can locate a template based upon it's name. So using that you can store your template anywhere. There is already an app for storing templates in the db, you could easily make one to store it somewhere else as well. On Wednesday, October 19,

Re: Getting into professional django development

2011-10-18 Thread Donald Stufft
+1 for Always Develop against a Release, and if you are forced to use a VCS checkout, at least use pip and pin your requirements to a specific point in the history for that VCS. On Tuesday, October 18, 2011 at 11:00 AM, Tom Evans wrote: > On Tue, Oct 18, 2011 at 3:47 PM, Paul Menzel

Re: a django question about "python manage.py syncdb"

2011-10-14 Thread Donald Stufft
You need a __init__.py in your models.py. You also need to import all your models into that __init__.py. If I recall you'll also want to set class Meta: app_label = "the name of your package" Because the models directory will screw up Django's ability to auto figure it out. On

Re: Second coming of Java?

2011-10-13 Thread Donald Stufft
+1 for what Tom said. Django is perfectly capable at working at every level of the web. While it's true that once you start scaling at super high loads that you start having to do some lower level stuff to cope, the same is true of any application framework really. If your shop prefers Java

Re: Second coming of Java?

2011-10-12 Thread Donald Stufft
I think it's a load of tripe. There's plenty ways to speed up Python. And it's fast enough. It's not about being the fastest, but about being fast enough to get the job done, and having an enjoyable experience writing your web application. Java is not that thing. On Wednesday, October 12,

Re: Ajax replacement in django

2011-10-12 Thread Donald Stufft
I don't think there's any reason to insult anyone, let's be civil. On Wednesday, October 12, 2011 at 10:50 AM, Chandrakant Kumar wrote: > > You are another 'garbage' product of our country's shitty education system. > > On 10/12/2011 08:09 PM, lankesh87 wrote: > > Actually my project guide

Re: How REST Access ?

2011-10-03 Thread Donald Stufft
TastyPie is also good and one that I prefer over Piston. On Monday, October 3, 2011 at 11:20 AM, Javier Guerra Giraldez wrote: > On Fri, Sep 30, 2011 at 10:23 PM, bino oetomo (mailto:b...@indoakses-online.com)> wrote: > > Dear All. > > > > Kindly please give me

Re: Question about losing port number.

2011-09-26 Thread Donald Stufft
I think you might be on the wrong mailing list… There's no PHP around these parts ;) On Monday, September 26, 2011 at 3:30 PM, Chen Xu wrote: > I have a general question about PHP: > So basically I have a link, and I want the href to be absolute., so I do > 'https://' .

Re: Removing SECRET_KEY from settings.py

2011-09-16 Thread Donald Stufft
$ cat settings.py …. try: from local_settings import * except ImportError: pass $ cat local_settings.py …. SECRET_KEY = "blah" On Friday, September 16, 2011 at 8:54 PM, Tim Chase wrote: > Just returning to some Django work after a time away, I > (re)started an old project in 1.3 and

Re: When is a good time to use db_index? Rule of thumb?

2011-09-15 Thread Donald Stufft
To expand, a better answer is when you have profiled your application and have shown a bottleneck, and have tested it with an index on that column and seen an improvement. db_index isn't free, it incurs a penalty on writes so you need to be careful when using them. On Friday, September 16,

Re: Class-based views or "Traditional" Views for Django 1.3?

2011-09-14 Thread Donald Stufft
: > OTOH, getting the hang of it can be hard with the current state of the docs > and given that they require a completely different mindset when coding views. > > > Cheers, > AT > > On Wed, Sep 14, 2011 at 10:35 AM, Donald Stufft <donald.stu...@gmail.com > (mailto:d

Re: Class-based views or "Traditional" Views for Django 1.3?

2011-09-14 Thread Donald Stufft
Class Based Views let you override and subclass views to modify their behavior, I find them to be very quick once you get the hang of them. On Wednesday, September 14, 2011 at 9:33 AM, Kurtis wrote: > Hey Guys, > > I'm relatively new to Django 1.3. As others have noticed, there is > less

Re: two independent Django sites, one user - share User objects

2011-09-12 Thread Donald Stufft
You could pick one site to be your canonical site, and add it as a second db to the first, and then use a custom authentication backend to auth against that site, then create a local user with the same password hash. On Monday, September 12, 2011 at 7:38 AM, Markus Gattol wrote: > Say I have

Re: Streamlining DJango Deployment — Novel idea from the world of CMSs

2011-09-08 Thread Donald Stufft
oncept, because you are attempting to take > away the *need to understand* how things work. > > Cal > > > On Thu, Sep 8, 2011 at 12:37 PM, Donald Stufft <donald.stu...@gmail.com > (mailto:donald.stu...@gmail.com)> wrote: > > This is a hard question. It would prob

Re: Streamlining DJango Deployment — Novel idea from the world of CMSs

2011-09-08 Thread Donald Stufft
This is a hard question. It would probably be nice to offer a self contained deployment that nginx/apache could just proxy too, maybe pick that as the default, and then add in writing a fcgi or wsgi file for use with regular hosting. On Thursday, September 8, 2011 at 7:34 AM, graeme wrote: >

Re: Streamlining DJango Deployment — Novel idea from the world of CMSs

2011-09-07 Thread Donald Stufft
We talked a little on IRC, but just thought i'd reiterate my thoughts. This should not be in core, and I don't believe it ever has a chance of being in core. That being said, I think that an external "installer" app like this wouldn't be the worst thing in the world, and could help to make