// author archive

Joost

Joost has written 19 posts for Django Days

Django 1.0 mail notification of new comments

There are some old samples available online for doing this, but the 1.0 version of Django is not compatible with those. So I thought I’d share my solution for sending notification mails whenever there’s been posted a new comment on my Django site using Django signals.
The old way of connecting to a signal was:
dispatcher.connect(myFunction, signal=models.signals.post_save, [...]

Awesome Django Cheat sheet

The guys from Mercurytide released an updated version of their superhandy Django Cheat Sheet. Especially useful when you’re just starting with Django.
http://www.mercurytide.co.uk/whitepapers/django-cheat-sheet/

Debugging Django

I was looking for something similar to print_r in PHP for Django. I haven’t really found something other than:

import pprint
pprint.pprint(dir(modelorobject))

and using:
{% debug %}
in your template, wich display all kinds of debug info.
If anyone has more info on debugging Django, or a print_r kind of way of outputting debug info, please use the comments.
In this context [...]

Error using New Comments in Django 1.0

After upgrading to Django 1.0 I got the following error when using the new comment framework in one of my templates:
Caught an exception while rendering: Reverse for ” not found.
After some searching I read somewhere I had to delete the old .pyc files (from before the Django upgrade). After doing that, everything worked as [...]

Django ImageField validation error caused by incorrect PIL installation on MAC

I kept getting a validation error in the django admin pages while trying to upload an image. The validation error said:
Upload a valid image. The file you uploaded was either not an image or
a corrupted.
I really broke my brains on this one but finally got it to work! I knew for sure that [...]

Django Tutorial: Create a Wiki in 20 minutes

A great beginners tutorial is the “Create a Wiki in 20 minutes” by Siddhi from Silver Stripe Software.
In the tutorial you’ll learn the basics of Django by walking you through the development of a simple wiki application. Other aspects in the tutorial are: URL design, database interaction, Django templates and editing pages using Markdown syntax.
The [...]

Bug? ImageField validation error

Go to c:/python2.4/lib/site-packages/django/core/validators.py
or
/usr/lib/python2.4/site-packages/django/core/validators.py , if you
are using Fedora
comment the following lines (the line numbers in my version is 186 and
187
trial_image = Image.open(StringIO(content))
trial_image.load()
could be related to http://code.djangoproject.com/ticket/7608

Tip: Create models.py from existing database

Ever wanted to use an old, existing, legacy database with a Django Project? That’s totally possible!
Django allows you to create a models.py file based on an existing database. To do this, you first have to make sure your database settings are properly specified in the settings.py file. Here’s an example of what the database settings [...]

Tutorial: Writing you first Django app

The best tutorial to start with when beginning with Django is found on the Django Project website (www.djangoproject.com).
It assumes you already have Django installed, and takes you through the basics of the fabulous framework:
http://docs.djangoproject.com/en/dev/intro/tutorial01/

Categories

  • No categories

Django Hosting:

DjangoDays recommends the following Django hosting provider: