Register
Login

Django HTML Admin Widget
3.5.2009

I was a bit annoyed at the lack of WYSIWYG fields for Django's admin interface. I was originally planning to use FCKEditor but couldn't find a polished Django implementation (although I'm sure there is one out there). Instead I opted to use TinyMCE due to this nice Django widget implementation. After running setup.py, installation is a cinch - I just added from tinymce import models as tinymce_models, and replaced instances of models.TextField() with tinymce_models.HTMLField(). To customize the options available to TinyMCE, I was able to add this to my settings.py:

 

TINYMCE_DEFAULT_CONFIG = {
    'theme': "advanced",
    'theme_advanced_toolbar_location ...
1 comments
Django Caching
29.4.2009

The site just got mildly reddited, so I've decided to implement some caching in order to deal with possibly higher loads in the future (when I unveil a large-scale autonomous project that I've been working on). On my ongoing quest of Django awesomness, I have recently stumbled upon generic views, which somewhat clouded the idea of caching.

First, the Django docs provide an example that lists something like (r'^foo/(\d{1,2})/$', cache_page(my_view, 60 * 15)), to be put in urls.py in order to cache a view. However, this is quite contradictory to their other references ...

no comments
Captcha
29.3.2009

Bots started posting spam here this morning, so I implemented my own captcha based on FIGlet. I may eventually switch to reCAPTCHA, but it didn't work to my liking last time I implemented it.

FIGlet offers several benefits over traditional captchas at this time. First, FIGlet doesn't have to do any CPU intensive image generation. FIGlet is also a much simpler program in general, which makes it more malleable to the developer as compared to something such as PIL. And most important (at least for now), every capcha bot that I have seen is based on OCR. Because ...

5 comments
<3 Django
27.3.2009

Let me save you lots of trouble, and start by saying that Django is the perfect MVC framework. Ok, maybe not perfect, but compared to others it certainly looks that way. The community and documentation alone are enough reason to switch your existing projects - not to mention the built-in admin interface and endless time-saving features. Each week I learn about some new that could have saved hours of coding.

Moreover, Python's functional programming attitude combined with the Django furthering the concepts of DRY for the web create a rapid development and high performance environment that blows PHP out of ...

5 comments
SFW/NSFW URL Shortener
17.8.2009

I have thrown together the beginnings of a new URL shortener this afternoon. You can check it out at SFW.im and N.SFW.im. The URLs are pretty self explanatory, so I will leave them at that.

Please not that the N/SFW site is not production ready, and I still have to create a UI and API. However, do feel free to try it out.

6 comments