<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>ilian.io</title><link>https://ilian.io/</link><description>Recent content on ilian.io</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 02 Apr 2017 00:00:00 +0000</lastBuildDate><atom:link href="https://ilian.io/index.xml" rel="self" type="application/rss+xml"/><item><title>Django and working with large database tables</title><link>https://ilian.io/django-and-working-large-database-tables/</link><pubDate>Sun, 02 Apr 2017 00:00:00 +0000</pubDate><guid>https://ilian.io/django-and-working-large-database-tables/</guid><description>&lt;p>The slides from my presentation for the Django Stockholm Meetup group. Contains small comparison between MySQL and PostgreSQL in terms of performance when modigying the tables structure.&lt;/p>


&lt;iframe src="//www.slideshare.net/slideshow/embed_code/key/2QSTkUXf7kVbgO" width="595" height="485" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" allowfullscreen> &lt;/iframe> &lt;div style="margin-bottom:5px"> &lt;strong> &lt;a href="//www.slideshare.net/IlianIliev/django-and-working-with-large-database-tables" title="Django and working with large database tables" target="_blank">Django and working with large database tables&lt;/a> &lt;/strong> from &lt;strong>&lt;a target="_blank" href="//www.slideshare.net/IlianIliev">Ilian Iliev&lt;/a>&lt;/strong> &lt;/div></description></item><item><title>Django Admin and Celery</title><link>https://ilian.io/django-admin-and-celery/</link><pubDate>Tue, 28 Feb 2017 00:00:00 +0000</pubDate><guid>https://ilian.io/django-admin-and-celery/</guid><description>&lt;h2>A weird race condition&lt;/h2>

&lt;p>&lt;strong>Updated solution, please check below!&lt;/strong>&lt;/p>

&lt;p>
 &lt;strong>Some background:&lt;/strong>

 We have a model that is edited only via the Django admin. The save method of the model fires a celery task to update several other records. The reason for using celery here is that the amount of related objects can be pretty big and we decided that it is best to spawn the update as a background job. We have unit and integration tests, the code was also manually tested, everything looked nice and we deployed it.
&lt;/p></description></item><item><title>SQLAlchemy and "Lost connection to MySQL server during query"</title><link>https://ilian.io/sqlalchemy-and-lost-connection-mysql-server-during-query/</link><pubDate>Sun, 24 Jul 2016 00:00:00 +0000</pubDate><guid>https://ilian.io/sqlalchemy-and-lost-connection-mysql-server-during-query/</guid><description>&lt;h2> ... a weird behaviour when pool_recycle is ignored&lt;/h2>


&lt;p>&lt;strong>Preface:&lt;/strong> This is quite a standard problem for apps/websites with low traffic or those using heavy caching and hitting the database quite seldom. Most of the articles you will find on the topic will tell you one thing - change the wait_timeout setting in the database. Unfortunately in some of the cases this disconnect occurs much earlier than the expected wait_timeout (default ot 8 hours). If you are in one of those cases keep reading.&lt;/p></description></item><item><title>Service Discovery with Smartstack</title><link>https://ilian.io/service-discovery-with-smartstack/</link><pubDate>Sun, 03 Jul 2016 00:00:00 +0000</pubDate><guid>https://ilian.io/service-discovery-with-smartstack/</guid><description>&lt;h2>A week of innovation&lt;/h2>

&lt;p>First of all I want to thank &lt;a href="https://www.lifesum.com/">Lifesum&lt;/a> for having another "Innovation Week", it is a great opportunity and I hope that more companies will start following it. In a few words the idea is to allow everyone from the company to freely pick a project or idea that they want to develop and and work on it for one week.
The benefits range from just making people happy because of the break of the routines and the opportunity to work on something a bit different, to seeing some pretty amazing prototypes that can be easily implemented in the company product.&lt;p>

&lt;h3>What is Service Discovery?&lt;/h3>

In summary service discovery is the possibility of the separate services in scalable infrastructure to communicate with each other and to the outside world. In other words - how to route the requests to the corresponding service while providing balanced load on the instances in the pool and monitoring their health.
Sounds simple, right?

&lt;p>Well, unfortunately service discovery in the real world is not that simple. In my presentation from the Stockholm Python MeetUp I talked a bit more about the complexity of service discovery, the suboptimal solutions and Smartstack - a solutions invented at AirBnB for simplifying the whole process.
You can see more about it in my presentation:&lt;/p></description></item><item><title>Django interview questions ...</title><link>https://ilian.io/django-interview-questions/</link><pubDate>Sun, 24 May 2015 22:41:24 +0000</pubDate><guid>https://ilian.io/django-interview-questions/</guid><description>&lt;h2>... and some answers&lt;/h2>

&lt;p>Well I haven't conducted any interviews recently but this one has been laying in my drafts for a quite while so it is time to take it out of the dust and finish it. As I have said in &lt;a href="https://ilian.io/python-interview-question-and-answers/">Python Interview Question and Answers&lt;/a> these are basic questions to establish the basic level of the candidates.&lt;/p>

&lt;ol>
	&lt;li>
		&lt;strong>Django's request response cycle&lt;/strong>&lt;br />
		You should be aware of the way Django handles the incoming requests - the execution of the middlewares, the work of the URL dispatcher and what should the views return. It is not necessary to know everything in the tiniest detail but you should be generally aware of the whole picture. For reference you can check "the live of the request" slide from my &lt;a href="https://ilian.io/introduction-to-django-presentation/">Introduction to Django&lt;/a> presentation.
	&lt;/li>
	&lt;li>
		&lt;strong>Middlewares - what they are and how they work&lt;/strong>&lt;br />
		Middlewares are one of the most important parts in Django. Not only because they are quite powerfull and useful but also because the lack of knowledge about their work can lead to hours of debugging. From my experience the &lt;em>process_request&lt;/em> and &lt;em>process_response&lt;/em> hooks are the most frequently used and those are the one I always ask for. You should also know their execution order and when their execution starts/stop. For reference check the &lt;a href="https://docs.djangoproject.com/en/1.8/topics/http/middleware/">official docs&lt;/a>.
	&lt;/li>
	&lt;li>
		&lt;strong>Do you write tests? How?&lt;/strong>&lt;br />
		Having well tested code benefits you, the project and the rest of the team that is going to maintain/modify your code. Django's built-in &lt;a href="https://docs.djangoproject.com/en/1.8/topics/testing/tools/">test client&lt;/a>, &lt;a href="https://github.com/kmike/django-webtest/">Django Webtest&lt;/a>, &lt;a href="https://factoryboy.readthedocs.org/en/latest/">Factory boy&lt;/a>, &lt;a href="https://github.com/joke2k/faker">Faker&lt;/a> or whatever you use, I would like to hear about it and how you do it. There is not only one way/tool for it so I would like to know what are you using and how. You should show that you understand how important is to test your code and how to do it right. 
	&lt;/li>
	&lt;li>
		&lt;strong>select_related and prefetch_related&lt;/strong>&lt;br />
		Django's ORM (as every other) can be both a blessing and a curse. Getting a foreign key property can easily lead you to executing million queries. Using &lt;em>select_related&lt;/em> and &lt;em>prefetch_related&lt;/em> can come as a saviour so it is important to know how to use them.
	&lt;/li>
	&lt;li>
		&lt;strong>Forms validation&lt;/strong>&lt;br />
		I expect from the candidates that they know how to build forms, to add custom validation for one field and how to validate fields that depend on each other.
	&lt;/li>
	&lt;li>
		&lt;strong>Building a REST API with Django&lt;/strong>&lt;br />
		The most popular choices out there are &lt;a href="http://www.django-rest-framework.org/">Django REST Framework&lt;/a> and &lt;a href="http://tastypieapi.org/">Django Tastypie&lt;/a>. Have you used any of them, why an how. What issues have you faced? Here is the place to show that you understand the concept of REST APIs, the correct request/response types and the serialisation of the data.
	&lt;/li>
	&lt;li>
		&lt;strong>Templates&lt;/strong>&lt;br />
		Building website using the built-in template system is often part of your daily tasks. This means that you should understand the template inheritance, how to reuse the block and so on. Having experience with &lt;a href="https://github.com/ojii/django-sekizai/">sekizai&lt;/a> is a plus. 
	&lt;/li>
&lt;/ol>
&lt;p>There are a lot of other things to ask about internationalisation(i18n), localisation(l10n), south/migrations etc. Take a look at the docs and you can see them explained pretty well.&lt;/p></description></item><item><title>PyCon Sweden 2015</title><link>https://ilian.io/pycon-sweden-2015/</link><pubDate>Tue, 19 May 2015 04:47:59 +0000</pubDate><guid>https://ilian.io/pycon-sweden-2015/</guid><description>&lt;p>In a few words &lt;a target="_blank" href="http://www.pycon.se/">PyCon Sweden 2015&lt;/a> was awesome. Honestly, this was my first Python conference ever but I really hope it won't be the last.&lt;/p>

&lt;p>Outside the awesome talks and great organisation it was really nice to spend some time with similar minded people and talk about technology, the universe and everything else.
 I have met some old friends and made some new ones but lets get back to the talk. Unfortunately I was not able to see all of them but here is a brief about
 those I saw and found really interesting:&lt;/p></description></item><item><title>Django, pytz, NonExistentTimeError and AmbiguousTimeError</title><link>https://ilian.io/django-pytz-nonexistenttimeerror-and-ambiguoustimeerror/</link><pubDate>Sun, 29 Mar 2015 23:02:44 +0000</pubDate><guid>https://ilian.io/django-pytz-nonexistenttimeerror-and-ambiguoustimeerror/</guid><description>&lt;p>&lt;strong>Brief:&lt;/strong> In one of the project I work on we had to convert some old naive datetime objects to timezone aware ones. Converting naive datetime to timezone aware one is usually a straightforward job. In django you even have a nice utility function for this. For example:&lt;/p>

&lt;/p>&lt;pre>&lt;code class="language-python">
import pytz
from django.utils import timezone


timezone.make_aware(datetime.datetime(2012, 3, 25, 3, 52),
 timezone=pytz.timezone(&amp;#x27;Europe/Stockholm&amp;#x27;))
# returns datetime.datetime(2012, 3, 25, 3, 52, tzinfo=&amp;lt;DstTzInfo &amp;#x27;Europe/Stockholm&amp;#x27; CEST+2:00:00 DST&amp;gt;)
&lt;/code>&lt;/pre>&lt;p>

&lt;p>&lt;strong>Problem:&lt;/strong> You can use this for quite a long time until one day you end up with something like this:&lt;/p></description></item><item><title>Working with intervals in Python</title><link>https://ilian.io/working-with-intervals-in-python/</link><pubDate>Sun, 22 Feb 2015 18:55:50 +0000</pubDate><guid>https://ilian.io/working-with-intervals-in-python/</guid><description>&lt;p>
&lt;strong>Brief:&lt;/strong> Working with intervals in Python is really easy, fast and simple. If you want to learn more just keep reading.
&lt;/p>

&lt;p>
&lt;strong>Task description:&lt;/strong> Lets say that the case if the following, you have multiple users and each one of them has achieved different number of points on your website. So you want, to know how many users haven't got any point, how many made between 1 and 50 points, how many between 51 and 100 etc. In addition at 1000 the intervals start increasing by 100 instead of 50.
&lt;/p></description></item><item><title>Resurection</title><link>https://ilian.io/resurection/</link><pubDate>Sun, 22 Feb 2015 18:38:26 +0000</pubDate><guid>https://ilian.io/resurection/</guid><description>&lt;p>Well, as some of you may have seen this blog was on hold for quite a long time. There were multiple reasons mainly my Ph.D. and changing my job but it is back online.
&lt;/p>

&lt;p>&lt;strong>So, what is new?&lt;/strong>
&lt;/p>
&lt;p>
As a start this blog is no longer running on wordpress. The reason is that I had some issues with wordpress - the blog was hacked twice due to security holes in wordpress/plugins, it was terribly slow and the code looked like shit. Lots of inline styles and javascript etc. So I made a simple Django based blog that generates static content. Alse we have new design and new domain, the last one much easier to remember )))
&lt;/p></description></item><item><title>Python Interview Question and Answers</title><link>https://ilian.io/python-interview-question-and-answers/</link><pubDate>Sun, 28 Apr 2013 22:49:32 +0000</pubDate><guid>https://ilian.io/python-interview-question-and-answers/</guid><description>&lt;p>&lt;strong>Update 2:&lt;/strong> You can also check the follow up post &lt;a href="https://ilian.io/django-interview-questions/">Django interview questions&lt;/a>.&lt;/p>
&lt;p>For the last few weeks I have been interviewing several people for Python/Django developers so I thought that it might be helpful to show the questions I am asking together with the answers. The reason is ... OK, let me tell you a story first.&lt;br />
I remember when one of my university professors introduced to us his professor - the one who thought him. It was a really short visit but I still remember one if the things he said. "Ignorance is not bad, the bad thing is when you do no want to learn."&lt;br />
So back to the reason - if you have at least taken care to prepare for the interview, look for a standard questions and their answers and learn them this is a good start. Answering these question may not get you the job you are applying for but learning them will give you some valuable knowledge about Python.&lt;br />
This post will include the questions that are Python specific and I'll post the Django question separately.&lt;/p></description></item><item><title>Django for Web Prototyping</title><link>https://ilian.io/django-for-web-prototyping/</link><pubDate>Mon, 15 Apr 2013 20:46:36 +0000</pubDate><guid>https://ilian.io/django-for-web-prototyping/</guid><description>&lt;h2> Or how to use the benefits of Django template system during the PSD to HTML phase&lt;/h2>
&lt;p>There are two main approaches to start designing a new project - Photoshop mock-up or an HTML prototype. The first one is more traditional and well established in the web industry. The second one is more alternative and (maybe)modern. I remember a video of Jason Fried from 37 Signals where he talks about design and creativity. You can see it at &lt;a href="http://davegray.nextslide.com/jason-fried-on-design">http://davegray.nextslide.com/jason-fried-on-design&lt;/a>. There he explains how he stays away from the Photoshop in the initial phase to concetrate on the things that you can interact with instead of focusing on design details.&lt;/p></description></item><item><title>Introduction to Django - presentation</title><link>https://ilian.io/introduction-to-django-presentation/</link><pubDate>Mon, 18 Mar 2013 08:31:11 +0000</pubDate><guid>https://ilian.io/introduction-to-django-presentation/</guid><description>&lt;p>This presentation shows the basics of Django - what is inside the framework and explains the Model-View-Template system. One of the most important parts is a diagram how the request is processed and the response is generated. Shows the project and the application structure and the basic elements - Models, URLs dispatcher, Views and Templates.&lt;br />
&lt;iframe src="http://www.slideshare.net/slideshow/embed_code/17310332" width="597" height="486" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> &lt;/iframe>
&lt;div style="margin-bottom:5px"> &lt;strong> &lt;a href="http://www.slideshare.net/IlianIliev/introduction-to-django-17310332" title="Introduction to django" target="_blank">Introduction to django&lt;/a> &lt;/strong> from &lt;strong>&lt;a href="http://www.slideshare.net/IlianIliev" target="_blank">Ilian Iliev&lt;/a>&lt;/strong> &lt;/div></description></item><item><title>Functions in Python Homework</title><link>https://ilian.io/functions-in-python-homework/</link><pubDate>Sat, 16 Mar 2013 09:42:03 +0000</pubDate><guid>https://ilian.io/functions-in-python-homework/</guid><description>&lt;p>After some delay(please excuse me for it) here are sample solutions of the problems defined in the presentation &lt;a href="https://ilian.io/functions-in-python-presentation/">Functions in Python&lt;/a>. Solutions are also available at &lt;a href="https://gist.github.com/IlianIliev/5175694">GitHub&lt;/a>.&lt;/p>
&lt;p>&lt;script src="https://gist.github.com/IlianIliev/5175694.js">&lt;/script>&lt;/p></description></item><item><title>Functions in Python presentation</title><link>https://ilian.io/functions-in-python-presentation/</link><pubDate>Mon, 18 Feb 2013 07:22:19 +0000</pubDate><guid>https://ilian.io/functions-in-python-presentation/</guid><description>&lt;p>Here is my presentation part of the in company Python course.&lt;/p>
&lt;p>&lt;iframe src="http://www.slideshare.net/slideshow/embed_code/16586837?rel=0" width="597" height="486" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> &lt;/iframe>
&lt;div style="margin-bottom:5px"> &lt;strong> &lt;a href="http://www.slideshare.net/IlianIliev/functions-in-python" title="Functions in python" target="_blank">Functions in python&lt;/a> &lt;/strong> from &lt;strong>&lt;a href="http://www.slideshare.net/IlianIliev" target="_blank">Ilian Iliev&lt;/a>&lt;/strong> &lt;/div>
&lt;p>The last slide - "Problem to solve" is something like a simple homework. Sample solutions will be uploaded later this week.&lt;/p></description></item><item><title>Simple Site Checker and the User-Agent header</title><link>https://ilian.io/simple-site-checker-and-the-user-agent-header/</link><pubDate>Mon, 22 Oct 2012 19:22:15 +0000</pubDate><guid>https://ilian.io/simple-site-checker-and-the-user-agent-header/</guid><description>&lt;p>&lt;strong>Preface: &lt;/strong> Nine months ago(I can't believe it was that long) I created a script called &lt;a href="https://ilian.io/simple-site-checker/">Simple Site Checker&lt;/a> to ease the check of sitemaps for broken links. The script code if publicly available at &lt;a href="https://github.com/IlianIliev/Simple-Site-Checker">Github&lt;/a>. Yesterday(now when I finally found time to finish this post it must be "A few weeks ago") I decided to run it again on this website and nothing happened - no errors, no warning, nothing. Setting the output level to DEBUG showed the following message "Loading sitemap ..." and exited.&lt;br />
Here the fault was mine, I have missed a corner case in the error catching mechanism i.e. when the sitemap URL returns something different from "200 OK" or "500 internal server error". Just a few second and the mistake was fix.&lt;/p></description></item><item><title>Automation, Fabric and Django - presentation</title><link>https://ilian.io/automation-fabric-and-django-presentation/</link><pubDate>Wed, 03 Oct 2012 20:12:07 +0000</pubDate><guid>https://ilian.io/automation-fabric-and-django-presentation/</guid><description>&lt;p>As a follow up post of &lt;a href="https://ilian.io/automated-deployment-with-ubuntu-fabric-and-django/">Automated deployment with Ubuntu, Fabric and Django&lt;/a> here are the slides from my presentation on topic "Automation, Fabric and Django". Unfortunately there is no audio podcast but if there is interest I can add some comments about each slide as part of this post.&lt;/p>
&lt;p>&lt;iframe src="http://www.slideshare.net/slideshow/embed_code/13986186/?rel=0" width="597" height="486" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px" allowfullscreen> &lt;/iframe>
&lt;div style="margin-bottom:5px"> &lt;strong> &lt;a href="http://www.slideshare.net/IlianIliev/automation-fabric-django-and-more" title="Automation - fabric, django and more" target="_blank">Automation - fabric, django and more&lt;/a> &lt;/strong> from &lt;strong>&lt;a href="http://www.slideshare.net/IlianIliev" target="_blank">Ilian Iliev&lt;/a>&lt;/strong> &lt;/div>
&lt;p>If there is anything that need explanation feel free to ask.&lt;/p></description></item><item><title>Django project file structure</title><link>https://ilian.io/django-project-file-structure/</link><pubDate>Mon, 24 Sep 2012 20:33:00 +0000</pubDate><guid>https://ilian.io/django-project-file-structure/</guid><description>&lt;p>As I promised in &lt;a href="https://ilian.io/automated-deployment-with-ubuntu-fabric-and-django/">Automated deployment with Ubuntu, Fabric and Django&lt;/a> I will use this post to explain the file structure that I use for my Django projects and what I benefit from it. So here is my project directory tree.&lt;/p>
&lt;h2>The structure&lt;/h2>
&lt;pre>
~/workspace/&amp;amp;lt;project_name&amp;amp;gt;/
|-- bin
|-- include
|-- lib
|-- local
|-- src
 |-- .git
 |-- .gitignore
 |-- required_packages.txt
 |-- media
 |-- static
 |-- &amp;amp;lt;project_name&amp;amp;gt;
 | |-- &amp;amp;lt;project_name&amp;amp;gt;
 | | |-- __init__.py
 | | |-- settings
 | | | |-- __init__.py
 | | | |-- &amp;amp;lt;environment_type&amp;amp;gt;.py
 | | | |-- local.py
 | | |-- templates
 | | |-- urls.py
 | | |-- views.py
 | |-- manage.py
 | |-- wsgi.py
 |-- &amp;amp;lt;project_name&amp;amp;gt;.development.nginx.local.conf
 |-- &amp;amp;lt;project_name&amp;amp;gt;.&amp;amp;lt; environment_type&amp;amp;gt;.nginx.uwsgi.conf
 |-- &amp;amp;lt;project_name&amp;amp;gt;.&amp;amp;lt; environment_type&amp;amp;gt;.uwsgi.conf
