Posts

How to Use Django-Markdownx for Your Blog

Image
This is my first crack at using Django-Markdownx, which is  a comprehensive Markdown plugin built for Django that has raw editing and a live preview inside of the Django admin. I looked into many other ways to implement markdown (django-markdown, django-markdown2, django-markdown-duex), but the ability to drag & drop image uploads won me over. Implementing it is very straight forward, so let's begin there.

Cache Django View with Redis

Image
If you have views in your application that rarely change, this is a great opportunity to cache them to reduce response times. Caching your Django view will reduce unnecessary database calls and template rendering.

Django Pagination with Bootstrap

Image
There are some great Django pagination examples out there but none of them quite worked for me, so here's another one. If you are first starting out, pagination is "the process of dividing a document into discrete pages, either electronic pages or printed pages." 

Django Multiple Image Upload with Dropzone.js

Image
The easiest solution I have found to upload multiple images has been Dropzone.js. This is the second time I have implemented it in a Django app and I always end up customizing it a bit because I like the idea of only uploading when the user hits "submit." It's relatively straightforward, but required a bit of work in Django, JavaScript (jQuery here), HTML, and CSS.