Writing a personal webpage

How a friend saved me time - 02/03/20

I tried to understand the Django framework when I was in engineering school, but things seemed much clearer and simpler when I wrote this website. A friend - thanks Etienne - helped me select the right resources and the right tools, which probably saved me a lot of time.

The first step was to understand the logic of the framework by skimming the Mozilla Developer Network (MDN) Django tutorial, just to understand the logic of the framework. The objective is to be able to find relevant information quickly, not to have understood it all. The most important parts for my website, were the introduction and 2-3-4-5. Part 11 was important for the deployment aspect.

Once I was familiar with the basics of django, I chose the graphical aspect of the server, which serves as a guide to write the templates. I used the style Editorial of html5up.net, because the most popular ones are probably the best written ones and that I believe that the others were not sober enough.

To write the templates, familiarity with HTML and CSS goes a long way, while writing the rest of the website is easier when one is familiar with python. The code can be found on a github repository. Once everything was written and looked great locally, I had to deploy the website.

Following my friend's advice, I used digitalocean for hosting and bought my domain names on namecheap. This digitalocean guide on setting up django with postgres, nginx and gunicorn enabled me to get things going quickly, while paying attention to the advice on MDN about deploying a Django website for deployment.

At that point, I have a functioning website that runs at the IP of my server. The next step is to use the right domain names.m, which is done by following the steps in this digitalocean guide on adding domains.

Once this step is taken care of, there are couple of little details that I wanted to get right, and those are well documented in digitalocean tutorials:

Warning: A frustrating thing is that the redirections are sometimes cached in the browser, which means that going to www.robinvogel.me will still redirect to robinvogel.me, but without changing the name in the browser address bar. From my limited perspective, the true redirections are seen by writing curl -I robinvogel.fr.

The performance of the website can be measured using gtmetrix.com which seems to give more detailed info than pingdom.com. The steps I took to improve that aspects were:

and then it's all done !

To see the changes when one rewrites for example a django template, simply restart gunicorn sudo service gunicorn restart, while other changes, e.g. to static files are seen with sudo service nginx restart.

Back to article list - Written on the 02/03/20.