django

Writing templates without using html for ruby on rails/django

I hate to explicitly use html/css to build pages. Is there a template language I can use to semantically and quickly describe the layout and content of the page so that later I can generate html and css from it? I'm planning to use this on a django site (but I guess if such solution already exists for RoR I can always adapt it). Thank...

Output request parameter by template

Is it correct to say that there is no simple tag that just writes some http get query parameter? If all needed is printing a http get query parameter e.g. ?q=w can I directly use the value q with a template tag or need the copy the value in the request handler? Is it possible to more directly pass values (all values) from http get to tem...

Django update multiple queries

I am building a small app that looks at availability of vehicles and helps a customer book it. in this I am making use of a form wizard that guides the user through the steps. in the backend I am updating all the queries successfully, however I am not quite sure on how to execute one part of it. I have two models, Quote and Vehicle V...

Best way for a total noob to create a simple web application

I want to make an interactive, simple web application. Where should I start? Preferably python/django because it sounds easiest? you tell me. tia. ...

How to enable SSL with a IIS 6 + FastCGI + Django setup?

Hi folks, I have successfully setup FastCGI/Django on a IIS 6 Server. What I don't know how to do, is to enable SSL connections. Any tips or ideas to get me started? I'm not an IIS expert, so this is quite confusing for me. :) ...

Django - Include data from foreignkey in admin list_display function

I have two models and one admin model: class Person(models.Model): firstname = models.CharField(maxlength=50) surname = models.CharField(maxlength=50) class Friends(models.Model): person1 = models.ForeignKey("Person") person2 = models.ForeignKey("Person") friendship_made = models.DateField() class PersonAdmin(adm...

Django 1.2 session loss

Hey, I have problem with django 1.2 and psycopg2 backend. When django raises http500 error session is dropped too. Also my client's apache server is dropping sessions on every request after one week without restart. It only happen with django 1.2 (django 1.1 works). Django 1.2 works too with sqlite backend (didn't test mysql). So I susp...

django multiple select in admin change-list

Hi all, Our product model can have multiple campaigns. Our customers change these campaigns frequently and generally on multiple products. So what we need right now seems that we need to show a multiple select widget on a change-list of Product model where our customers can easily change the campaigns. Any idea on this? Maybe another...

Dynamic login/logout URLs in Django

I have an app that serves pages like this /stage/stagename. stagename is variable. The URL mappers just look for a [0-9A-Za-z]+ to fill that slot. Now, because of my setup, My app will be rooted at /stage/stagename. I cannot change this (without massive changes to my setup which is too tedious right now and a last option). I need to u...

django templates sysntax error

Is there any problem with the syntax in the following code,there is a error as Invalid block tag: 'else' {%ifequal chat_profile 1 %} {% extends "chatprofile/chat_profile1.html" %} {% else %} {% extends "chatprofile/chat_profile.html" %} {% endif %} ...

Change row colour in Django Admin List

I want to highlight rows (set the backgorund colour) in the Django Admin page (change_list.html) based on a field in the model called status. What is the best way to do this? I have 3 statuses. Open, Active, Closed. I'd like rows with open to be green, active to be orange and closed to be red. I've found documentation about changing...

How to lower accuracy db.GeoPtProperty to 2 decimals

Hi I use db.GeoPtProperty like {{a.geopt.lat}} and heuristically found 2 decimals get "good enough" for my requirements. So I try to round off to 2 decimals either with template filter like a django filter or by python code. Can you recommend a how to proceed? Thanks ...

Serialize django model with foreign key models.

How to serialize dajngo model in json format if i want include foreign key models fields. If i have: class Model1(models.Model): name=models.CharField() child=models.ForeignKey(Model2) class Mode2(models.Model): field1=models.CharField() field2=models.IntegerField() I wanna include everything in js...

GWT, LAMP or a Framework? choosing the right technology for a web application

Hi all, after scanning stackoverflow I stil could not find a good answer to a simple question: you want to develop a SaaS business app that has all the typical features: reports, forms, user administration etc. You don't want a CMS but develop it from scratch. what technologies would you choose? at first glance, many of you would say ...

A question on editing a seach view in Django

Hello I am working in django how to use a search form from Django documents site. Here are some information below. Now, is there a way I can produce a part search for title? For example if I wanted to search for a book called "Apress", But instead of typing the whole word I just wrote "ap" to get Apress. Is there a way how to achieve thi...

Will Django automatically switch to a slave if Multiple Databases are enabled and the master goes down?

I am a Django n00b and am looking at the "MasterSlaveRouter" example located in the Django docs: http://docs.djangoproject.com/en/dev/topics/db/multi-db/ In the example, if the "master" were to go down, would Django automatically switch to the slave so the site didn't go down? If not, does anyone have any tips/recommendations on how to ...

how can i limit my django foreign key selection by a property stored in the django session

i have a small application i am implementing with django and i'm having a slight challenge. I'm trying to limit the queryset for my relationships within my application by a particular property. Now the catch is, the exact value of the property isn't known until the user logs into the application. an example is limiting a set of comments ...

Python and Postgres on Red Hat

I've been having trouble installing psycopg2 on linux. I receive the following error when I try to import psycopg2. Python 2.6.4 (r264:75706, Nov 19 2009, 14:52:22) [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import psycopg2 Traceback (most recent call last...

Django Celery causes an import error on runserver command

When I issue a runserver command, an ImportError is raised from djcelery (Django Celery). % python manage.py runserver ~/Workspace/django-projects/no-labels/src Validating models... Unhandled exception in thread started by <functi...

How to filter a django queryset using an array on a field like SQL's "IN" ?

I'd like to filter a django queryset using an array as a constraint on a field. AKA, my array, for example, a set of primary keys. I want to get only the objects that would be in that array, like the query in SQL would be SELECT * from table where id in [1,3,4,5,6....]; ...