django-cloudfiles

2009-06-24 Thread Ross Dakin
Hi everyone, I have a young project on github that lets you dump your site's static media to a CloudFiles account (a cloud storage service offered by Mosso / the Rackspace Cloud, which integrates with Limelite's CDN). http://github.com/rossdakin/django-cloudfiles/ And if you like the idea, how

auth.views.logout has pointless code

2009-03-21 Thread Ross Dakin
It looks like the " or request.path" does no good in the last line, since we're always going to have a next_page if we branch to that statement: def logout(request, next_page=None, template_name='registration/ logged_out.html'): "Logs out the user and displays 'You are logged out' message."

Re: How to create new User with Profile in elegant way

2009-03-10 Thread Ross Dakin
On Mar 9, 1:06 am, myst3rious wrote: > > If you're setting all these things in the User object, then reverse the > > logic slightly: > > >         new_user = User.objects.create(username=username, > >             email=email, > >             is_active=True, > >             first_name=firstname, >

Prepopulate username in login form

2009-02-24 Thread Ross Dakin
Would anyone else be interested in this? http://dpaste.com/hold/1272/ Ross --~--~-~--~~~---~--~~ 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

Re: Passing values to template

2008-11-18 Thread Ross Dakin
> Others already gave you practical answers, so this will be mostly a > more general ('conceptual' ?) advice: don't mix heterogenous data > (objects, whatever) in a list. If you have a compelling reason (ie : > ordering) to have heterogenous data, wrap them all in a same 'meta' > data structure.

Re: How to setup django-apache-mod_wsgi without killing existing php site?

2008-10-31 Thread Ross Dakin
I run prefork with mod_wsgi (embedded) and mod_php. No troubles so far, though I'm using MySQL with PHP and Postgres with Django, so I'm not likely to experience the MySQL library issues Graham described. I've read that mod_php actually doesn't like worker MPM, because come common PHP extensions

Re: Different settings.py files for server and development

2008-10-24 Thread Ross Dakin
I do it like this: # settings.py [ ... ] try: from settings_dev import * except ImportError: pass # settings_dev.py import os DEBUG = True DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = 'dev.db' MEDIA_ROOT = os.path.abspath('../') + '/public/media/' MEDIA_URL = 'http://127.0.0.1:8000/med

Re: Django Hosting Survey

2008-10-08 Thread Ross Dakin
Yes, you can load balance between slices, AND you can pool your bandwidth between them (new Slicehost feature). @NoviceSortof: Yes, I am running a Hardy install with 256 MB. My typical 'top' breakdown looks like: - 55% Apache (prefork) - 10% nginx - 5% mysql - 5% postgres - 5% et al. So m

Re: Django Hosting Survey

2008-10-07 Thread Ross Dakin
I'll chime in for Slicehost. I have the 256 plan and it's great. A few notes: 1) It is a time sink to set it up, but they have many tutorials online (publicly available) that do a great job of holding your hand if you aren't a Linux guru (like I'm not). 2) You'll want to fiddle with the Apache

Re: Why does Django generate HTTP 500 errors for static media when Debug is set to False?

2008-09-24 Thread Ross Dakin
Graham, I am using Apache and mod_wsgi, and I have experienced that issue before (500 errors for 404, et al.). I fixed it with some tinkering, but don't remember how. Would you mind explaining this problem a little? Thanks, Ross On Sep 23, 5:08 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote:

Re: IE Hell. Blank Page

2008-09-19 Thread Ross Dakin
On a related note, IE also chokes on trailing commas in arrays and such, e.g.: foo = [1, 2, 3,] --~--~-~--~~~---~--~~ 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@

Re: Field type for 13 digit positive integer?

2008-09-03 Thread Ross Dakin
I don't know about lookup speeds, but I believe the storage requirement would be smaller if you go with a numeric data type over characters: To represent all 13-digit unsigned integers, you need 47 bits (2^47 = 1.4 * 10^14). To represent a 13-character string (that may be composed of digits), yo

Re: Field type for 13 digit positive integer?

2008-09-03 Thread Ross Dakin
d field > > type in mysql. - > > I use bigint(13) usigned in MySQL and positiveintegerfield in Django. > You have to change it manually in the db after the tables got created. > > > -- Ross Dakin [EMAIL PROTECTED] (858) 699-2190 CONFIDENTIALITY NOTICE: The contents of this

Re: Regex

2008-07-02 Thread Ross Dakin
Hi Rajesh, Certainly, best practices are subject to your goals: code maintainability, storage efficiency, execution efficiency, etc. I agree, there are times when it makes sense to store calculated values in a database. I would argue, however, that this inhibits scalability. As a system grows, t

Re: Regex

2008-07-02 Thread Ross Dakin
Followup to clarify. If you DON'T use a is_longdistance flag in the model, then you use a set of rules to determine if a number is long distance when you get the number out of the db. You can avoid this by using a is_longdistance flag in the model, but you're going to have to do the same thing t

Re: Regex

2008-07-02 Thread Ross Dakin
> If you have the ability to change your Call model, you should consider > adding a new BooleanField called "is_long_distance" to Call. Then, you > only have to compute it (in Call.save()) when you save or change a > number. That will make your query very simple and efficient. > > -Rajesh D I wou

Re: html and TextField

2008-06-29 Thread Ross Dakin
Could you just un-escape the string before you pass it to your template? I haven't tried this, just guessing. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: views.py: Always a simple return?

2008-06-28 Thread Ross Dakin
By the way, don't be afraid of a couple XMLHttpRequests. If you had two or three per second, you could very well emulate a "real flow" of data. According to YSlow, the Google Groups page on which I'm reading this thread requires 28 HTTP requests (with empty cache), and it loaded in 2.18 seconds.