&lt;/pre>
&lt;h2>Explanation&lt;/h2>
&lt;p>At the top I have a directory named as the project and virtual environment inside of it. The benefit from it is complete isolation of the project from the surrounding projects and python packages installed at OS level and ability to install packages without administrator permissions. It also provides an easy way to transfer the project from one system to another using a requirements file.&lt;br />
The &lt;strong>src&lt;/strong> folder is where I keep everything that is going to enter the version control project source, requirements files, web server configuration etc.&lt;br />
My default &lt;strong>.gitignore&lt;/strong> is made to skip the pyc-files, the PyDev files and everything in the static and media directories.&lt;br />
The &lt;strong>media&lt;/strong> directory is where the MEDIA_ROOT settings point to, respectively &lt;strong>static&lt;/strong> is for the STATIC_ROOT.&lt;br />
All required packages with their version are placed in &lt;strong>required_packages.txt&lt;/strong> so we can install/update them with a single command in the virtual environment.&lt;br />
In a directory with the name of the project is where the python code resides. Inside it the project structure partly follows the new project layout introduced in &lt;a href="https://docs.djangoproject.com/en/dev/releases/1.4/#updated-default-project-layout-and-manage-py">Django 1.4&lt;/a>.&lt;br />
The big difference here is the settings part. It is moved as a separate module where all common/general settings are place in &lt;atrong>__init__.py&lt;/strong>. We have one file for each possible environment(development, staging, production) with the environment specific settings like DEBUG and TEMPLATE_DEBUG. In &lt;strong>local.py&lt;/strong> are placed the settings specific for the machine where the project is running. This file should not go into the repository as this is where the access database password and API keys should reside.&lt;br />
I having one local Nginx configuration file because I use the webserver to serve the static files when working locally this is the &lt;strong>&amp;lt;project_name&amp;gt;.development.nginx.local.conf&lt;/strong>.&lt;br />
For each environment there is also a couple of configuration files - one for the web server(&lt;strong>&amp;lt;project_name&amp;gt;.&amp;lt; environment_type&amp;gt;.nginx.uwsgi.conf&lt;/strong>) and one for the uwsgi(&lt;strong>&amp;lt;project_name&amp;gt;.&amp;lt; environment_type&amp;gt;.uwsgi.conf&lt;/strong>). I make symbolic links pointing to these files so any changes made are automatically pushed/pulled via version control, I only have to reload the configuration. There is no option to change something in the configuration at one station and to forget to transfer it to the rest.&lt;/p></description></item><item><title>Automated deployment with Ubuntu, Fabric and Django</title><link>https://ilian.io/automated-deployment-with-ubuntu-fabric-and-django/</link><pubDate>Tue, 18 Sep 2012 19:56:18 +0000</pubDate><guid>https://ilian.io/automated-deployment-with-ubuntu-fabric-and-django/</guid><description>&lt;p>A few months ago I started to play with Fabric, and the result was a simple script that &lt;a href="https://ilian.io/fabric-and-django-how-to-automate-new-project-start/">automates the creation of a new Django project&lt;/a>. In the last months I continued my experiments and extended the script to a full stack for creation and deployment of Django projects.&lt;/p>
&lt;p>As the details behind the script like the project structure that I use and the server setup are a bit long, I will keep this post only on the script usage. I will write a follow-up one describing the project structure and server.&lt;/p></description></item><item><title>The road to hell is paved with regular expressions ...</title><link>https://ilian.io/the-road-to-hell-is-paved-with-regular-expressions/</link><pubDate>Tue, 31 Jul 2012 20:25:37 +0000</pubDate><guid>https://ilian.io/the-road-to-hell-is-paved-with-regular-expressions/</guid><description>&lt;h2>... or what is the cost of using regular expressions for simple tasks&lt;/h2>
&lt;p>&lt;a href="http://en.wikipedia.org/wiki/Regular_expression">Regular expressions&lt;/a> are one of the most powerful tools in computing I have ever seen. My previous post about &lt;a href="https://ilian.io/django-compressor-and-image-preloading/">Django compressor and image preloading&lt;/a> is a good example how useful they might be. The only limit of their use is your imagination. But "with great power, comes great responsibility" or in this case a great cost. Even the simplest expressions can be quite heavy compared with other methods.&lt;/p></description></item><item><title>Django compressor and image preloading</title><link>https://ilian.io/django-compressor-and-image-preloading/</link><pubDate>Mon, 30 Jul 2012 13:26:36 +0000</pubDate><guid>https://ilian.io/django-compressor-and-image-preloading/</guid><description>&lt;p>&lt;strong>Preface:&lt;/strong> Have you noticed how on some websites when you click on a link that opens a lightbox or any overlay for first time it takes some time to display the border/background/button images. Not quite fancy, right?&lt;br />
This is because the load of this images starts at the moment the overlay is rendered on the screen. If this is your first load and these images are not in your browser cache it will take some time for the browser to retrieve them from the server.&lt;/p></description></item><item><title>Python is not a Panacea ...</title><link>https://ilian.io/python-is-not-a-panacea/</link><pubDate>Mon, 11 Jun 2012 18:29:18 +0000</pubDate><guid>https://ilian.io/python-is-not-a-panacea/</guid><description>&lt;h2>... neither is any other language or framework&lt;/h2>
&lt;p>This post was inspired by the serial discussion on the topic "Python vs other language"(in the specific case the other one was PHP, and the question was asked in a Python group so you may guess whether there are any answers in favor of PHP). It is very simple, I believe that every Python developer will tell you that Python is the greatest language ever build, how easy is to learn it, how readable and flexible it is, how much fun it is to work with it and so on. They will tell you that you can do everything with it: web and desktop development, testing, automation, scientific simulations etc. But what most of them will forgot to tell you is that it is not a &lt;a href="http://en.wikipedia.org/wiki/Panacea_(medicine)">Panacea&lt;/a>.&lt;/p></description></item><item><title>Fabric &amp; Django</title><link>https://ilian.io/fabric-and-django-how-to-automate-new-project-start/</link><pubDate>Mon, 28 May 2012 12:43:01 +0000</pubDate><guid>https://ilian.io/fabric-and-django-how-to-automate-new-project-start/</guid><description>&lt;h2>Or how automate the creation of new projects with simple script&lt;/h2>
&lt;p>&lt;strong>Preface:&lt;/strong> Do you remember all this tiny little steps that you have to perform every time when you start new project - create virtual environment, install packages, start and setup &lt;a href="https://www.djangoproject.com/" target="_blank">Django&lt;/a> project? Kind of annoying repetition, isn't it? How about to automate it a bit.&lt;/p>
&lt;p>&lt;strong>Solution:&lt;/strong> Recently I started learning &lt;a href="http://docs.fabfile.org/en/1.4.2/index.html" target="_blank">Fabric&lt;/a> and thought "What better way to test it in practice than automating a simple, repetitive task?". So, lets mark the tasks that I want the script to perform:&lt;/p></description></item><item><title>HTTP Status Codes Site</title><link>https://ilian.io/http-status-codes-site/</link><pubDate>Wed, 01 Feb 2012 22:36:23 +0000</pubDate><guid>https://ilian.io/http-status-codes-site/</guid><description>&lt;p>During the development of &lt;a href="https://ilian.io/simple-site-checker/" title="Simple Site Checker - command line tool to monitor your sitemap links">Simple Site Checker&lt;/a> I realised that it would be useful for test purposes if there is a website returning all possible HTTP status codes. Thanks to &lt;a href="http://code.google.com/intl/bg/appengine/" target="_blank">Google App Engine&lt;/a> and webapp2 framework building such website was a piece of cake.&lt;/p>
&lt;p>The site can be found at &lt;a href="http://httpstatuscodes.appspot.com" target="_blank">http://httpstatuscodes.appspot.com&lt;/a>.&lt;/p>
&lt;p>The home page provides a list of all HTTP status codes and their names and if you want to get an HTTP response with a specific status code just add the code after the slash, example:&lt;br />
&lt;a href="http://httpstatuscodes.appspot.com/200" target="_blank">http://httpstatuscodes.appspot.com/200&lt;/a> - returns 200 OK&lt;br />
&lt;a href="http://httpstatuscodes.appspot.com/500" target="_blank">http://httpstatuscodes.appspot.com/500&lt;/a> - returns 500 Internal Server Error&lt;br />
Also at the end of each page is located the URL of the HTTP protocol Status Codes Definitions with detailed explanation for each one of them.&lt;/p></description></item><item><title>Simple Site Checker</title><link>https://ilian.io/simple-site-checker/</link><pubDate>Mon, 30 Jan 2012 22:03:13 +0000</pubDate><guid>https://ilian.io/simple-site-checker/</guid><description>&lt;h2> ... a command line tool to monitor your sitemap links&lt;/h2>
&lt;p>I was thinking to make such tool for a while and fortunately I found some time so here it is.&lt;/p>
&lt;p>&lt;a href="https://github.com/IlianIliev/Simple-Site-Checker">Simple Site Checker&lt;/a> is a command line tool that allows you to run a check over the links in you XML sitemap.&lt;/p>
&lt;p>&lt;strong>How it works:&lt;/strong> The script requires a single attribute - a URL or relative/absolute path to xml-sitemap. It loads the XML, reads all loc-tags in it and start checking the links in them one by one.&lt;br />
By default you will see no output unless there is an error - the script is unable to load the sitemap or any link check fails.&lt;br />
Using the verbosity argument you can control the output, if you need more detailed information like elapsed time, checked links etc.&lt;br />
You can run this script through a cron-like tool and get an e-mail in case of error.&lt;/p></description></item><item><title>Faking attributes in Python classes...</title><link>https://ilian.io/faking-attributes-in-python-classes/</link><pubDate>Mon, 30 Jan 2012 08:00:18 +0000</pubDate><guid>https://ilian.io/faking-attributes-in-python-classes/</guid><description>&lt;h2>... or how to imitate dynamic properties in a class object&lt;/h2>
&lt;p>&lt;strong>Preface:&lt;/strong> When you have connections between your application and other systems frequently the data is not in the most useful form for your needs. If you have an API it is awesome but sometimes it just does not act the way you want and your code quickly becomes a series of repeating API calls like api.get_product_property(product_id, property).&lt;br />
Of course it will be easier if you can use objects to represent the data in you code so you can create something like a proxy class to this API:&lt;br />
&lt;/p></description></item><item><title>Software for business</title><link>https://ilian.io/software-for-business/</link><pubDate>Tue, 24 Jan 2012 02:53:10 +0000</pubDate><guid>https://ilian.io/software-for-business/</guid><description>&lt;p>I am starting a new blog. The reason is that I want to keep this one more technically oriented while the other will be more business and customers oriented. Its name is &lt;a href="http://sfb.i-n-i.org">Software for business&lt;/a> and the idea is to show to the business in less technical details how the modern IT technologies like CRM &amp; ERP systems, web sites, e-commerce solutions, online marketing and so on can help their business.&lt;br />
If you find the topic interesting feel free to join.&lt;/p></description></item><item><title>Connecting Django Models with outer applications</title><link>https://ilian.io/connecting-django-models-with-outer-applications/</link><pubDate>Mon, 23 Jan 2012 22:05:34 +0000</pubDate><guid>https://ilian.io/connecting-django-models-with-outer-applications/</guid><description>&lt;p>&lt;strong>Preface:&lt;/strong> Sometimes, parts of the data that you have to display in your application reside out of the Django models. Simple example for this is the following case - the client requires that you build them a webshop but they already have &lt;a href="http://sfb.i-n-i.org/how-a-crm-solution-will-help-your-business/" title="What is CRM and it may help your business">CRM solution&lt;/a> that holds their products info. Of course they provide you with a mechanism to read this data from their CRM.&lt;/p></description></item><item><title>Python os.stat times are OS specific ...</title><link>https://ilian.io/python-os-stat-times-are-os-specific/</link><pubDate>Mon, 21 Nov 2011 07:00:02 +0000</pubDate><guid>https://ilian.io/python-os-stat-times-are-os-specific/</guid><description>&lt;h2>... no problem cause we have stat_float_times&lt;/h2>
&lt;p>&lt;strong>Preface:&lt;/strong> recently I downloaded &lt;a href="http://pytddmon.org/" title="Python Test Driven Development Monitor">PyTDDMon&lt;/a> on my office station and what a surprise - the files changes did not affect on the monitor. So I run a quick debug to check what is going on: the monitor was working running a check on every 5 seconds as documented but it does not refresh on file changes.&lt;/p>
&lt;p>&lt;strong>Problem:&lt;/strong> it appeared that the hashing algorithm always returns the same value no matter whether the files are changed or not. The calculation is based on three factors: file path, file size and time of last modification. I was changing a single file so the problem was in the last one. Another quick check and another surprise - os.stat(filename).st_mtime returns different value after the files is changed but the total hash stays unchanged. The problem was caused from st_mtime returning floating point value instead of integer.&lt;/p></description></item><item><title>Django CMS Plugins with selectable template ...</title><link>https://ilian.io/django-cms-plugins-with-selectable-template/</link><pubDate>Sun, 09 Oct 2011 21:25:07 +0000</pubDate><guid>https://ilian.io/django-cms-plugins-with-selectable-template/</guid><description>&lt;h2>... or how to reuse your plugins inside sections with different design&lt;/h2>
&lt;p>&lt;strong>Problem:&lt;/strong> Frequently on the websites I am developing I need to display same set of data in several different ways. For example if I have a news box that needs to appear in different sections of the website e.i. in sidebar, main content etc. Using &lt;a href="https://www.django-cms.org/" title="Django CMS" target="_blank">Django CMS&lt;/a> plugins make this quite easy.&lt;br />
For simplicity we will take the following case. An image/text tuple with two layout variations - image on left of text and image on right.&lt;/p></description></item><item><title>Neil Gaiman's Anansi Boys...</title><link>https://ilian.io/neil-gaimans-anansi-boys/</link><pubDate>Sun, 02 Oct 2011 22:00:41 +0000</pubDate><guid>https://ilian.io/neil-gaimans-anansi-boys/</guid><description>&lt;h2> ... an unexpected gift and unexpected dedication&lt;/h2>
&lt;div class="book-quote">
&lt;p>&lt;strong>YOU KNOW HOW IT IS.&lt;/strong> You pick up a book, flip to the dedication, and find that, once again, the author has dedicated a book to someone else and not you.&lt;/p>
&lt;p>Not this time.&lt;/p>
&lt;p>Because we haven't yet met/have only a glancing acquaintance/are just crazy about each other/haven't seen each other in much too long/are in some way related/will never meet, but will, I trust, despite that, always think fondly of each other...&lt;/p></description></item><item><title>Language redirects for multilingual sites with Django CMS ...</title><link>https://ilian.io/language-redirects-for-multilingual-sites-with-django-cms/</link><pubDate>Sun, 11 Sep 2011 14:15:13 +0000</pubDate><guid>https://ilian.io/language-redirects-for-multilingual-sites-with-django-cms/</guid><description>&lt;p>... or how to avoid duplicate content by keeping the current language in the URL&lt;/p>
&lt;p>&lt;strong>Preface:&lt;/strong> Earlier this year I posted about &lt;a href="https://ilian.io/django-cms-2-2-features-that-i-want-to-see/" title="Django CMS 2.2 features that I want to see">Django CMS 2.2 features that I want to see&lt;/a> and one of the things mentioned there was that once you have chosen the language of the site there is no matter whether you will open "/my_page/" or "/en/my_page/" - it just shows the same content. The problem is that this can be considered both duplicate and inconsistent content.&lt;br />
Duplicate because you see the same content with and without the language code in the URL and inconsistent because for the same URL you can get different language versions i.e. different content.&lt;/p></description></item><item><title>Retrieving Google Analytics data with Python...</title><link>https://ilian.io/retrieving-google-analytics-data-with-python/</link><pubDate>Tue, 06 Sep 2011 15:27:41 +0000</pubDate><guid>https://ilian.io/retrieving-google-analytics-data-with-python/</guid><description>&lt;h2>... or how to pull data about page visits instead of implementing custom counter&lt;/h2>
&lt;p>&lt;strong>Preface:&lt;/strong> OK, so you have a website, right? And you are using Google Analytics to track your page views, visitors and so on?&lt;em>(If not you should reconsider to start using it. It is awesome, free and have lost of features as custom segments, map overlay, AdSense integration and many more.)&lt;/em>&lt;br />
So you know how many people have visited your each page of your website, the bounce rate, the average time they spend on the page etc. And this data is only for you or for a certain amount whom you have granted access.&lt;/p></description></item><item><title>Foreign key to Django CMS page ...</title><link>https://ilian.io/foreign-key-to-django-cms-page/</link><pubDate>Thu, 14 Jul 2011 19:24:41 +0000</pubDate><guid>https://ilian.io/foreign-key-to-django-cms-page/</guid><description>&lt;h2> ... how to make usable drop-downs with Django CMS pages &lt;/h2>
&lt;p>&lt;strong>Problem:&lt;/strong> some times when you create custom applications or plugins for Django CMS you need a property that connects the current item to a page in the CMS. Nothing simple than this - you just add a ForeignKey in your model that points to the Page model and everything is (almost)fine. Example:&lt;/p>
&lt;pre>&lt;code class="language-python">
from cms.models import Page

class MyModel(models.Model):
 # some model attributes here
 page = models.ForeignKey(Page) 
&lt;/code>&lt;/pre>&lt;p>

If you registered your model in Django admin or just add a model form to it you will see something like this:
&lt;p style="text-align: center">&lt;img src="https://ilian.io/static/2011/07/django-admin.png" alt="Django Admin Screenshot" title="Django Admin Screenshot" width="563" height="342" class="alignnone size-full wp-image-438" />&lt;/p></description></item><item><title>Caching websites with Django and Memcached...</title><link>https://ilian.io/caching-websites-with-django-and-memcached/</link><pubDate>Tue, 12 Jul 2011 19:46:12 +0000</pubDate><guid>https://ilian.io/caching-websites-with-django-and-memcached/</guid><description>&lt;h2>... memcached installation, django configuration and how to use it for your website&lt;/h2>
&lt;p>After &lt;a href="https://ilian.io/caching-web-sites-and-web-applications/" title="Caching web sites and web applications - Why, Where, What and How of caching web sites">Caching web sites and web applications&lt;/a> and &lt;a href="https://ilian.io/when-to-use-caching-for-web-sites/" title="When to use caching for web sites - five major question to ask yourself before using cache">When to use caching for web sites&lt;/a> its time for a little sample. This sample shows the usage of Memcached for server-side application cache. The installation part is taken from my Ubuntu so it may differ depending from your OS/distribution.&lt;/p></description></item><item><title>When to use caching for web sites ...</title><link>https://ilian.io/when-to-use-caching-for-web-sites/</link><pubDate>Tue, 12 Jul 2011 05:25:38 +0000</pubDate><guid>https://ilian.io/when-to-use-caching-for-web-sites/</guid><description>&lt;h2>... five major question to ask yourself before using cache&lt;/h2>

&lt;p>After we learned about &lt;a href="https://ilian.io/caching-web-sites-and-web-applications/">Why, Where, What and How of caching web sites&lt;/a> now it is time to see when to use it.&lt;br />
The application cache is mainly used for speeding up and/or decreasing the load of frequently executed and(but not necessary) heavy resource using methods. So the first question is:&lt;/p>
&lt;h3>1) If you have method the consumes lots of CPU time and/or memory can it be optimised?&lt;/h3>
&lt;p>If you can optimize your code and make the method run faster and consume less resource than do this first and then reconsider whether you still need to cache it.. &lt;/p></description></item><item><title>Custom 404 Not Found page with Django CMS...</title><link>https://ilian.io/custom-404-not-found-page-with-django-cms/</link><pubDate>Sun, 03 Jul 2011 21:21:56 +0000</pubDate><guid>https://ilian.io/custom-404-not-found-page-with-django-cms/</guid><description>&lt;h2>... or how to make user editable 404 page that stays in the pages tree of the CMS&lt;/h2>
&lt;p>&lt;strong>Basics:&lt;/strong> Yes you need it! You need 404 page cause you never know what may happen to a link: bad link paste, obsolete or deleted article, someone just playing with your URLs etc. It is better for both you and your website visitors to have a beauty page that follows the website design instead of the webserver default one that usually contains server information which is possible security issue. With Django this is easy, just make a HTML template with file name 404.html, place it in you root template directory and &lt;em>voilà&lt;/em> - you are ready. You will also automatically have a &lt;em>request_path&lt;/em> variable defined in the context which caries the URL that was not found.&lt;/p></description></item><item><title>Django models ForeignKey and custom admin filters...</title><link>https://ilian.io/django-models-foreignkey-and-custom-admin-filters/</link><pubDate>Wed, 01 Jun 2011 22:31:29 +0000</pubDate><guid>https://ilian.io/django-models-foreignkey-and-custom-admin-filters/</guid><description>&lt;h2>... or how to limit dynamic foreign key choices in both edit drop-down and admin filter.&lt;/h2>
&lt;p>&lt;strong>The problem: &lt;/strong> Having a foreign key between models in django is really simple. For example:&lt;br />
&lt;/p>&lt;pre>&lt;code class="language-python">
class Question(models.Model):
 # some fields here

class Answer(models.Model):
 # some fields here
 question = models.ForeignKey(Question)&lt;/code>&lt;/pre>&lt;p>

Unfortunately in the real live the choices allowed for the connection are frequently limited by some application logic e.g. you may add answers only to questions created by you. In some simple(rare) cases this can be easy achieved using choices or limit_choices_to attributes in the models.ForeignKey call.
In the case of choices you just have to pass list/tuple each element of which contains the value to be stored and human readable name for the choice. Unfortunately this one is computed on server run and is not updated with new items during run-time.
If you use limit_choices_to you may pass to it some kind of filter expression e.g. limit_choices_to = {'pub_date__lte': datetime.now} but this not always can do the job.

&lt;strong>Speciality: &lt;/strong> So if you want dynamic choices in the admin drop down you have to write a method that will return list with options and bind it to the form(as shown in &lt;a href="https://ilian.io/django-forms-choicefield-with-dynamic-values/" title="Django forms ChoiceField with dynamic values…">Django forms ChoiceField with dynamic values…&lt;/a>) which is used by admin.
This will work great but if you decided to add this column in admin`s list_filter you will see all element from the connected model in filter. How to limit them to the same list used for the form choices?

&lt;strong>Solution: &lt;/strong> The simplest solutions is to extend RelatedFilterSpec, overwrite its default choices and add a single row to the model:
&lt;/p></description></item><item><title>Caching web sites and web applications...</title><link>https://ilian.io/caching-web-sites-and-web-applications/</link><pubDate>Wed, 25 May 2011 22:41:37 +0000</pubDate><guid>https://ilian.io/caching-web-sites-and-web-applications/</guid><description>&lt;h2>...Why, Where, What and How of caching web sites&lt;/h2>
&lt;p>&lt;strong>Basics of web page load: &lt;/strong> Every time when you open an webpage this results in a series of requests and responses between the client(your browser) and the web server that hosts the requested sites(most of the times this includes more the one servers). Each request tells the server that the client wants specific resource(CSS/JavaScript/image/etc.) and each response carries the resource content.&lt;/p></description></item><item><title>Internet Explorer, jQuery, AJAX and HTML5...</title><link>https://ilian.io/internet-explorer-jquery-ajax-and-html5/</link><pubDate>Mon, 28 Mar 2011 20:59:02 +0000</pubDate><guid>https://ilian.io/internet-explorer-jquery-ajax-and-html5/</guid><description>&lt;h2>... or how "invalid" HTML can break your JavaScript without a trace&lt;/h2>
&lt;p>&lt;strong>The problem:&lt;/strong> A few days ago I had the following case. A script that I wrote was working everywhere except in the Internet Explorer(IE) 8 and 7. To be honest I don`t remember the exact error message but when I use the built-in debugger it point me to a row X in jQuery.min.js(those of you who have ever opened a minified JavaScript file know that it is practically unreadable) and not only this, but also provide me with an useless trace-back totally unrelated to the function called. So I decided to start executing the code that break line by line(good for me that I was activated on a "click" so I knew at least where to start).&lt;/p></description></item><item><title>Querying ManyToMany fields in Django...</title><link>https://ilian.io/querying-manytomany-fields-in-django/</link><pubDate>Wed, 23 Mar 2011 19:15:25 +0000</pubDate><guid>https://ilian.io/querying-manytomany-fields-in-django/</guid><description>&lt;h2>... or how to select items that have one or more categories matching with other item categories&lt;/h2>
&lt;p>&lt;strong>The problem:&lt;/strong> having a Many To Many relation(ManyToManyField) is really useful when you have to link one object to many other. For example one artist may play in several styles, or a teacher can teach more than one subjects. I`ll use the latter example for the post. If you want to get all teachers that teach (for example) "music" you just have to do something like:&lt;br />
&lt;/p></description></item><item><title>Merar - The Emerging Markets Investment Network v2.0 ...</title><link>https://ilian.io/merar-the-emerging-markets-investment-network-v2-0/</link><pubDate>Sun, 20 Mar 2011 16:43:25 +0000</pubDate><guid>https://ilian.io/merar-the-emerging-markets-investment-network-v2-0/</guid><description>&lt;h2>... or how we redesigned &lt;a href="https://www.merar.com/" title="Merar - The Emerging Markets Investment Network">Merar`s website&lt;/a>&lt;/h2>
&lt;p>If you follow me on &lt;a href="http://twitter.com/#!/Ilian_Iliev" title="Follow me on Twitter">Twitter&lt;/a> maybe you have noticed that a week ago(to be more precise 11th of March) I tweeted about the new version of Merar. Unfortunately it took me 9 days before I find some time to post about what we do and what we expect. Before to continue with the changes I should mention that in "redesign" I mean some changes in the business model and logic as in the interface design(which I have to say is much simpler and intuitive then the previous one), so lets start with the changes:&lt;/p></description></item><item><title>I become a PhD Student</title><link>https://ilian.io/i-become-a-phd-student/</link><pubDate>Mon, 14 Mar 2011 20:37:33 +0000</pubDate><guid>https://ilian.io/i-become-a-phd-student/</guid><description>&lt;p>I am happy to say that I successfully passed the entry tests for a PhD student. So now I am part of &lt;a href="http://en.wikipedia.org/wiki/State_University_of_Library_Studies_and_Information_Technologies" title="SULSIT`s(State University of Library Studies and Information Technologies)">SULSIT(State University of Library Studies and Information Technologies)&lt;/a> PhD program. The program`s name is "&lt;strong>Automated Systems for Information processing and information management&lt;/strong>" and my thesis will be "&lt;strong>Research of the current methods and technologies for web sites and web application development&lt;/strong>". The dissertation have to be in Bulgarian but I will try to POST the table of content translated as well with a short resume for each chapter.&lt;br />
As always any ideas and suggestions are welcome.&lt;/p></description></item><item><title>Django CMS 2.2 features that I want to see</title><link>https://ilian.io/django-cms-2-2-features-that-i-want-to-see/</link><pubDate>Mon, 28 Feb 2011 23:07:14 +0000</pubDate><guid>https://ilian.io/django-cms-2-2-features-that-i-want-to-see/</guid><description>&lt;h2> ... this is the "&lt;a href="https://ilian.io/post-on-request/" title="Post On Request">Post on request&lt;/a>" for February 2011&lt;/h2>
&lt;p>&lt;strong>Preface:&lt;/strong> I have to admit that I was expecting a bigger interest in the "Post on request" topic but probably my blog is too young for this but I think I will try again(soon or not). The more important thing is that &lt;a href="http://www.ojii.ch/" title="Jonas Obrist">Jonas Obrist&lt;/a> is the indisputable winner of this month "contest". &lt;/p>
&lt;p>&lt;strong>Features: &lt;/strong>One of the most useful features in the next &lt;a href="https://www.django-cms.org/" title="Django CMS">Django CMS&lt;/a> must be the ability to copy placeholder's content between different language version of one page. For example imagine that you have a home page with several placeholder each with several plugins/snippets inside(latest news, featured products etc.) when creating new language version of the page it is really annoying when you have to add this one by one.&lt;/p></description></item><item><title>Portfolio</title><link>https://ilian.io/portfolio/</link><pubDate>Sat, 19 Feb 2011 15:49:21 +0000</pubDate><guid>https://ilian.io/portfolio/</guid><description>&lt;p>Bellow you can see some of the projects I have worked on.&lt;/p>

&lt;h2 class="padding_top">Merar&lt;/h2>
&lt;p>&lt;a href="http://merar.com" title="Merar - Investment network">&lt;img src="https://ilian.io/static/2011/02/merar1.jpg" alt="Merar - Investment network" />&lt;/a>&lt;a href="https://ilian.io/static/2011/02/bulbrokers.jpg">&lt;/a>&lt;/p>
&lt;p>I am proud to be a part of the team that created this network for connection between investor and entrepreneurs. Merar currently holds nearly 400 projects with total value of more than 7 billion dolars. Platform: Django.&lt;/p>
&lt;h2 class="padding_top">Bulbrokers&lt;/h2>
&lt;p>&lt;a href="http://bulbrokers.com/en" title="Bulbrokers">&lt;img src="https://ilian.io/static/2011/02/bulbrokers.jpg" alt="" title="bulbrokers" />&lt;/a>&lt;/p>
&lt;p>Bulbrokers is the leader of brokerage services on the Bulgarian market. It is a multilingual website built with Django and Django CMS.&lt;/p></description></item><item><title>Post on Request</title><link>https://ilian.io/post-on-request/</link><pubDate>Sun, 30 Jan 2011 21:13:22 +0000</pubDate><guid>https://ilian.io/post-on-request/</guid><description>&lt;p>In the last few weeks I have been little busy(and suffering from lack of inspiration) so my blog lacks of new posts but I see that there are people visiting it(especially for the &lt;a href="https://ilian.io/extending-django-cms-page-model/" title="Django CMS">Django CMS&lt;/a> stuff) so I am willing to start a "Post on Request" practice.&lt;/p>
&lt;p>The idea is simple - I will collect post theme requests in the first three weeks(or 21 days) of every month and after a choose based on your votes( and my decision ) I`ll go out with a post on the selected theme by the end of the week. Please keep your question in the following areas - Django, Django CMS, Web Development. Question in other areas will be considered too, but may stand out of my knowledge area. You can place your request &lt;a href="http://goo.gl/mod/tIEd">here&lt;/a> or check the list and vote for another one or just comment this post.&lt;br />
I hope that you will find this initiative interesting and join it.&lt;/p></description></item><item><title>Django forms ChoiceField and custom HTML output...</title><link>https://ilian.io/django-forms-choicefield-and-custom-html-output/</link><pubDate>Thu, 06 Jan 2011 18:26:03 +0000</pubDate><guid>https://ilian.io/django-forms-choicefield-and-custom-html-output/</guid><description>&lt;h2>... or what to do in case that you need a special design for your choice fields&lt;/h2>
&lt;p>&lt;strong>The problem:&lt;/strong> Few posts ago I talked(wrote) about &lt;a href="https://ilian.io/django-forms-choicefield-with-dynamic-values/" title="Django forms ChoiceField and with dynamic values">Django forms ChoiceField and with dynamic values&lt;/a> and now it is time to take a look at the front end and how we display these values to the user. I will use the code from that post:&lt;br />
&lt;/p>&lt;pre>&lt;code class="language-python">
class MyForm(forms.Form):
 my_choice_field = forms.ChoiceField(choices=MY_CHOICES)&lt;/code>&lt;/pre>&lt;p>

By default &lt;a href="http://www.djangoproject.com/" title="Django">Django&lt;/a> provide us with a simple drop-down list as visual representation of the choice field. Just create and instance of the form in your view, pass it in the context:
&lt;/p></description></item><item><title>Extending Django CMS Page model – part III</title><link>https://ilian.io/extending-django-cms-page-model-part-iii/</link><pubDate>Tue, 04 Jan 2011 21:57:58 +0000</pubDate><guid>https://ilian.io/extending-django-cms-page-model-part-iii/</guid><description>&lt;h2>... or the drawback of &lt;a href="https://ilian.io/extending-django-cms-page-model-part-ii/" title="Extending Django CMS Page model – part II">Extending Django CMS Page model – part II&lt;/a>&lt;/h2>
&lt;p>First of all please accept my apologies that I couldn't warn you for this drawback earlier but I was really busy in the last few weeks so let's skip directly to the problem.&lt;br />
If you remember in &lt;a href="https://ilian.io/extending-django-cms-page-model-part-ii/" title="Extending Django CMS Page model – part II">Extending Django CMS Page model – part II&lt;/a> we added a method to the NavigationNode class that return an instance of the corresponding Page object. If we use it in the way show here:&lt;br />
&lt;/p></description></item><item><title>Extending Django CMS Page model - part II</title><link>https://ilian.io/extending-django-cms-page-model-part-ii/</link><pubDate>Tue, 14 Dec 2010 22:50:51 +0000</pubDate><guid>https://ilian.io/extending-django-cms-page-model-part-ii/</guid><description>&lt;h2>... or how to use the extended model in your templates and especially in the built-in navigation&lt;/h2>
&lt;p>&lt;strong>The problem: &lt;/strong>As you can see in the &lt;a href="https://ilian.io/extending-django-cms-page-model/" title="Extending Django CMS Page Model">previous post&lt;/a> there is a very simple way to extend the page model with some custom fields without changing the core code. But how to use your custom fields inside your templates? If you have an instance of the Page model everything is fine. You can just access its properties and everything is fine. Unfortunately there is a problem if you try it inside a custom template used for show_menu template tag.&lt;/p></description></item><item><title>Extending Django CMS Page Model</title><link>https://ilian.io/extending-django-cms-page-model/</link><pubDate>Sun, 12 Dec 2010 18:48:21 +0000</pubDate><guid>https://ilian.io/extending-django-cms-page-model/</guid><description>&lt;h2>... or how to add some fields to the Page model in the admin without changing &lt;a href="http://www.django-cms.org/">Django CMS&lt;/a> core&lt;/h2>
&lt;p>&lt;strong>The problem: &lt;/strong> Some times the Page model just lack of something you need. In my case this was "page avatars". Long story short - I needed an image/avatar for each page in my CMS. So what I have to do was to add a field to the Page model that will keep the info about the avatar path.&lt;/p></description></item><item><title>Django forms ChoiceField with dynamic values...</title><link>https://ilian.io/django-forms-choicefield-with-dynamic-values/</link><pubDate>Sun, 05 Dec 2010 21:28:48 +0000</pubDate><guid>https://ilian.io/django-forms-choicefield-with-dynamic-values/</guid><description>&lt;h2>... or how to get a dynamic drop-down list with Django forms&lt;/h2>
&lt;p>&lt;strong>The problem: &lt;/strong>Lets say that you need a form with a drop-down list that have dynamic values. With Django this can be done simple and fast, but if you are new you may get yourself into a trap. In a standard form(with static values in the drop-down) your code will be something like this:&lt;/p>
&lt;pre>&lt;code class="language-python">
MY_CHOICES = (
 (&amp;#x27;1&amp;#x27;, &amp;#x27;Option 1&amp;#x27;),
 (&amp;#x27;2&amp;#x27;, &amp;#x27;Option 2&amp;#x27;),
 (&amp;#x27;3&amp;#x27;, &amp;#x27;Option 3&amp;#x27;),
)
 
class MyForm(forms.Form):
 my_choice_field = forms.ChoiceField(choices=MY_CHOICES)&lt;/code>&lt;/pre>&lt;p>
So if you want the values to be dynamic(or dependent of some logic) you can simply modify your code to something like this:
&lt;/p></description></item><item><title>SEOmoz meetup in Sofia, Bulgaria</title><link>https://ilian.io/seomoz-meetup-in-sofia-bulgaria/</link><pubDate>Tue, 02 Nov 2010 21:51:50 +0000</pubDate><guid>https://ilian.io/seomoz-meetup-in-sofia-bulgaria/</guid><description>&lt;p>First of all I want to thank to &lt;a href="http://www.seomoz.org/team/randfish">Rand Fishkin&lt;/a> from &lt;a href="http://www.seomoz.org/">SEOmoz&lt;/a> and the &lt;a href="http://www.webit.bg/">Webit&lt;/a> team for organizing this meetup.&lt;/p>
&lt;p>For a long time in the web world there was a feud between the developers and the SEO guys. Both groups claiming that their work is more important, more sophisticated and with bigger value to the client and website visitors. A have to admit that(as a developer) I was also focused only on my work ignoring the SEO part and leaving it to the others. But for the last year I started to give more attention to this field.&lt;/p></description></item><item><title>Back to the Tables...</title><link>https://ilian.io/back-to-the-tables/</link><pubDate>Thu, 30 Sep 2010 22:07:13 +0000</pubDate><guid>https://ilian.io/back-to-the-tables/</guid><description>&lt;h2>... or how table based layout still lives&lt;/h2>
&lt;p>When I first started to write HTML (about ten years ago) the web has nothing common to the current one. Modem connections, IE4/IE5 were the major browsers and Netscape was far far away in the competition. These were dark ages for the web. CSS was a new conception that every one mentions but few dared to use. These was the ages of the table based layouts - hard to do and impossible to maintain. Multiple colspans and rowspans, nested table, absolute HTML horror until you(or your boss) decide that "this page need some minor improvement" this was when the real hell started. One less or extra column usually destroys the whole layout. These may seem like a bad coding practice or joke to most of you but I`m sure that everyone that walked this way will agree with me about this.&lt;img src="https://ilian.io/static/2010/09/code.png" alt="table based layout" title="table based layout" />&lt;/p></description></item><item><title>Google Analytics referring sites and https</title><link>https://ilian.io/google-analytics-referring-sites-and-https/</link><pubDate>Thu, 16 Sep 2010 20:16:08 +0000</pubDate><guid>https://ilian.io/google-analytics-referring-sites-and-https/</guid><description>&lt;p>&lt;strong>The problem:&lt;/strong> recently a client reported the he does not see another site he owns in the list of referring sites in his Google Analytics account(for his main website) but was absolutely sure that he recieves trafic from this website.&lt;/p>
&lt;p>&lt;strong>The research and the reason:&lt;/strong> at first I thought that the problem is cause by the 301 redirects the site use to send you to the propper language version of the website(cookies based). But after some reasearch I found that these 301 redirects keep the original referrer so the problem was somewhere else. So I open a page from the second site, click a link to the main one and run "document.referrer" in the console, strange but the answer was empty. I tried it clicking link from other site and everything was ok, the result was the referring site so the problem really was with this one. After some more wondering what is really going on I finally noticed that the problem website was working under secured(https) connection.&lt;br />
According to &lt;a href="http://tools.ietf.org/html/rfc2616#section-15.1.3">RFC2616 section 15.1.3&lt;/a> &lt;/p></description></item><item><title>Python comparisons speed depends from the result</title><link>https://ilian.io/python-comparisons-speed-depends-from-the-result/</link><pubDate>Wed, 18 Aug 2010 09:52:39 +0000</pubDate><guid>https://ilian.io/python-comparisons-speed-depends-from-the-result/</guid><description>&lt;p>Recently I decided to check whether "less than or equal"(&amp;lt;=) is slower than "bigger"(&amp;gt;) and I was surprised from the result. In my case "bigger" was slower. I was amazed, according to the simple logic in the case of less then or equal we need one or two operation(for example we first check for equality and the for then for "is lower"), so I asked at &lt;a href="http://stackoverflow.com/">stackoverflow&lt;/a> what causes this and here is the answer.&lt;/p></description></item><item><title>Google stops Google Wave development</title><link>https://ilian.io/google-stops-google-wave-development/</link><pubDate>Thu, 05 Aug 2010 10:35:34 +0000</pubDate><guid>https://ilian.io/google-stops-google-wave-development/</guid><description>&lt;p>As stated in the &lt;a href="http://googleblog.blogspot.com/2010/08/update-on-google-wave.html">official Google blog&lt;/a> Google will discontinue &lt;a href="http://wave.google.com ">Wave&lt;/a> development(at least as an independent product). I looks like low user interest is the main reason for this decision.&lt;/p>
&lt;p>We have to admin that Wave creates a new point of view on the web technologies and it is little sad that this "new wave" meet its end so quickly but I doubt that Google will completely forgot Wave. I am pretty sure that we will see many of the Wave features in the upcomming Google social network(Google Me).&lt;/p></description></item><item><title>Google and social networks - wins and failures</title><link>https://ilian.io/google-and-social-networks-wins-and-failures/</link><pubDate>Tue, 27 Jul 2010 15:26:43 +0000</pubDate><guid>https://ilian.io/google-and-social-networks-wins-and-failures/</guid><description>&lt;h2>...will google finaly place itself on the top of social networks?&lt;/h2>
&lt;h3>Have you ever heard of &lt;a href="http://www.orkut.com/" target="_blank">Orkut&lt;/a>?&lt;/h3>
&lt;p>Most of the people will say "No". This was the first try of &lt;a href="http://google.com" target="_blank">Google&lt;/a> to take place in the world of the social networks. Ok, maybe not the first. I have to admit the the first was in the late 2003rd when Google offered to purchase Friendster, but their offer was declined. So they decided to start own project and in 2004th Orkut was launched with the hope that it will dethrone Facebook from the leading position. Although the big interest in the start it didn`t succeed to take the first place(by registered users) and is now on number 7 with 100 milion users. Some people blame Brazilians for overwhelming it and repulsing other members by using not English but Portuguese in social discussions. Since then Orkut is widely used in Brazil and India but not popular in the other countries.&lt;br />
So this was big failure number one(if you can call failure 100 milion users.)&lt;/p></description></item><item><title>Nokia 5230 Express Music - GPS Navigation</title><link>https://ilian.io/nokia-5230-express-music-gps-navigation/</link><pubDate>Tue, 25 May 2010 21:33:48 +0000</pubDate><guid>https://ilian.io/nokia-5230-express-music-gps-navigation/</guid><description>&lt;h2>The Myths about Integrated and  Assisted GPS&lt;/h2>
&lt;p>A week ago I bought Nokia 5230 from &lt;a title="M-tel Bulgaria" href="http://mtel.bg/checkpoint.php?lang=en">M-tel&lt;/a> mainly because of the integrated GPS. This is my first meet with this kind of device and after some GPS "problems" I`m ready share my experience(At the end of this post there is explanation how to turn on/off different types of positioning methods).&lt;/p>
&lt;p>Using Assisted + Integrated GPS the positioning is completed for a few seconds(outdoors) but(I noticed that later) this results in small GPRS traffic(mainly for the "cold start") which costs some money so I tried to avoid it and turned "Assisted GPS" off.&lt;/p></description></item><item><title>GAE, Timezones and weekdays...</title><link>https://ilian.io/gae-timezones-and-weekdays/</link><pubDate>Sun, 23 May 2010 08:03:17 +0000</pubDate><guid>https://ilian.io/gae-timezones-and-weekdays/</guid><description>&lt;h2>... or how to find the date of week in specified timezone, no matter where your server is.&lt;/h2>
&lt;p>&lt;strong>The problem&lt;/strong>: I maintain a site targeting user in single country(single timezone) and I have to create administration based on a day of week(show this on Monday, that on Tuesday etc.). The site is based on Google App Engine Platform.&lt;/p>
&lt;p>The simplest and most obvious solutions is to take the current time and add/substract the difference between server timezone and your target timezone. Unfortunately this is not going to work in our case.&lt;/p></description></item><item><title>About Me</title><link>https://ilian.io/about-me/</link><pubDate>Wed, 19 May 2010 21:57:30 +0000</pubDate><guid>https://ilian.io/about-me/</guid><description>&lt;p>
 &lt;img class="alignleft" src="https://ilian.io/images/avatar-big_hu_820e5e4e7c410821.jpg" width="200" height="324" alt="Ilian Iliev" title="Ilian Iliev" />
 Hi, my name is Ilian Iliev. I love programming especially when it involves Python and Django. I graduated from technical school in 2003 with a speciality "Radio and Television Technologies". Four years later(2007) I achieved bachelor degree in heat engineering, but programming have always been closer to my heart. During my engineering education I was working in the filed of web developing, and here I am now, having master degree in information technologies, professional web developer, but still having some interest in engineering stuff. I also like good music, cooking, fishing, traveling, playing chess, going out with friends and many other. So this is how I live between developing, engineering and real live.
&lt;/p></description></item><item><title>Lets start!</title><link>https://ilian.io/lest-start/</link><pubDate>Wed, 19 May 2010 21:57:30 +0000</pubDate><guid>https://ilian.io/lest-start/</guid><description>&lt;p>Hi, and welcome to my blog. I`m Ilian Iliev, software engineer(with heat engineering background) and passionate web developer. Here I`ll post articles about programing(python, django, google app engine etc.) as well as my adventures in real world - music, travel, chess and many others. Hope that you will find the useful and interesting, feel free to comment them and contact me.  Also English is not my native language so you`re welcome to correct me if I mess it up.&lt;/p></description></item></channel></rss>