Practical Django Projects source code

63 views
Skip to first unread message

fernando...@gmail.com

unread,
Oct 8, 2008, 8:56:32 PM10/8/08
to Django users
I wonder if James could release the original code, even if slightly
broken or outdated. It would be great to have it on GitHub where
people could fork it and correct or update it.

If that's not possible, does anyone have the source code, typed from
the book? I'm specially interested in the code that is not printed on
the book but that is mentioned on it as being available for download,
like the templates for the generic views of the blog.

Cheers!

Brandon Taylor

unread,
Oct 9, 2008, 1:45:08 AM10/9/08
to Django users
Hi,

Unfortunately the source code isn't available from the Apress site
yet, and there's no mention of when it might be available either. I've
been through all of the samples in that book, and they work, with a
few tweeks for 1.0.

You can download Coltrane from DjangoPlugables.com, but there are no
HTML templates included. I'm currently in the process of adding a
Coltrane-like blog to a project, and if you use the generic date-based
views, writing your HTML templates is pretty simple.

Check out django.views.generic.date_based.py to see what all of the
context variables are for your templates.

Cheers,
Brandon

On Oct 8, 7:56 pm, "fernandoacorr...@gmail.com"

secondmouse

unread,
Oct 9, 2008, 3:19:08 PM10/9/08
to Django users
Hope this link help: http://code.djangoproject.com/browser/djangoproject.com/django_website/templates/blog

You need to adjust the field names in your templates according to your
coltrane app. For example, my coltrane/entry_archive.html looks like
this

<html>
<head>
<title>Entries index</title>
</head>
<body>
<h1>Entries index</h1>
{% for entry in latest %}
<h2>{{ entry.title }}</h2>
<p>Published on {{ entry.pub_date|date:"F j, Y" }}</p>
{% if entry.excerpt_html %}
{{ entry.excerpt_html|safe }}
{% else %}
{{ entry.body_html|truncatewords_html:"50"|safe }}
{% endif %}
<p><a href="{{ entry.get_absolute_url }}">Read full entry</
a></p>
{% endfor %}
</body>
</html>

fernando...@gmail.com

unread,
Oct 9, 2008, 5:20:08 PM10/9/08
to Django users
Thanks to you both for the help.
Reply all
Reply to author
Forward
0 new messages