Django Framework Quick Blog Tutorial

django-blog-cover

After we have Python and Django on our environment, why we are not trying to create a project. That will make us easier to understand the basic knowledge in how Django works. This framework is looking different for me, since i’ve been getting familiar with ASP MVC, Laravel or Codeigniter. But when i tried Django, i was thinking wow it’s really out of my mind, i never see the framework like this, usually the MVC framework separated into Model, View, and Controller, but in Django we call controller in views.py. The other thing, in Laravel the views page (html) are using blade engine, therefore you will have html file with extension page.blade.php, either in Rails you will have extension page.html.rb. But in Django you will never see something like that, your html will be html without need to add another extension, and i think it’s cool and  very clean.

I have tried to find the tutorial in how to create some project using Django that i think it will make me easier to understand, and finally i found the screencast tutorial on Youtube in how to create Django blog in 16 minutes by Arun Ravindran. Thank’s to Mr. Arun for this awesome tutorial. 😀

But now, the latest version of Django Framework is 1.8.1. And i found that markdown package (wysiwyg plugin) are not working on that. So i decide to change the markdown with CKEditor. Follow the screencast steps, and i’will share you the codes that you need to write.

The Codes :

Take a look the directory place, ensure you are migrating as screencast steps.

Dir file : qblog/urls.py

Dir file : qblog/settings.py

Dir file : blog/urls.py

Dir file : blog/models.py

Dir file : blog/admin.py

Dir file : blog/test.py

Django CKEditor Installation :

You can follow steps and find the details in this official link.

1st. Open command line and type pip install django-ckeditor-updated.

2nd. Add ckeditor to your INSTALLED_APPS setting.

3th. Add codes below on your settings.py.

4th. Try to runserver, if you get notice on command line related with import flatatt, open widget.py file under directory C:\Python34\Lib\site-packages\ckeditor then find codes below :

change into this codes :

Easy right? Run your server to ensure it’s working. You can clone this project from my github account. 🙂

FatkhanFauzi About FatkhanFauzi

A passionate software engineer who wants to share anything that he learns and some of his life experiences. Want to know more about him? see Fatkhan Fauzi Profile


One Comment

So, what do you think ?

Leave a Reply

%d bloggers like this: