Django Techblog Comment test
Please test the comment system on this post. Django Techblog was build for my own needs to be able to easily display code in posts and to allow readers to insert code in to comments without linking to external sites.
To insert code in to a comment use the [code]
tag, you may optionally supply a language to syntax highlight the pasted code. For example [code python]import this[/code]
should produce something along the following lines:
import this
Some other tags you can use are: [b] [i] [s] [size] [url] [quote]
To get things started, lets pretend we are discussing the following piece of code which is in use in this blog, and is used to send out mails when a comment is made. The decorator is my version of Django's signals, which I will probably blog about at some point!
@broadcast.recieve() def new_comment(object, comment): if isinstance(object, models.Post): comment.moderated = True comment.visible = True comment.group = "blog.%s" % object.blog.slug comment.save() domain = Site.objects.get_current().domain td = {} td['name'] = object.blog.owner.get_full_name() td['comment'] = comment.content_text td['post'] = object.title td['url'] = "http://%s%s#comment%s" % (domain, object.get_absolute_url(), comment.id) mailer.send("admin/mail/newcomment.txt", td, "New Comment", object.blog.owner.email) else: raise broadcast.RejectBroadcast
int cool(char * thing) {
printf(“%s”, thing);
}
int main( int argc, const char* argv ) {
cool(“html mangler”);
}
Well, I’m just starting to read your book “Beginning Game Development with Python and Pygame” and it’s cool. I’ve read only 1 chapter and I realised that I want to focus on web development with Python, that’s why I’m writing to you.
¿Have you published any book like the one I'm reading but focused on web development? If not, ¿could you recommend me how to start making web apps. with django?
My regards from Argentina,
Please answer me soon.
Alan
PS: If you type
And now, for a test: