I need to sort a collection of objects by a utf-8 string property (built via ActiveRecord). Currently the code is sorting by ASCII order via the order_by method, however this needs to be changed to locale.strcoll. Unfortunately using the built in locale functionality requires changing the culture for the entire application, not just the current request. I’ve looked at the
Tag: django
django import error – No module named core.management
Ok, I see plenty of these errors around. I have tried everything I know to do and have yet to figure this out. I am working on a development server running python 2.5 and Django 1.3. Django 1.3 was installed using python setup.py install after unpacking the tar.gz download. All works well, I seldom have the need to run manage.py
how to insert some text in all django context using django middleware
this my middleware code : this is the settings.py: and the view is : the html is : but it not show {{ss}}: so how do i show : how to insert some text in all django context using django middleware, so that i cant use to insert the text everytime , thanks Answer To meet your initial goal, I
Django DateTimeField auto_now_add not working
In one of the model i have set one timestamp field as follows: While in shell i am able to create a obj and save it, however in my application it is raising a exception that created_datetime field cannot be null. Confused where things went wrong!! How to reslove it. Answer You can do something like this
Generating PDFs from SVG input
I am trying to generate a PDF from a SVG input file with Python in a Django application. I have already found 2 working solutions: cairo+rsvg and imagemagick but they both have one problem: They have some strange dependencies that I do not want to install on a server, for example DBUS and GTK. So I am asking for another
PIL – libjpeg.so.8: cannot open shared object file: No such file or directory
Compiled the libjpeg v8, PIL 1.1.7 and and import for _imaging works on the system Python, but spouts this error inside the virtualenv: here is the error run with a python -v interpreter inside the virtualenv and here are the paths: I am using Ubuntu 10.10 and this is the uname-a output: I am using Python 2.6 I followed the
how to open url in new tab from django?
i have to open the result page using render_to_response on a new tab Answer Django is server-side, opening in a new tab is client-side. So use an <A> with a target=”_blank” http://www.google.com/search?sourceid=chrome&ie=UTF-8&q=target%3Dblank But of course spawning new windows/tabs is annoying for the user, so try not to do that after all.
Why doesn’t Pydev find Django?
I have Django installed. I also have django-admin.py in my python-2.7 folder. I can import django using my Python shell (DreamPie). But I can’t create a new Django project in Pydev. When trying to create a new Pydev Django Project (choosing python2.7 as the interpreter) I receive the following error message: I went to the link in the message and
Django: override the save() function of an abstract model
I have tried to override the save() function on a model that is abstract, and am getting an error So if possible, how do you override the save function on an abstract model. The model that extends from this is Entry Here is my model Code: (For those who are familiar, I am extending the Entry model on the zinnia-blog,
Manually validate a django session id is currently authenticated
I need to have a function tell me if a Django session-id is currently authenticated or not. I understand this is already built into Django and I have that working just fine. But I have an external app that gets passed a session id, and when it passes the session-id string back to Django I need to validate that this