Page load very slow, in Django site

2010-01-06 Thread NMarcu
Hello all, My page is loading very slow, more then 5 sec per page. I'm using apache2. How can I see what is the problem, or what can be the reason? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

warning: Not importing directory

2010-01-06 Thread Delacroy Systems
How do I solve this? Happens when I do a runserver... warning: Not importing directory 'C:\Python25\Lib\site-packages\blocks \locale': missing __init__.py warning: Not importing directory 'C:\Python25\Lib\site-packages \django_cms-2.0.2-py2.5.egg\cms\locale': missing __init__.py warning: Not

Re: form.has_changed always true?

2010-01-06 Thread Margie Roginski
If you look at the form's _changed_data attribute, it will give you a list of the fields that have changed. That should tell you what is causing has_changed() to return True. Margie On Jan 6, 6:50 pm, Karen Tracey wrote: > On Wed, Jan 6, 2010 at 7:34 PM, Alastair Campbell

Re: problems deserializing json object

2010-01-06 Thread Malcolm MacKinnon
Thanks Daniel, I'll give that a try. On Wed, Jan 6, 2010 at 2:02 AM, Daniel Roseman wrote: > On Jan 6, 1:54 am, Malcolm MacKinnon wrote: > > I'm having difficulty deserializing a json object. I'm using django > > appengine patch, so the models aren't

Re: ForeignKey efficiency question

2010-01-06 Thread apramanik
Oops not a join, but still a db hit :). On Jan 6, 9:03 pm, apramanik wrote: > Hey all, if I have a foreign key on a model (say Model B has a foreign > key to Model A) and I do something like this: > > a = A.objects.get( pk = 1 ) > b = B.objects.get( pk = 1 ) > > if b.a == a : >

ForeignKey efficiency question

2010-01-06 Thread apramanik
Hey all, if I have a foreign key on a model (say Model B has a foreign key to Model A) and I do something like this: a = A.objects.get( pk = 1 ) b = B.objects.get( pk = 1 ) if b.a == a : # Do something Is that inefficient, since its doing a join to pull b.a? Should I be comparing their ids?

Does anyone have a Django or Python flow chart?

2010-01-06 Thread spike
Does anyone have a Django or Python flow chart? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

Django Contrib's UserCreationForm (Potential Bug)

