I had the same problem as you, since the book was written using an older
django version and there was some changes on csrf for django version
1.2. Looking at django docs
https://docs.djangoproject.com/en/1.3/ref/contrib/csrf/#how-to-use-it
you can read recommended way to use this
On 06/08/11
On Sun, Aug 7, 2011 at 10:35 AM, Jimmy wrote:
> Hi,
>
> I got the error "Caught ImportError while rendering: No module named
> urls" when using:
>
> {% url 'card.views.create_card' %} in the template file
>
For django 1.2 and earlier versions you should use the syntax {% url
card.views.create_car
I'm only working a few weeks with Django and I want some advice about
handling images.
Conceptual I have to remind myself that Django is pure python, so that makes
me complicate things sometimes. Also I still have some conceptual
difficulties with templates and template_tags. Also I'm not real
This question is related to django-tables. I hope I am allowed to post here.
I will appreciate some help on how to use Django Paginator with
django-tables. Below is what I have been working with:
report.py
import django_tables as tables
from webapp.models import Transaction
class T
Are you saying that you want to show some form inputs conditionally
based upon configuration, for example for each user?
If that's your goal then it's very easy to do by adding the logic in the
form's __init__. Add/remove fields there and (possibly) override save()
if you have to take any addi
I realize that I went from too little information, to too much information
in the previous post, so this is an attempt to find a middle ground.
What I'm building is the ability to have a list of checkable options, and
depending on the setup for a give option it may have a text field to enter
ad
It's more that I want to have different ways of displaying the same form
field. I want the text field to be on the same line as the checkbox when
it's an input field and below it when it's displayed as a textarea. There's
also the point of changing the required setting of the same field based on
The validation is easy. Override the form's clean() method to do any
validation which needs to check the value of more than one field. For
example, if you want a text box to be required sometimes, define it as
not required in the form, then check the boolean in clean() and raise a
forms.Validat
While trying to construct an example from the django book chapter7.
I used the following import code in my views.py
from mysite.form.forms import ContactForm
now ContactForm is a class in forms.py located in
"D:\Django-1.3\django\bin\mysite\form"
where mysite=dir
form=dir
forms= python file
Con
Python 2.6.1
Django (1, 3, 0, 'final', 0)
hello I've added Category model to apps models
class Category(models.Model):
app_label = _('News')
title = models.CharField(max_length=50)
slug= models.SlugField(unique=True)
description = models.TextField()
In a
I think i know why this isnt working becuase the form folder does not have an
init.py init.py init.
So my qustion is how do u import a class from a python file in a random folder?
From: hayya...@hotmail.com
To: django-users@googlegroups.com
Subject: Why isnt this simple import working??
Date:
Got it working just inserted a init.py file init. so it got recognized as a
python directory
From: hayya...@hotmail.com
To: django-users@googlegroups.com
Subject: RE: Why isnt this simple import working??
Date: Sun, 7 Aug 2011 19:48:03 +
I think i know why this isnt working becuase
I think if you should read http://docs.python.org/tutorial/modules.html,
specially packages part
On 07/08/11 21:51, Hayyan Rafiq wrote:
Got it working just inserted a init.py file init. so it got
recognized as a python directory
-
Hi just started facing the same problem which you did in chapter 7 . I tried
using
def contact(request):
if request.method == 'POST':
form = ContactForm(request.POST)
if form.is_valid():
cd = form.cleaned_data
send_mail(
cd['subject'],
Here is how i did it
@csrf_exempt
def contact(request):
if request.method == 'POST':
form = ContactForm(request.POST)
if form.is_valid():
cd = form.cleaned_data
send_mail(
cd['subject'],
cd['message'],
cd.g
consider http://code.google.com/p/django-photologue/
On 8/7/2011 11:33 PM, Josh wrote:
I'm only working a few weeks with Django and I want some
advice about handling images.
Conceptual I have to remind myself that Django i
Perhaps one of these:
http://schbank.wordpress.com/2010/09/28/django-application-a-simple-gallery/
http://djangopackages.com/grids/g/gallery/
http://gitorious.org/django-simple-gallery/django-simple-gallery/trees/master
On 8/7/2011 11:33 PM, Josh wrote:
I
Check the comments on LHS of the Book page. In there is a simple
method that works and does not need to remove the middleware.
Specifically (as there are loads of comments)
Frank Kruchio's comment in the comment section next to this text
Try running this locally. Loa
The images and creation of thumbnails aren't the problem. I'll look into the
1th and 3rd. I've looked at a lot of image apps that might give a solution
to my problem, but none fitted my requirements.
I'm not sure how to get the images in the content. There might be no image
at all, but also on
Maybe I should add I don't want to manually assign the images, but script
this as much as possible. It involves 1000s of images.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com
You can add name to the url in the urlpatterns:
urlpatterns = patterns('',
url(r'card/create$', 'card.views.create_card',
name='card_create_card'),
)
and call it in the template:
{% url card_create_card %}
On Aug 7, 1:05 pm, Jimmy wrote:
> Hi,
>
> I got the error "Caught ImportError while r
21 matches
Mail list logo