Re: error on live server, 'module' object has no attribute 'models'

2008-10-03 Thread Malcolm Tredinnick
On Fri, 2008-10-03 at 08:55 +0200, Timothy Kanters wrote: > I have a strange error on my live server. On the development server > everything works just fine. > > About half the time I get an error: > > ViewDoesNotExist at /companies/ > Tried list in module vicrsa.companies.views. Error was: 'mo

Dumb question about "Limiting Access to Generic Views"

2008-10-03 Thread Mirto Silvio Busico
Hi all, I have a dumb question, but any help will be greately appreciated. I'm trying to create a django site with most (but not all) pages are accessible only for authenticated users. I'm using the "@login_required" decorator; but I'm not able to impose this on generic views. Chapter 12 of D

Re: Django site speed - I think I have a problem with my config!

2008-10-03 Thread Graham Dumpleton
[EMAIL PROTECTED] wrote: > Hi guys, > > Firstly, I want to say that I've had some great help from you guys so > far - you've really helped me solve a lot of problems. I'm looking > forward to the time when I have enough experience to answer other > questions! > > Anyway...I'm having quite a bit

Re: Q about a ticket and merging into svn

2008-10-03 Thread Gerard Petersen
Russel, I examined the svn tree and the patches. It seems that the diffs are for the widget.py file under 'newforms', but this directory does not exist in the svn tree. I've tried appending the widget classes from the ticket to: /usr/lib/python2.5/site-packages/django_src/django/forms/widgets

Re: post_save signal and multi-table inheritance

2008-10-03 Thread Ant
Thanks for the suggestion. I was thinking that approach might cause my app to get hammered unnecessarily, but perhaps it won't be a big deal. --ant On Oct 2, 9:21 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > On Oct 2, 10:46 am, Ant <[EMAIL PROTECTED]> wrote: > > > > > Going with the multi-tabl

Re: Django site speed - I think I have a problem with my config!

2008-10-03 Thread [EMAIL PROTECTED]
Thanks Graham, Regarding the authentication, I am behind a basic auth because this is a development server so I need to enter a username/password to access it. I also use -C (although I didn't write it here) to pass a cookie on pages that have session info associated with them. However for the ti

PYTZ showing error on live host

2008-10-03 Thread cschand
Hi all I have a problem with pytz. In my local system i tried with pytz and its working fine >>> from pytz.tzfile import build_tzinfo >>> import os.path >>> base = os.path.join(os.getcwd(), 'external_apps/pytz/zoneinfo') >>> tz = build_tzinfo('US/Eastern', open(os.path.join(base, 'US', 'Easter

Help with login

2008-10-03 Thread hcsturix74
HI, I've upgraded my site to django 1.0 from 0.96 and I've installed "user registration" app from googlecode. My homepage is a flatpage but I want to insert a login form (just a form with username and password) How could I do that? Can you suggest how to do it? User Registration app uses django.c

Re: 'next' value in comment post/preview

2008-10-03 Thread Eric Abrahamsen
On Sep 23, 11:07 am, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > Somewhat pursuant to this > thread:http://groups.google.com/group/django-users/browse_thread/thread/a0c4... > > a hidden 'next' field in the comment post form doesn't get carried   > over to the comment preview view. It seems lik

Re: postgres hangs indefinitely on many model inserts. anyone seen this?

2008-10-03 Thread bruno desthuilliers
On 3 oct, 06:38, dan90 <[EMAIL PROTECTED]> wrote: > I'm picking through some nasty problems with postgres connections on > my django install. Bascially, if I do "a lot" of rapid selects and > inserts on some models with "a lot" of mutual foreign key constraints, > the database connection hangs ind

MultiValueDictKeyError for attach = forms.FileField(required=False)

2008-10-03 Thread laspal
Hi, I am getting MultiValueDictKeyError -> Exception Value: "Key 'attach' not found in " I have made filefield as required false but in the form when attach field is empty I am getting above error.. but when all the fields are filled its work fine. Can someone help me out why I am getting

Re: Q about a ticket and merging into svn

2008-10-03 Thread Russell Keith-Magee
On Fri, Oct 3, 2008 at 5:13 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote: > > I examined the svn tree and the patches. It seems that the diffs are for the > widget.py file under 'newforms', but this directory does not exist in the svn > tree. I've tried appending the widget classes from the tic

Re: PYTZ showing error on live host

2008-10-03 Thread cschand
I tracked where the error coming form. It's at the time of reading the file In local system the output is >>> import os.path >>> base = os.path.join(os.getcwd(), 'external_apps/pytz/zoneinfo') >>> zone = 'Australia/Melbourne' >>> fp = open(os.path.join(base, 'Australia', 'Melbourne'), 'rb') >>>

Re: Dumb question about "Limiting Access to Generic Views"

2008-10-03 Thread Mirto Silvio Busico
Replaying to myself To find the generic view def look at (at least in Debian): /usr/share/python-support/python-django/django/views/generic/list_detail.py In this file there is the definition of object_list and object_detail So the urls are: (r'^libri/$', 'mysite.biblioteca.views.lista_libri'

File reading error - Different results on localhost and live server

2008-10-03 Thread cschand
On Oct 3, 5:03 pm, cschand <[EMAIL PROTECTED]> wrote: > I tracked where the error coming form. It's at the time of reading the > file > > In local system the output is > > >>> import os.path > >>> base = os.path.join(os.getcwd(), 'external_apps/pytz/zoneinfo') > >>> zone = 'Australia/Melbourne'

sub classes handling

2008-10-03 Thread Alessandro
I need a Class Document with a ManyToMany field Paragraph. The M2M field permits different document instances to have the same paragraphs, and I don't want to. Is it possible to limit the sub class to its parent class? The same with images: I want to add one or more images to a document, but I d

Re: error on live server, 'module' object has no attribute 'models'

2008-10-03 Thread Timothy Kanters
Well,.. the strange thing is though that this only happens some of the time not all of the time. And I also haven't yet been able to predict when it happens. I doubt it is an python syntax error, since the files are fairly small and they do work most of the time. I do nothing fancy in them either.

Django site speed - I think I have a problem with my config!

2008-10-03 Thread [EMAIL PROTECTED]
Hi guys, Firstly, I want to say that I've had some great help from you guys so far - you've really helped me solve a lot of problems. I'm looking forward to the time when I have enough experience to answer other questions! Anyway...I'm having quite a bit of difficulty figuring out what is making

Re: Dumb question about "Limiting Access to Generic Views"

2008-10-03 Thread Keith Eberle
The view function should look something like this: from django.views.generic.list_detail import object_list @login_required def xxx(request): return object_list( request, queryset=MyObject.objects.all(), ) Pass in other parameters necessary, like template_name, etc... k

django performance with cache on dreamhost.

2008-10-03 Thread Alessandro
is it normal that a cached page on dreamhost (I'm using passenger to connect apache and django) gives this results of 4.9 req/s? httperf --hog --timeout=10 --client=0/1 --server=www.animalisenzacasa.org --port=80 --uri=/ --rate=5 --send-buffer=4096 --recv-buffer=16384 --num-conns=200 --num-calls=

Vague, annoying, login problem

2008-10-03 Thread Robocop
I'm running out of ideas, so i decided to see if anyone could offer any advice on a problem i'm having. I'm trying to finish up a site with some 'dummy' login functionality. Dummy meaning that it doesn't do anything right now besides offer demographic information through registration, so it's ve

Re: Catching Exceptions thrown in .save() - django 1.0

2008-10-03 Thread bruno desthuilliers
On 3 oct, 01:34, Michael <[EMAIL PROTECTED]> wrote: > On Thu, Oct 2, 2008 at 6:23 PM, bruno desthuilliers < > > > > [EMAIL PROTECTED]> wrote: > > > On 2 oct, 16:51, Michael Newman <[EMAIL PROTECTED]> wrote: > > > Kurczak; > > > > Short of this is, catching specific errors in the save method and

Re: Django model version control

2008-10-03 Thread Erik Allik
What if, for each model under version control, you'd create an identical table (except the ID field would be a foreign key, not a primary one). Any time a migration is run on that model, the same migration could be run on the "twin" table, too. Erik On 02.10.2008, at 18:34, David Hall wrot

Questions about HttpResponseRedirect and reverse

2008-10-03 Thread Alexis Bellido
Hello, I was reading this discussion: http://groups.google.com/group/django-users/browse_thread/thread/d2d9ed6599089301 There Donn asks: "Lastly, on the decoupling thing again, if I end up using (sometime) HttpResposeRedirect(reverse(project.app.view)) does that not tie the view to the app to t

Using datepicker outside of admin

2008-10-03 Thread jeffhg58
Before Django 1.0, I was successful able to use the datepicker outside of admin within my own application. But, since the upgrade I get a runtime error with a syntax error on line 1. This error occurs with the following line This error only occurs when the user does not have administrative capa

Re: Simple Invoices & Django

2008-10-03 Thread Carl Meyer
On Oct 3, 2:37 am, Gour <[EMAIL PROTECTED]> wrote: > I'm quite new with Python & Django but enthusiastic to work on 'porting' > Simple Invoices - PHP invoicing system - to Django > (seehttp://simpleinvoices.org/). Hi Gour, The django-developers list is solely for work on developing Django itsel

Re: Django site speed - I think I have a problem with my config!

2008-10-03 Thread julianb
On Oct 3, 10:08 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Is there anything really obvious that I may be missing? Any debug > settings I may have forgotten to turn off? I've set > MaxRequestsPerChild to 10 so I don't think that it's that. > PythonDebug is off in httpd.conf. Did you

Mod_python

2008-10-03 Thread djandrow
I just bought a new laptop and want to install mod_python, is there a version which is compatible with Python 2.6, I tried the 2.5 version but it wouldn't let me install that with 2.6. If there isn't a 2.5 version what would people recommend I do? Thanks. Regards, Andrew --~--~-~--~~

Re: Simple Invoices & Django

2008-10-03 Thread Carl Meyer
Whoops, sorry Gour! Got mixed up on which list I was reading. As you were... --~--~-~--~~~---~--~~ 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 T

Re: Questions about HttpResponseRedirect and reverse

2008-10-03 Thread Alexis Bellido
Cool, thanks for the confirmation. I'm still devouring all the documentation, a couple of books and practicing a lot on Django :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Simple Invoices & Django

2008-10-03 Thread Gour
Hi! I'm quite new with Python & Django but enthusiastic to work on 'porting' Simple Invoices - PHP invoicing system - to Django (see http://simpleinvoices.org/). I've asked main developer about it and although SI is now working towards Zend, he likes the idea. (see http://simpleinvoices.org/forum

Can't add more than 2 items in stacked/tabular inlines using tutorial part 2

2008-10-03 Thread Rob Goedman
Hi, Using Django svn rev 9111 I ran into an issue using the admin. To create a reproducible example I went back to the Django Poll/Choice tutorial, part 2. With below models.py and admin.py, I can create a new Poll, add the 1st choice and save, add the 2nd and save, but that's it. After tha

Re: error on live server, 'module' object has no attribute 'models'

2008-10-03 Thread R. Gorman
If it only happens some of the time it often indicates you need to restart your http server. R. --~--~-~--~~~---~--~~ 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: Can't add more than 2 items in stacked/tabular inlines using tutorial part 2

2008-10-03 Thread Karen Tracey
On Fri, Oct 3, 2008 at 12:43 PM, Rob Goedman <[EMAIL PROTECTED]> wrote: > Hi, > > Using Django svn rev 9111 I ran into an issue using the admin. To > create a reproducible example I went back to the Django Poll/Choice > tutorial, part 2. > > With below models.py and admin.py, I can create a new Po

Django Coding Style and PEP 257

2008-10-03 Thread [EMAIL PROTECTED]
I see that http://docs.djangoproject.com/en/dev/internals/contributing/#coding-style prefers docstrings like """Calculates something and returns the result.""" to those like """Calculate something and return the result.""". That is, it prefers the descriptive form rather than the imperative. PE

displaying list from dictionnary -django 1.0

2008-10-03 Thread tsmets
I have an application that records the status of an applications. Basically something like : _ started-request _ started _ stop-requested _ stopped + some technical informations (version, host, URL, ...) I thought having a page that display per environment : dev, test, acceptance, prod the s

Re: Can't add more than 2 items in stacked/tabular inlines using tutorial part 2

2008-10-03 Thread Rob Goedman
Hi Karen, Right on, thank you. The patch provided in the ticket fixes the problem. I do use PostgreSQL. I should have checked the ticket list! Thanks again, Rob On Oct 3, 2008, at 9:57 AM, Karen Tracey wrote: > On Fri, Oct 3, 2008 at 12:43 PM, Rob Goedman <[EMAIL PROTECTED]> wrote: > Hi, > >

Re: Questions about HttpResponseRedirect and reverse

2008-10-03 Thread Steve Holden
Alexis Bellido wrote: > Cool, thanks for the confirmation. I'm still devouring all the > documentation, a couple of books and practicing a lot on Django :) > One of the things I find tricksiest about learning new Django code is that the connections between the URLs and the views can often turn

Re: django performance with cache on dreamhost.

2008-10-03 Thread Erik Allik
Have you profiled your application? How many SQL queries is it doing during a request processing cycle? You could write a web app in pure asm code and still get 1 req/sec if you did something really stupid in your code so it's not generally about Django. Erik On 03.10.2008, at 16:32, Ales

SESSION_SAVE_EVERY_REQUEST behavior is overkill

2008-10-03 Thread Huuuze
I recently added "SESSION_SAVE_EVERY_REQUEST". As the name implies, the session ID is changed for every request made to the server. IMO, this is overkill. If your page has 10 images on it, the session ID will be changed 11 times (once for the initial page request and then 10 more times for each

Re: SESSION_SAVE_EVERY_REQUEST behavior is overkill

2008-10-03 Thread Karen Tracey
On Fri, Oct 3, 2008 at 1:58 PM, Huuuze <[EMAIL PROTECTED]> wrote: > > I recently added "SESSION_SAVE_EVERY_REQUEST". As the name implies, > the session ID is changed for every request made to the server. IMO, > this is overkill. If your page has 10 images on it, the session ID > will be changed

Editable template code in admin?

2008-10-03 Thread Dana
Hey All, I checked out django-chunks at google code the other day and was interested in it initially but then realized that I could not inject actual template code and have it render in the templates. I am wondering if this is even possible and if so, how could I manage to accomplish this? For ex

Re: displaying list from dictionnary -django 1.0

2008-10-03 Thread David Durham, Jr.
On Fri, Oct 3, 2008 at 12:13 PM, tsmets <[EMAIL PROTECTED]> wrote: > I have an application that records the status of an applications. > Basically something like : > _ started-request > _ started > _ stop-requested > _ stopped > + some technical informations (version, host, URL, ...) > > I tho

Re: cannot save model to db

2008-10-03 Thread Manuel Meyer
Great tip, Thanks! Here my code, just in case someone is interested: from django.db import models from django.utils.translation import ugettext as _ import Image as PilImage import settings as s import os class Gallery(models.Model): title = models.CharField(_("Name"), max_length=200)

custom field problem w/Django v1.0

2008-10-03 Thread Siemster
Greetings, I'm in the process of porting an application from Django v0.96 (using Python 2.3) to v1.0 (using Python 2.4). I had been using django.core.validators, but since that doesn't exist in v1.0 I'm trying to replace the functionality with a custom field. The code that I'm using is as follow

Re: Catching Exceptions thrown in .save() - django 1.0

2008-10-03 Thread bruno desthuilliers
On 3 oct, 15:44, bruno desthuilliers <[EMAIL PROTECTED]> wrote: (snip) Re-reading this (wrote it a bit in hurry) I'm afraid the tone is a bit harsh and controversial. Michael, please accept my apologies, I didn't mean to flame you - just explain why I disagree with you on this point. --~--~--

Re: Admin UI Problems

2008-10-03 Thread varikin
On Oct 2, 4:14 am, jordanwlee <[EMAIL PROTECTED]> wrote: > when installing django-cms make sure to COPY the > /projectname/media/admin/cms files (admin.css cmslayout.css > DateTimeShortcuts.js etc..) to > /django_trunk/django/contrib/admin/media/ > into a "cms" folder > so it looks like: > /djan

Resizing images when uploading

2008-10-03 Thread Juanjo Conti
Hi, I used to use a pre 1.0 svn version of Django. There I had this class: class Foto(models.Model): descripcion = models.CharField(max_length=30, blank=True, verbose_name=u"descripción") imagen = models.ImageField(upload_to='imagenes', verbose_name=u"foto") inmueble = models.ForeignK

Re: Questions about HttpResponseRedirect and reverse

2008-10-03 Thread Donn
On Friday, 03 October 2008 16:53:02 Alexis Bellido wrote: > I'm not sure if I understand Malcolm's suggestion, is he talking about > using named URL patterns as documented here? Yes he is. They are quite tricky little devils and cause me much pain, but that's because I am too impatient and have a

Re: Django model version control

2008-10-03 Thread jonknee
On Oct 1, 11:25 am, David Hall <[EMAIL PROTECTED]> wrote: > I've just released an open-source version control application for > Django.  It is available for download from Google code. Neat idea! I installed it and while it works for rolling back, it does not work bring back deleted items. I did a

Re: Updating path and filename of ImageFieldFile

2008-10-03 Thread Juanjo Conti
Matt, I'd like to resize an uploaded image, while uploading i think... before it gets saved to the hard disk. How did you do it? In pre 1.0 version I redefined _save_FIELD_file from my class. Thanks, 2008/8/14 mcordes <[EMAIL PROTECTED]>: > > Thanks Andy, > > Using the callable for upload_to is

select_related and intermediary tables

2008-10-03 Thread Robert
I've been banging my head against this problem for several days now, and have decided to ask for help. I've read the Django DB API and searched this mailing list. Assuming the following models: http://dpaste.com/82218/ What I would like to do is access the 'study_level' field. When my view is

Re: django performance with cache on dreamhost.

2008-10-03 Thread Alessandro Ronchi
2008/10/3 Erik Allik <[EMAIL PROTECTED]>: > > Have you profiled your application? How many SQL queries is it doing > during a request processing cycle? > > You could write a web app in pure asm code and still get 1 req/sec if > you did something really stupid in your code so it's not generally > ab

Re: Editable template code in admin?

2008-10-03 Thread Erik Allik
class Snippet(models.Model): name = models.CharField() code = models.TextField() then write a template tag that takes the name of a Snippet, does snippet = Snippet.objects.get(name=name), and outputs the result of Template(snippet.code).render(). Basically you simply have to

Re: python-ldap + Apache causing errors

2008-10-03 Thread Jashugan
On Sep 24, 5:05 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > > > To really get to the problem, you may need to start up Apache in > > > single process mode and run it in a debugger. For details see: > > > >http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Debugging_C... So I tried mo

Caching of results in templates

2008-10-03 Thread Alessandro
According to SQLLogMiddleware it seems that different calls of object.field.all (m2m field) calls different duplicate queries on the database. Because views are static, I think a generic view should do only a query and print the same results on every occurrence of that values on different places o

Re: Help with login

2008-10-03 Thread Alessandro
2008/10/4 KillaBee <[EMAIL PROTECTED]>: >> And, if yes how to manage "request" parameter in this custom tag? >> All examples I've seen, use a dedicated page for login (tipically / >> accounts/login/), I mean a dedicated view. >> I hope my question is clear. Sorry if it's a silly question, but I'm

database program

2008-10-03 Thread waltbrad
I started with Django about a year ago and got interrupted. So, now I'm back and trying to go through a tutorial with the Django book. Installation. I did this once on the upstairs computer, but can't remember what I did. But, I did it without installing a database engine. But, installation tutor

Re: database program

2008-10-03 Thread Karen Tracey
On Fri, Oct 3, 2008 at 10:24 PM, waltbrad <[EMAIL PROTECTED]> wrote: > > I started with Django about a year ago and got interrupted. So, now > I'm back and trying to go through a tutorial with the Django book. > Installation. I did this once on the upstairs computer, but can't > remember what I di

SQL: Migration How To?

2008-10-03 Thread Benjamin Buch
Is there somewhere a place in the documentation where SQL migration strategies are explained a little? I think I remember a paragraph in the pre-1.0-documentation that described what you have to do with your database when you'd like to add a column to your model, but I can't find it anymore.

Re: SQL: Migration How To?

2008-10-03 Thread Russell Keith-Magee
On Sat, Oct 4, 2008 at 12:36 PM, Benjamin Buch <[EMAIL PROTECTED]> wrote: > > Is there somewhere a place in the documentation where SQL migration > strategies are explained a little? > I think I remember a paragraph in the pre-1.0-documentation that > described what you have to do with your databa

Re: select_related and intermediary tables

2008-10-03 Thread Russell Keith-Magee
On Sat, Oct 4, 2008 at 5:34 AM, Robert <[EMAIL PROTECTED]> wrote: > > I've been banging my head against this problem for several days now, > and have decided to ask for help. I've read the Django DB API and > searched this mailing list. > > Assuming the following models: > > http://dpaste.com/822