rewriting URLs from foo.example.com/hello to example.com/foo/hello

2013-08-17 Thread Chris Curvey
Hey all, I have a django project going where we're going to be adding a bunch of small, independent sites. So I figured I would have one Django project to contain everything, then a separate app for each site, and just let folks to www.example.com/foo/hello, www.example.com/bar/goodbye, etc B

bug or programmer error when using logging.config.fileConfig

2013-07-08 Thread Chris Curvey
I'm not sure if this is a bug or my error, but I'm trying to use a legacy logging configuration in my django 1.5 app, like so: LOGGING = r"C:\path\to\logging.conf" LOGGING_CONFIG="logging.config.fileConfig" when I try to start my app, I'm getting ConfigParser.NoSectionError: No section: 'format

Re: am I understanding sessions correctly?

2012-01-17 Thread Chris Curvey
> > Yes, your caching seems a likely culprit, and so does the asynchronous > nature of you AJAX (but it seems like you've got a handle on that > part). I haven't thought through the load balancer bit yet, but > presumably they are all using the same cache / database / session > store..? > update -

Re: am I understanding sessions correctly?

2011-12-28 Thread Chris Curvey
Thanks for the thoughts, Stuart. On Dec 23, 2:08 pm, Stuart Laughlin wrote: > On Dec 22, 9:01 am, ChrisCurvey wrote: > > > The short version:  when processing a request, does Django *always* > > collect session information from the session store before starting the > > view? > > Yes. However note

am I understanding sessions correctly?

2011-12-22 Thread Chris Curvey
The short version: when processing a request, does Django *always* collect session information from the session store before starting the view? The long version: i have an application that makes heavy use of AJAX. When a user changes something on the page, the page fires an AJAX POST to apply t

Re: authentication switching mid-session

2011-03-31 Thread Chris Curvey
there's no cacheing in front of the application server, if that's what you're asking. The app server does do some cacheing on its own, but not related to sessions or users. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

authentication switching mid-session

2011-03-30 Thread Chris Curvey
When my Django system is under heavy load (system CPU > 90%), I start getting complaints from users that their authentication changes in the middle of a session. For example: 1) Bob logs in to the site. The site says "Hello Bob" at the top of each page. 2) Bob uses the site for a while without i

customizing emailed error messages

2010-05-06 Thread Chris Curvey
When I get an unexpected error in my mod_wsgi/Django application, I'm emailed a very nice error message with a stack trace and all the HTTP environment variables (GET, POST, META, etc.) That's great, but it does not include the name of the logged-in user. Is there a way for me to add that informat

Re: using "id" as a field name in ModelForm.

2010-04-01 Thread Chris Curvey
On Apr 1, 1:51 pm, Nick Arnett wrote: > On Thu, Apr 1, 2010 at 10:34 AM, Chris Curvey wrote: > > > class FoobarForm(ModelForm): > >  foo = forms.FloatField(label = '$') > >  id = forms.HiddenField() > > If you're using newforms, there's no su

using "id" as a field name in ModelForm.

2010-04-01 Thread Chris Curvey
this has got to be FAQ, but I can't find it for the life of me. I have an ordinary Django model class, which has been automatically been given a field called "id". Great. Now I want to use this field as a hidden value in a ModelForm, but whenever I add "id" to the list of fields in the form, I g

Re: 1.2 alpha, multiple databases, and raw SQL

2010-01-28 Thread Chris Curvey
> > from django.db import connections > > cursor = connections['mydb'].cursor() > cursor.execute('INSERT ') > > That is, the 'db.connection' object has been replaced with an index > called 'db.connections', keyed by database alias. Each of those > connections behaves as the single connection di

1.2 alpha, multiple databases, and raw SQL

2010-01-27 Thread Chris Curvey
Is there a way to use raw SQL with multiple databases? I thought it might be something like: from django.db import connection cursor = connection.cursor(using="mydb") but that complains about an unexpected keyword arg. -- You received this message because you are subscribed to the Google Group

Re: admin interface, foreign keys and subclasses

2009-12-24 Thread Chris Curvey
one a pattern like this? (One-to-Many, where the "Many" side can be a series of subclasses?) On Dec 23, 8:58 am, Chris Curvey wrote: > this may be beyond the current abilities of the Django auto-generated > admin interface, but I thought I'd ask... > > I have a class called

admin interface, foreign keys and subclasses

2009-12-23 Thread Chris Curvey
this may be beyond the current abilities of the Django auto-generated admin interface, but I thought I'd ask... I have a class called "Customer" which has a one-to-many relationship with "ServiceRequest". I've got that all working through the admin interface and it's working fine, like this: cla

Re: TemplateSyntaxError: 'property' object is not iterable

2009-12-18 Thread Chris Curvey
Never mind. Me am a moron. Had a totally different programming error elsewhere. It works as is it should. On Dec 17, 4:12 pm, Chris Curvey wrote: > I have my class definition that looks like > > class Foo: >    def get_bars(self): >       bars = [] >        # do someth

TemplateSyntaxError: 'property' object is not iterable

2009-12-17 Thread Chris Curvey
I have my class definition that looks like class Foo: def get_bars(self): bars = [] # do something to collect bar instances return bars bars = property(get_bars) in my template, I'd like to do something like this: {% for bar in foo.bars %} {{bar.snafu}} {% endfor %}

Re: imitating a spreadsheet (kind of) with formsets

2009-08-11 Thread Chris Curvey
On Aug 10, 10:13 pm, Malcolm Tredinnick wrote: > On Mon, 2009-08-10 at 19:07 -0700, Chris Curvey wrote: > > What I want to do is have a series of forms, all next to each other in > > table format, like this: > > > Car     Honda      Toyota       Chevy > > Price

imitating a spreadsheet (kind of) with formsets

2009-08-10 Thread Chris Curvey
What I want to do is have a series of forms, all next to each other in table format, like this: Car Honda Toyota Chevy Price $12,000$14,000 $10,000 MPG 30 2826 Color Blue Red Yellow (I'm sure that's going to look like crap in a

Re: user profiles and the admin

2009-07-29 Thread Chris Curvey
Drat. That's not it. I'll keep trying. On Jul 28, 5:01 pm, Asinox wrote: > im new , but i think that u need this part: > > class UserProfileAdmin(UserAdmin): >     inlines = [UserProfileInline] >     list_display = ('user', 'sex','phone&#

user profiles and the admin

2009-07-28 Thread Chris Curvey
I'm having a bit of a brain cramp here...I'm trying to add some extra fields to my user profiles, but I can't seem to get the fields to show up in the admin interface. I've added the admin.py directory to my application root, but the fields obstinately will not show up in the admin interface. The

Re: finding out what SQL Django generated

2009-04-15 Thread Chris Curvey
On Apr 15, 4:25 pm, Alex Gaynor wrote: > On Wed, Apr 15, 2009 at 4:23 PM, Chris Curvey wrote: > > > I'm getting unexpected results from a database query that was > > generated by Django, and I'm sure the problem is that I'm mis-using > > the API.  Is th

finding out what SQL Django generated

2009-04-15 Thread Chris Curvey
I'm getting unexpected results from a database query that was generated by Django, and I'm sure the problem is that I'm mis-using the API. Is there a way to get Django to tell me what SQL was sent to the database server? (Sorry if this is a FAQ, I've been looking for a while. Pointers to docs g

multiple object form?

2005-11-08 Thread Chris Curvey
this must be possible, but it's escaping me... How would I go about creating a form that allows me to answer multiple poll questions on the same page? I'd like my resulting HTML to look something like What's up The sky Not m