http://docs.djangoproject.com/en/dev/ref/templates/builtins/#regroup
I can think of a few ways of doing it with loops but I'd particularly like to know if there is a neat one-liner.
...
I have configured my Django app to run under Apache+FastCGI on Linux (Ubuntu, if it matters). My question is: how to redirect stdout to a file when running Django as fastcgi.
EDIT
To clarify: I am familiar with django-logging module and yes I am using it already. This is not what my question is about.
Say when I run Django from the con...
I have m2m field, lets say it have name 'relations', so i want to allow user to send as many relations as he wants. I add new input to html with javascript with same name, like so
<input type='text' name='relations' value='a' />
<input type='text' name='relations' value='b' />
in cleaned_data i receive only value of second input ('b')...
Is it possible to deploy any CMS (Content Management System) using Google App Engine? Wikipedia lists 4 Python CMSes and one of them is Django based.
Do you know any way to make any of them to work on App Engine?
My votes:
Python
GuteCMS (revision 11 10/28/2009) Too simple. Barely usable.
cpedialog (both 1.0 and 2.0 beta) Too simp...
How can i hook-up WMD editor on to my django forms?
...
I have Windows XP/Django/apache/mod_python working on localhost. All parts are working with the exception of the admin CSS not rendering. The admin works, but no html formatting. I've made additions in:
settings.py
INSTALLED_APPS
'django.contrib.admin',
urls.py
from django.contrib import admin
admin.autodiscover()
(r'^ad...
I have the following Django and Flex code:
Django
class Author(models.Model):
name = models.CharField(max_length=30)
class Book(models.Model):
title = models.CharField(max_length=30)
author = models.ForeignKeyField(Author)
Flex
package com.myproject.models.vo
{
[Bindable]
[RemoteClass(alias="myproject.models.Book")]
...
I'm working on a Django-based web app in which the community fuels the content on the site, much like a wiki. Content is in the form of HTML, and users have total freedom to fork articles/chapters or make their own modifications to existing ones and add them to the current 'working version'. The maintainer of each article/chapter (the or...
I'm wondering what a controller - such as the following Rails controller - would look like in Django, to perform an ajax update of the page after an asynchronous form submission (assuming the following is correct):
def create
@omelet = Omelet.new(params[:omelet])
render :update do |page|
if @omelet.save
page.replace_html 'notice',...
I have Boys and Toys. Two django models. Toys can be owned by more than one Boy and each boy can own more than one Toy... So I've put a ManyToMany field in Boy.
If I want a list of toys owned by a single boy, it's easy. So good so far.
But now I need to get a list of Boys based on a Toy instance. The relationship should be symmetrical...
I'm having problems using {% ifequal s1 "some text" %} to compare strings with extended characters in Django templates. When string s1 contains ascii characters >127, I get exceptions in the template rendering. What am I doing wrong? I'm using UTF-8 coding throughout the rest of application in both the data, templates and Python code wit...
I have requirement like, each user of the site
will be mailing any other user and I have rules for that communication
(let them aside for now). So user1 will be picking an email id like:
[email protected] and will be sending an email to
user2, whose email id will be like:
[email protected]. Like that any num...
My memory usage increases over time and restarting Django is not kind to users.
I am unsure how to go about profiling the memory usage but some tips on how to start measuring would be useful.
I have a feeling that there are some simple steps that could produce big gains. Ensuring 'debug' is set to 'False' is an obvious biggie.
Can any...
ModelMultipleChoiceField doesn't select initial choices and I can't make the following fix (link below) work in my example:
http://code.djangoproject.com/ticket/5247#comment:6
My models and form:
class Company(models.Model):
company_name = models.CharField(max_length=200)
class Contact(models.Model):
company = models.ForeignK...
I need some help regarding django emailing. I have set the
settings.EMAIL_HOST_USER to '[email protected]' and whenever I
am trying to send an email in any context, its taking the 'do-not-
[email protected]' as from address and sending it, eventhough I supply
a different from-address while sending that specific email. How do I
fix t...
I have a small VPS server that has a Nginx front end that serves up static media files and passes Django requests back to an Apache 2.2 prefork MPM server running mod_wsgi.
With one (very) small site loaded and working, it's currently using 143MB of 256MB of RAM.
Using the top command I can see that Apache is using 52.9% of available R...
I am trying to create a custom form field and validate off it. This is version 1.0 of Django.
Here is my form object
class UsernameField(forms.CharField):
def clean(self, values):
print ""
Here is how I call it
class RegisterForm(forms.Form):
username = UsernameField(max_length=30, min_length=4)
password = forms.Ch...
I'm looking to add an extra set of pages to my auto-generated admin site. I want to generate reports off my models and some logs surrounding it. The actual generating isn't the issue.
How do I:
Make the report output look like it's an admin page, with breadcrumbs, similarly formatted table, etc?
Register the view so it shows up on the...
I have an application in production with a sub-standard admin interface. The app is written in PHP and is backed by PostgreSQL.
I have briefly tinkered with Django and am very impressed with how easy it is to get an admin interface up and running.
Can someone more experienced with Django please comment on:
Can I have Django build an...
Coming from a background in Django, I often use "template inheritance", where multiple templates inherit from a common base. Is there an easy way to do this in JSP? If not, is there an alternative to JSP that does this (besides Django on Jython that is :)
base template
<html>
<body>
{% block content %}
{% endblock %}
</body...