django

Broke my Django app - a path problem?

The symptoms: Could not import tinycomm.views. Error was: No module named models The line of code: from tinycomm.models import * Project structure: /tinycomms /tinycomm models.py views.py etc. /other apps. On Mac OS X in development I can fix this by putting tinycomms.tinycomm.models and then another similar ...

Recommended Django setup?

I am about to embark a major django project. If I install the latest stable release... is the a suggested setup ie. this OS, this RDBMS, this version of python etc?? I'm normally a CentOS man but their repos don't play too well with the django requirements... ...

Html to image in javascript or python

Hi there. Just a dumb question... Is there any way you can create an image, say png, with the content of an html page, with a simple click of a button? Thanks to anyone who cares to answers. ...

How to show database in django-admin using filters by default?

I need to filter database by default every time that I see it (when I save changes or when I open database first time). Can anybody tell me how to do it? ...

Django <-> SQL Server 2005, text encoding problem

Hello, I'm trying to store Django data on MS SQL Server 2005 using: http://code.google.com/p/django-pyodbc/ (pyodbc + FreeTDS) As long as I'm storing string consist of ASCII characters everything is ok. When I'm using unicode (ex. '\xc5\x82'), django throws ProgrammingError on: ProgrammingError at /admin/cli/punktrejestracji/add/ ('4...

Changing ForeignKey's defaults in admin site

Hi, I'd like to know how I can change the blank value of ForeignKey in admin site's forms. There blank is showed as "-----". I wanna replace it by a word. Does someone know how to do it? ...

Django query negation

Hi, I know how to build filters and Q objects in django, but I don't know how to negate the operators that the API provides, for example for the contains operator I would like something like notcontains. e.g. q=Q(name__notcontains="SomeString") This would get me all objects whose name do not contain "SomeString". Is there some synt...

Where can I download the Django documentation?

Django's website seems good but for some reason I couldn't find where to download the documentation: http://docs.djangoproject.com/en/1.1/ (Yes, I need the docs for 1.1) Does anyone know? ...

how do I know if a remote user is connected in django?

how do I know if a remote user is connected in django?, like gmail chat, or facebook chat... I need that in the templates system. Sorry for my english ...

How do I write a Django template custom tag that adds a slash before a single quote?

Am I doing this right? (probably not...someone correct? thanks) @register.filter('addslashes') @stringfilter def addslashes(text, arg): return text.replace('\'','\\'') {{ query|addslashes }} ...

How do I do "or" in Django template code?

{% if is_loggedin OR is_anonymous %} test message {% endif %} ...

Asserting sum of values in Django-admin

I have a Django model for a sweater and want to be able to enter the composition of materials used in the admin panel (say: "100% wool" or "50% wool, 50% cotton" or "50% wool, 45% cotton, 5% acryl"). I have this model: class Sweater(models.Model): wool = models.IntegerField(max_length=3, default=100, verbose_name="wool (%)"...

DB Permissions with Django unit testing

Hello All, Disclaimer: I'm very new to Django. I must say that so far I really like it. :) (now for the "but"...) But, there seems to be something I'm missing related to unit testing. I'm working on a new project with an Oracle backend. When you run the unit tests, it immediately gives a permissions error when trying to create th...

Django i18n and SEO

Hi, how do you prepare i18n in your websites? I mean what do you do avoid the situation when you search for i18ned websites in Polish you get English description cause English is the default one. Thanks in advance, Etam. ...

Django not translating the whole page

Hello guys, I'm using the i18n feature of Django. I have noticed that even though I have translated everything on django.po and compiled it to django.mo, some parts of my website are always appearing in english instead of the selected language (portuguese). For example: I have a page with these fields: Tag Name Matches Played Created...

How do I internationalize my Django website into other languages like Spanish from English?

How do I internationalize my Django website into other languages like Spanish from English? ...

What's my mistake in doing the following in django-mptt?

I have a category tree, with Items entry related to the category. So this is my model file: from django.db import models import mptt class Category(models.Model): nombre=models.CharField(max_length=70) padre=models.ForeignKey('self', blank=True, null=True) def __unicode__(self): return self.nombre class Meta: ordering = ['tre...

Help with Facebook Connect--trying to get the info of a user after he "connects" to my website.

Hi, I am using Django PyFacebook Middleware to allow users to connect. def index(request): FBGRABLIST = ['name', 'pic','uid','first_name','last_name', 'email'] fbdata = [] if request.facebook.check_session(request): fbdata = request.facebook.users.getInfo(request.facebook.uid, FBGRABLIST)[0] print fbd...

django input element error css class

I'd like to know how can I add .error class to input elements (to registration app) when the form validation fails. ...

Django Middleware: How do I access a view's params from middleware.

Let's say I have a view: def pony_view(request, arg1, arg2): ... Make ponies, etc ... And a middleware: class MyMiddleware(object): def process_request(request): # How do I access arg1, arg2 here? Of course arg1, and arg2 will be passed in via URL params with urls.py. The reason I need to do this is because I want ...