Nikodem Roy Borkowski

image

Personal site and blog about Django, databases, coding and everything else that is essential for programming.

CONTACT ME

nikodem.roy@gmail.com

TheDjango.Dev- blog and personal website

The site you are currently on was fully written using the Django framework on the backend and DTL on the frontend. I wanted to be able to edit the content easily and intuitively, so the vast majority of the variables like texts, images and icons were written based on models. This made it possible to edit almost all the content of the site through the admin panel, without interfering with the frontend . In addition, thanks to the integration of external modules, I added the possibility of changing the language version by translating specific models as well as an extended CKEditor text editor to prepare posts.

core features:

1. Creation of posts in CKEditor (possibility to add meta description tag).

2. Profile to which posts and contact information are assigned .

3. Translation of selected models and static texts.

4. Saving choosen posts in cookies for later viewing.

5. Adding and displaying different comments depending on the language version.

6. Categories created based on reverse foreign relationship.

7. Sending messages via contact form.

8. Full responsiveness using pure CS (no framework).

Purpose and Goal

I wanted to create a blog as well as a personal site in which I could organize and consolidate my knowledge of programming in Python and Django in particular. I certainly could have used one of the many available solutions for this, but I decided to use the skills I had acquired and create a blog from scratch. This included not only the backend code, but also the design, which is ultimately on the frontend. This was a particularly important experience for me because I had to do the entire development and deployment process on my own.

I started my work by preparing mockups of individual views in Adobe XD, which were then transferred to HTML and CSS. I'm far from being a frontend expert, which is why I outsourced this stage to an external contractor with whom I collaborated throughout the view development stage. I wanted to have as much control as possible over the appearance of individual elements and minimize unnecessary code, so I decided to use pure CSS without a framework like bootstrap.

The backend work went much more smoothly, but it was not without challenges either. I decided to add an additional language version which required me to rethink the database architecture or find a ready-made solution that I could implement for this purpose. For a long time I considered what would be the most right solution.

I couldn't find one right way out and eventually chose a hybrid approach. The main and dynamic model-based content (such as posts) is created using the django-parler module, which is also responsible for displaying the correct language version. All more static text (single words that are not linked to a specific model) is translated using Rosetta. I took a more custom approach to comments, which are not based on an external module. They were written based on a model that has separate language fields, and specific content displayed depending on the language prefix in the URL.

Lessons Learned

This was the first project I wrote and launched by myself. During my work I encountered a fair number of challenges, but I managed to deal with each one. I found myself on stackoverflow many times, and using the site definitely became a habit for me. I also became convinced that a good programmer is the one who can use google effectively.

The issue of translating the site became an unexpectedly large task. Once more, a huge part of my knowledge and inspiration came from reading posts and blog entries, not without a few visits on stack, of course. I didn't try to reinvent the wheel, and I'm happy with the final form of the project.

However, the biggest challenge was the deployment process itself. I didn't want to take the easiest path and upload the finished code to Heroku. I knew that realistically this would be the fastest option, but I was determined to try my hand at a more commercial approach. After exploring the topic, I decided on a VPS at digitalocean. I went for proven and well-described solutions, so I chose a combination of Gunicorn as WSGI server and Nginx as web server. I must also admit that this was my first adventure with Linux, or at least the first one that was successful.

Summarizing, I was able to gain a lot of experience creating this application. Starting with preparing the mock-ups of the frontend, then working on the core of the application and finishing with getting the application up and running. Perhaps some steps could have been done faster or more efficiently, but I am fully confident that I will be able to apply the knowledge acquired during this process to any future project.

Stack: