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

2011-09-15 Thread Doug Ballance
Another clarification: It tells django to create an index on that field when you run syncdb to create the tables for your apps. Adding it to an existing model won't change anything by itself. If you decide a field needs an index you can add it to the model definition, and then you can use the "m

Re: is photologue still maintained?

2011-09-15 Thread graeme
It may or may not help you, but ImageKit seems actively maintained: https://github.com/jdriscoll/django-imagekit http://groups.google.com/group/django-photologue/browse_thread/thread/4b37b40721a30fcb/f0620ebe8672a34c#f0620ebe8672a34c As far as I understand it, a new version of Photologue was pla

Re: Template loader cannot find admin_doc templates

2011-09-15 Thread Piper
On Sep 16, 6:33 am, James Bennett wrote: > Worth noting that this is the first thing you're instructed to do in > the documentation for the admin docs system: > > https://docs.djangoproject.com/en/1.3/ref/contrib/admin/admindocs/ > > Might be a good idea to double-check the rest of your setup agai

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: When is a good time to use db_index? Rule of thumb?

2011-09-15 Thread Micah Carrick
As an oversimplification.. any time you will be looking up a record based on a field, then you want an index on that (or those) fields. If you're finding a row based on a slug, you want to index that slug field. A good tool is to use the Django debug toolbar. When you load a page you can take a lo

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

2011-09-15 Thread Micky Hulse
Hello, I have been using this great category/tag model: https://github.com/praekelt/django-category/blob/master/category/models.py ... and I noticed that the author added a db_index on the SlugField of the Category model. I hate to admit it, but I don't think I have ever explicitly used db_inde

Re: Template loader cannot find admin_doc templates

2011-09-15 Thread James Bennett
On Thu, Sep 15, 2011 at 8:29 PM, Piper wrote: > Solved by adding 'django.contrib.admindocs' to the INSTALLED_APPS. Worth noting that this is the first thing you're instructed to do in the documentation for the admin docs system: https://docs.djangoproject.com/en/1.3/ref/contrib/admin/admindocs/

Re: Template loader cannot find admin_doc templates

2011-09-15 Thread Piper
Solved by adding 'django.contrib.admindocs' to the INSTALLED_APPS. -- 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 unsubscribe from this group, send email to django-users+un

CSS can't load when deploy to GAE

2011-09-15 Thread Tsung-Hsien
Hi, when I runserver on my localhost, CSS can load on the web site. Before I deployed to GAE, I only change the app.yaml setting: - url: /media/admin static_dir: django/contrib/admin/media expiration: '0' to - url: /static static_dir: static expiration: '0' After I deployed to GAE, I

TabularInline ordering ignored

2011-09-15 Thread Lee
The ordering option of TabularInline is ignored on my Django 1.3 installation. It just orders by the default ascending Id. Any ideas on how to activate this option? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send emai

is photologue still maintained?

2011-09-15 Thread bedros
any idea who's maintaining photologue and if still has a support community? and which fork repo supports the latest django release, there are bunch of forks on googlecode, github, bitbucket? Thanks, Bedros -- You received this message because you are subscribed to the Google Groups "Django us

Re: memcached problems with cache.clear()

2011-09-15 Thread Torsten Bronger
Hallöchen! Tom Evans writes: > [...] > > from django.core.cache import cache for i in xrange(2): cache.set(str(i), str(i)) > ... cache.get('1') > '1' from django.conf import settings settings.CACHES > {'default': {'LOCATION': '10.0.12.11:11211', 'BACKEND': > 'django.c

Template loader cannot find admin_doc templates

2011-09-15 Thread Piper
Hello, I tried enabling the admin_doc system in Django 1.3.1 and I got a TemplateDoesNotExist exception as follows: [CUT] TemplateDoesNotExist at /admin/doc/ admin_doc/missing_docutils.html Request Method: GET Request URL:http://127.0.0.1:8000/admin/doc/ Django Version: 1.3.

Re: Cannot Connect to Server with Postgresql (9.0)

2011-09-15 Thread Andre Terra
Hello, Eric Welcome to Django! * Can you ping the server? * Are you sure about your username and password? Try creating a new login role through PgAdmin and use that instead to see if the error is in the connection or in the authentication process. * Does your pg_hba.conf file have an entry whi

Re: memcached problems with cache.clear()

2011-09-15 Thread Torsten Bronger
Hallöchen! Tom Evans writes: > On Thu, Sep 15, 2011 at 3:49 PM, Torsten Bronger > wrote: >> Hallöchen! >> >> >> It works for me too if it only accesses localhost.  However, if I >> say >> >>    "LOCATION": ["192.168.26.130:11211", "192.168.26.131:11211"], >> >> I see that fatal behaviour. >> > >

Re: Caching static images using memcache/nginx

2011-09-15 Thread Thomas Weholt
Aha! That's briliant, but doesn't nginx set those headers for me when returning a static resource like a image? Thomas On Thu, Sep 15, 2011 at 4:52 PM, Ilian Iliev wrote: > How about to set correct headers and make the images cached on user side > instead > of wasting memchached resources? > If

Re: sending and receiving data using ajax/html

2011-09-15 Thread Yaşar Arabacı
Check this out: http://www.micahcarrick.com/ajax-form-submission-django.html 2011/9/15 jay K. > I do not know anything about send and receiving data using forms in html > django, > I just heard that ajax was good for receiving and sending data (it was > faster) > > any suggestions would be good

Cannot Connect to Server with Postgresql (9.0)

2011-09-15 Thread ericdoesdjango
Windows (vista) I did the djangoproject tutorial and I am now going through djangobook. The first time (going through the djangoproject tutorial), after creating tables, I tried to enter values in the table through the django models. This was a couple of weeks ago and I forgot what error it retu

Subclassing the ForeignKey field type

2011-09-15 Thread Tobia Conforto
Hi all I'm adding an XML mapping feature to Django db models. The idea is to add as little XML mapping information as possible to existing models (such as: which fields get mapped to XML, what is their XPath...) in order to be able to automatically: 1. produce an XML representation of an object

banu

2011-09-15 Thread banu com
http://123maza.com/65/fun564/ -- 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 unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more

Composite OneToOneFields in Django?

2011-09-15 Thread RedBaron
I am fairly new to Django and I think I pretty much get the basic idea of ORM. However, there is a peculiar situation to which I do not see a plausible solution. I have a legacy database for which I am trying to write a Django app. The sql structure of both the tables is: mysql> describe event; +-

Re: sending and receiving data using ajax/html

2011-09-15 Thread Yaşar Arabacı
Why do you want to use ajax, instead of regular form post to next page. When in next page, you can create hidden form fields to store data you passed from first page, and then you can post them again in any page you want. 2011/9/15 jay K. > > Hello > > I have a page where a user makes a selectio

Re: sending and receiving data using ajax/html

2011-09-15 Thread jay K.
I do not know anything about send and receiving data using forms in html django, I just heard that ajax was good for receiving and sending data (it was faster) any suggestions would be good 2011/9/15 Yaşar Arabacı > Why do you want to use ajax, instead of regular form post to next page. > When

sending and receiving data using ajax/html

2011-09-15 Thread jay K.
Hello I have a page where a user makes a selection What I want to do is to take the user's selection to the "next page" so I can process the user's request in a new page How can I do that? I know I have to use ajax (but if there is a better method please let me know), so how can I use ajax to

What to use for Auth_LDAP credentials?

2011-09-15 Thread Scoot
Hello everyone, I am trying to get the http://packages.python.org/django-auth-ldap to work, but I am having trouble. If someone can give me any ideas, thanks. What is the user i am supposed to use when I log on because I am always getting authentication failed in my environment. Am i supposed to l

Re: memcached problems with cache.clear()

2011-09-15 Thread Tom Evans
On Thu, Sep 15, 2011 at 3:49 PM, Torsten Bronger wrote: > Hallöchen! > > > It works for me too if it only accesses localhost.  However, if I > say > >    "LOCATION": ["192.168.26.130:11211", "192.168.26.131:11211"], > > I see that fatal behaviour. > Not for me: >>> from django.core.cache import

Re: Caching static images using memcache/nginx

2011-09-15 Thread Ilian Iliev
How about to set correct headers and make the images cached on user side instead of wasting memchached resources? If you are serving tons of thumbs multiple times I bet that the traffic will be bigger problem than the time it took for these images to be read from disk. Check this post -> http://il

Re: memcached problems with cache.clear()

2011-09-15 Thread Torsten Bronger
Hallöchen! Tom Evans writes: > On Thu, Sep 15, 2011 at 2:31 PM, Torsten Bronger > wrote: > >> [...] >> >> I found an easy way to reproduce this (with memcached activated in >> settings.py): >> >> chantal@mandy:~/chantal$ ./manage.py shell >> Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) >> [G

Re: Problem with Foreign Key on self table and delete() object

2011-09-15 Thread Dave
Hi all, I tried my code on virtualenv with django 1.3 and this problem is solved, but I have to write this app for django 1.2 :/ I'm thinking that this problem is caused by relationship of the objects, but now I created a new object without 'use' field and immediately deleted it after the .sav

Re: memcached problems with cache.clear()

2011-09-15 Thread Tom Evans
On Thu, Sep 15, 2011 at 2:31 PM, Torsten Bronger wrote: > Hallöchen! > > Torsten Bronger writes: > >> Sometimes, we experience a massive increase in active connections >> to the memcached server when calling cache.clear().  This causes >> server tracebacks because the server cannot open files >> (

Re: Caching static images using memcache/nginx

2011-09-15 Thread J. Cliff Dyer
What is your goal in doing this? You are unlikely to see any performance gains from this effort. It won't render any faster for your users. Sending bytes over the network is far slower than reading them off disk, so it's not likely to be a bottleneck in terms of page loading. Your filesystem

Re: Caching static images using memcache/nginx

2011-09-15 Thread Thomas Weholt
Good point Cliff! I just assumed serving static content would benefit from caching, but perhaps my effort is more well spent focusing on other aspects of my app right now. Thanks :-) Thomas On Thu, Sep 15, 2011 at 3:42 PM, J. Cliff Dyer wrote: > What is your goal in doing this?  You are unlike

Re: memcached problems with cache.clear()

2011-09-15 Thread Torsten Bronger
Hallöchen! Torsten Bronger writes: > Sometimes, we experience a massive increase in active connections > to the memcached server when calling cache.clear(). This causes > server tracebacks because the server cannot open files > (e.g. Python modules) anymore: "error 24: Too many open files". I f

Re: Using gedit for django development

2011-09-15 Thread Sam Walters
Yes. I mostly use vim+yakuake. I really like gedit and have used it for large projects too. Notably: I will try this gedit-django-project pluggin as it never hurts to know your way around multiple IDE's. sam_w -- You received this message because you are subscribed to the Google Groups "Django

Caching static images using memcache/nginx

2011-09-15 Thread Thomas Weholt
Ok, this might sound a bit off-topic but bear with me. I got a templatetag in an app that generates thumbnails ( django-photofile ). In my templates it might look like this It will generate a thumbnail of the photo in 100x100 in a folder served by nginx for all static content and return an url

memcached problems with cache.clear()

2011-09-15 Thread Torsten Bronger
Hallöchen! Sometimes, we experience a massive increase in active connections to the memcached server when calling cache.clear(). This causes server tracebacks because the server cannot open files (e.g. Python modules) anymore: "error 24: Too many open files". Increasing the allowed files for www

[JOB] Django/Python Developer, NYC | 90-110k

2011-09-15 Thread OSS
Details here: http://opensourcestaffing.wordpress.com/2011/09/14/job-django-python-developer-nyc-90-110k -- 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 unsubscribe from thi

Re: Django mysite problem

2011-09-15 Thread PremAnand Lakshmanan
This is my PATH variable -C:\Python27\lib\site-packages\django\bin\ and django-admin.py is located in this path. This is my PYTHONPATH variable-C:\Python27;c:\Python27\lib\site-packages\django Im able to import django and dont have problems when I execute the django.VERSION command. On Wed,

Re: Caching/Reload problem - cannot refresh model data

2011-09-15 Thread Tom Evans
On Thu, Sep 15, 2011 at 9:56 AM, Ilian Iliev wrote: > "Any UPDATE or INSERT will always commit the current transaction." ??? > > If this is correct(which I doubt) then you do not have transactions at all. > As I know > the idea of transaction is to run multiple statements in a way that they are >

Re: nested forms from model with manytomany

2011-09-15 Thread Roald de Vries
On Sep 14, 2011, at 11:32 PM, Visgean wrote: Hello I have these two models: class SubOrder(models.Model): """ This is model for single order it should be used later in complex order """ product = models.ForeignKey(Product) quantity = models.SmallIntegerField() class Order(m

Re: Caching/Reload problem - cannot refresh model data

2011-09-15 Thread Ilian Iliev
"Any UPDATE or INSERT will always commit the current transaction." ??? If this is correct(which I doubt) then you do not have transactions at all. As I know the idea of transaction is to run multiple statements in a way that they are independent form the other statements run at the same time? --

Re: Caching/Reload problem - cannot refresh model data

2011-09-15 Thread Tom Evans
On Wed, Sep 14, 2011 at 6:57 PM, Ilian Iliev wrote: > Hi Tom, > I checked the link you send and probably you are right but > can you explain why this is a bad solution? > Yes using autocommit() or disabling transactions seems more right > are there any downsides of the update() that you are seeing

Re: newbie question on activating the automatic admin

2011-09-15 Thread Babatunde Akinyanmi
Cool On 9/14/11, nara wrote: > Finally! The admin interface worked, when I used the dev version > in a virtualenv. I cleaned every trace of Django in my system, > and I had to compile (requires python-dev package in > Ubuntu) and install MySQLdb into the virtualenv. > > Not sure what exactly was