2010-01-06 Thread Sandman
Hi All, Happy new year. I've been using the svn version of django while developing a small app. Yesterday after I updated the code, one of my tests started returning an error. In fixing this error, I may have uncovered a bug but I can't be sure if this is intentional behavior (I'm not really an

Re: form.has_changed always true?

2010-01-06 Thread Karen Tracey
On Wed, Jan 6, 2010 at 7:34 PM, Alastair Campbell wrote: > Hi everyone, > > I've been looking for a simple way to send an email when a user > updates their profile. > > After some digging I found form.has_changed() which appears to fit the > bill. However, it always seems to

Re: Django/Apache/mod_wsgi: How do I specify the SCRIPT_NAME for non-root URLs?

2010-01-06 Thread Karen Tracey
On Wed, Jan 6, 2010 at 2:39 PM, Tyler Erickson wrote: > I am trying to use Apache and mod_wsgi to serve multiple django > sites. The django sites are served up fine when at the root URL, but > when served from a sub-URL the portion of the the URL consumed by > Apache

Re: Development server exiting after entering login info in admin site

2010-01-06 Thread Karen Tracey
On Wed, Jan 6, 2010 at 6:12 PM, Pascal Vincent wrote: > I'm reposting this question here, since I didn't get any answer the > first time, and I'm struck there. > Where can I find help with this, should I rather post the problem to > another group? > > --- > I'm new to

Re: Unable to delete certain admin objects. Get "coercing to unicode" error on some, but not all objects.

2010-01-06 Thread Karen Tracey
On Wed, Jan 6, 2010 at 5:20 PM, rc wrote: > I get the following error when I try and delete a "testcase": > > Request Method: GET > Request URL: http://hades/admin/bisite/testcase/20/delete/ > Django Version: 1.0.2 final > Python Version: 2.5.2 > Installed Applications: >

form.has_changed always true?

2010-01-06 Thread Alastair Campbell
Hi everyone, I've been looking for a simple way to send an email when a user updates their profile. After some digging I found form.has_changed() which appears to fit the bill. However, it always seems to return true, so I could end up bombarding our elderly admin lady with lots of useless

Re: Cannot Click Into Internet Explorer Input Text Field

2010-01-06 Thread geraldcor
For those interested: It was a z-index issue. I set my main content div to z-index: -1; so that my drop down menus would not get hidden in IE. This however masked my input fields. So, I ended up removing that z-index and giving my #nav a z-index of 1000. Did the trick. Greg On Jan 5, 6:14 pm,

Development server exiting after entering login info in admin site

2010-01-06 Thread Pascal Vincent
I'm reposting this question here, since I didn't get any answer the first time, and I'm struck there. Where can I find help with this, should I rather post the problem to another group? --- I'm new to django, and was going through the tutorial (on Mac Os X 10.4.11, installed latest stable version

How can I retrieve the ModelAdmin given the model class or an instance?

2010-01-06 Thread Marco Rogers
I'm retrieving a model using django.db.models.get_model. The view is receiving a post from a form generated by the ModelAdmin. How can I get a hold of that ModelAdmin instance so can then get a hold of the ModelForm? This will allow me to process the post (validation, related objects, etc).

Unable to delete certain admin objects. Get "coercing to unicode" error on some, but not all objects.

2010-01-06 Thread rc
I get the following error when I try and delete a "testcase": Request Method: GET Request URL: http://hades/admin/bisite/testcase/20/delete/ Django Version: 1.0.2 final Python Version: 2.5.2 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes',

Re: how relate webpage with databse in my harddisk?

2010-01-06 Thread Kenny Meyer
> How other can access pages i generated with django? You mean how others can access pages which Django generated *for you*. If you're connected with computers in a home network they can see your work with a webbrowser, knowing the IP address of the Pc which is serving the Django "pages". Usually

Re: Error when trying to connect to django_session

2010-01-06 Thread Daniel Roseman
On Jan 6, 7:51 pm, Mike wrote: > I am a newb to a this so please keep that in mind when reading this. > I am running Ubuntu 9.10, postgreSQL 8.4, psycopg2, Django 1.1.1, and > Apache 2.2.  Everything works fine until I go to authenticate then I > get an error.  I am trying to

Re: how can a test log in as a given user before calling client.get()?

2010-01-06 Thread Phlip
> Google cannot find any traffic on this topic, so I'm warming up the > question here before researching it myself. If I figure out how to > write login_as() for tests, I will post it here. Do I always have to see the same hands?? from django.contrib.auth.models import User

auth unit tests fail because sites isn't used

2010-01-06 Thread msoulier
I can't find anywhere in the django docs where it says that django.contrib.auth uses django.contrib.sites, but when I run my unit tests I get this == ERROR: test_current_site_in_context_after_login

how can a test log in as a given user before calling client.get()?

2010-01-06 Thread Phlip
Djangoids: Google cannot find any traffic on this topic, so I'm warming up the question here before researching it myself. If I figure out how to write login_as() for tests, I will post it here. The issue is, with the contrib/auth system turned on, client.get() can't fetch a page; it redirects

Re: Django, Apache, mod_wsgi, GET works, POST doesn't

2010-01-06 Thread Rob
Have you managed to figure this out - I'm having a similar (I believe the same) issue. On Jan 5, 6:27 am, Patrick May wrote: > Can you make it fail in the development server, with DEBUG turned on? > > If so, you can get more helpful error display and/or do

Error when trying to connect to django_session

2010-01-06 Thread Mike
I am a newb to a this so please keep that in mind when reading this. I am running Ubuntu 9.10, postgreSQL 8.4, psycopg2, Django 1.1.1, and Apache 2.2. Everything works fine until I go to authenticate then I get an error. I am trying to get the authentication piece to work by using the canned

Django/Apache/mod_wsgi: How do I specify the SCRIPT_NAME for non-root URLs?

2010-01-06 Thread Tyler Erickson
I am trying to use Apache and mod_wsgi to serve multiple django sites. The django sites are served up fine when at the root URL, but when served from a sub-URL the portion of the the URL consumed by Apache disappears from any links created in the django site pages. >From reading throught the WSGI

how relate webpage with databse in my harddisk?

2010-01-06 Thread gintare
Hello, Sorry for a simple question. How other can access pages i generated with django? How others could be able to fill forms and get data from my hard disk through generated html interface? I am connecting and filling database by myself in folder /mano/ mysite1. I would like to connect to

Re: Got Django and Buildout working, but what about PIL and Postgres?

2010-01-06 Thread Kevin Teague
This is what I use for PostgreSQL and psycopg2 installation with Buildout: First, adjust the eggs to pull-in a custom-built psycopg2 egg: eggs = ${psycopg2:egg} ${buildout:eggs} Then for psycopg2 do: [psycopg2] recipe = zc.recipe.egg:custom egg = psycopg2 include-dirs =

Re: Exiting Postgresql user to Django App user

2010-01-06 Thread Christophe Pettus
On Jan 5, 2010, at 11:10 PM, Rama wrote: I would like to use existing postgresql users with my django app, I wonder is there any solutions already available with django... I assume you mean something along the lines of, "I would like to map the user logins on my Django site to PostgreSQL

Re: error using memcache and filter()

2010-01-06 Thread Subramanyam
Thanks a LOT !! Frank Further to your analysis I checked the following http://docs.djangoproject.com/en/dev/topics/serialization/#serializing-dataand understood from the note (rather my understanding ) that only .all() query set method would give the serialized data if we want .filter () ( or

Re: Exiting Postgresql user to Django App user

2010-01-06 Thread Daniel Roseman
On Jan 6, 7:10 am, Rama wrote: > Hi > I would like to use existing postgresql users with my django app, I > wonder is there any solutions already available with django... > > Please let me know. You don't need, or want, to do this. Django connects to the database

Re: Exiting Postgresql user to Django App user

2010-01-06 Thread Bill Freeman
Have you tried setting DATABASE_USER in settings.py to the desired user? On Wed, Jan 6, 2010 at 2:10 AM, Rama wrote: > Hi > I would like to use existing postgresql users with my django app, I > wonder is there any solutions already available with django... > >

Re: Got Django and Buildout working, but what about PIL and Postgres?

2010-01-06 Thread Masklinn
On 6 Jan 2010, at 16:43 , Masklinn wrote: > > * PIL shouldn't be needed if you use buildout correctly And I read PIL but thought PIP, disregard this. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Securing Django Installation - file permissions?

2010-01-06 Thread Daniel Hirsch
Thank you for the response Daniel. That was more-or-less what I *thought* but it was great to be able to pass the information on to him from a 3rd party. That said, is there anything I should be doing from a practical standpoint as far as setting file permissions in my project directories? Things

Re: Saving several copies of an object

2010-01-06 Thread pjmorse
On Jan 5, 1:11 pm, Matthias Kestenholz wrote: > This won't do it, because ns is a Form, not a Model object. Something > like this might work though: > > obj = ns.save(commit=False) > > for language in languages: >     obj.id = None >     obj.language = language >    

Re: Got Django and Buildout working, but what about PIL and Postgres?

2010-01-06 Thread Reinout van Rees
On 01/06/2010 04:23 PM, littlejim84 wrote: Can anyone help me to reliably get PIL and Postgres working with my Buildout? Thank you so much in advance... Everything I've tried so far just throws up all sorts of errors. Add the lines marked with '<<<' behind them to your buildout to *probably*

Re: Got Django and Buildout working, but what about PIL and Postgres?

2010-01-06 Thread Masklinn
On 6 Jan 2010, at 16:23 , littlejim84 wrote: > > Hello. I'm on Mac OSX 10.5.8. I have followed Jacob Kaplan-Moss's article on > setting up Django with Buildout: > http://jacobian.org/writing/django-apps-with-buildout/ > > Finally, I have got this Buildout to work! ...but I'm now needing PIL and

Got Django and Buildout working, but what about PIL and Postgres?

2010-01-06 Thread littlejim84
Hello. I'm on Mac OSX 10.5.8. I have followed Jacob Kaplan-Moss's article on setting up Django with Buildout: http://jacobian.org/writing/django-apps-with-buildout/ Finally, I have got this Buildout to work! ...but I'm now needing PIL and Postgres for a complete isolated Django development

building a multi lingual website

2010-01-06 Thread mikeymor
Hello all, i'm new to django and wrote several test applications, so far it feels like falling in love. i tried to write a test project with multi lingual support, and found several good examples. however once i try to do it in my project it doesn't work. this is my models.py code: class

Queryset |-ing and joins

2010-01-06 Thread Daniel Pope
I have encountered a problem with joins in Django's ORM. I had assumed that queryset.filter(**a) | queryset.filter(**b) is functionally equivalent to queryset.filter(models.Q(**a) | models.Q(**b)) for all a and b. That is not what is happening. If my assumption is not true, then what are the

Re: error using memcache and filter()

2010-01-06 Thread Frank DiRocco
'yam, I have not seen this error, but my responses to the error are inline. On Jan 6, 2010, at 6:30 AM, Subramanyam wrote: File "/home/bvemu/lib/python2.6/site-packages/django/core/cache/ backends/memcached.py", line 37, in set self._cache.set(smart_str(key), value, timeout or

Re: Django-Admin filter on 'backwards' foreign key

2010-01-06 Thread tback
Hi Shawn, thanks for your help anyway! Anyone else? Till Backhaus On Jan 5, 4:02 pm, Shawn Milochik wrote: > Sorry, I completely missed the part of the question where you said you wanted > to do it in the Django Admin. That I don't know about. > > Shawn -- You received

Re: Project optimisation stage: Advice to boost speed of database queries across tables?

2010-01-06 Thread koenb
On 31 dec 2009, 01:56, Sam Walters wrote: > Thanks for the replies. > > Yes, there is the option of going to raw MySQL. However the project > requirements mean i can't use raw SQL. (portability, readability) > From what i can see using django's db API i have to execute the >

hi.. supress the flatpages' fields' help texts

2010-01-06 Thread Ali Rıza Keleş
Hi all, How can I supress help_texts of flatpages' fields without modifying core code of django contrib. Thanks. -- Ali Rıza Keleş -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

error using memcache and filter()

2010-01-06 Thread Subramanyam
Hi I am using memcached for caching objects , but am stuck with the following When I use the .all() method it works fine >> from django.core.cache import cache >>> user_list=User.objects.all()[0:10] >>> key='userlist' >>> cache.set(key,user_list) But when I use .filter() method I get the

Re: Saving several copies of an object

2010-01-06 Thread Simon Brunning
2010/1/5 pjmorse : > It's a multi-language site: US, UK, DE. (Why US and UK are considered > different languages is organizational politics beyond the scope of my > work.) UK and US English are enormously similar, but there are real differences in vocabulary (e.g. lift

Re: constraints fail importing data

2010-01-06 Thread Antoni Aloy
You have to check the constraints in table of course. There is no information we can use to help you sorry. 2010/1/6 shaner > INSERT INTO table (col1,col2) SELECT col1,col2 FROM table2 > > is what i'm trying do, copy some columns from one table to one in > django, i get

Re: Combining columns coming from 2 tables

2010-01-06 Thread Antoni Aloy
2010/1/5 fredlab > Hey, > > My question is probably very simple. Below, my simplified model : > > I have a table of stock items in stock (item_code, item_title, > property1, property2, storeroom, quantity_available) > I have a table listing transaction of items

Exiting Postgresql user to Django App user

2010-01-06 Thread Rama
Hi I would like to use existing postgresql users with my django app, I wonder is there any solutions already available with django... Please let me know. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

pickle error in DecimalField

2010-01-06 Thread Akash
I am using DecimalField in django table for pricing. It works fine sometimes but sometimes it throws an Pickle error (PicklingError: Can't pickle : it's not the same object as decimal.Decimal). I am importing decimal module in views also. Have anyone encountered this issue? Can anyone help on

Re: use of @vary_on_cookie decorator with URLconf based cache_page usage

2010-01-06 Thread Victor Lima
Off topic side note: beware if you use vary on cookie and google analytics, since analytics cookies changes a lot you are actually caching views per analytics cookie change... That bugged us for a while in our project. Att, Victor Lima Em 05/01/2010, às 21:32, Justin L

Re: problems deserializing json object

2010-01-06 Thread Daniel Roseman
On Jan 6, 1:54 am, Malcolm MacKinnon wrote: > I'm having difficulty deserializing a json object. I'm using django > appengine patch, so the models aren't the same as django's, but they are > very similar: > > class Cust(db.Model): >     custno =