angle-uparrow-clockwisearrow-counterclockwisearrow-down-uparrow-leftatcalendarcard-listchatcheckenvelopefolderhouseinfo-circlepencilpeoplepersonperson-fillperson-plusphoneplusquestion-circlesearchtagtrashx

About

11 August 2019 Updated 7 July 2020

This website is a multi-language CMS / Blog I build with Python, the framework Flask and SQLAlchemy. It is deployed on my ISPConfig3 (Nginx + Mariadb) server using Docker which is also used for development. The website features user registration, a lot of administrator functions, privacy and security, so this is not a small project. Some 'highlights':

Tech

  • Python 3 (3.7)
  • Flask
  • SQLAlchemy
  • Mariadb
  • Docker, docker-compose
  • Bootstrap4
  • Fontawesome
  • Tinymce
  • ISPConfig3

Deployment

Steps are development, staging and production, all using docker and docker-compose. Development uses the Flask development server, staging and production use the Gunicorn server. Finally, ISPConfig3 is used to control the domain, database and SMTP email, Nignx is configured as a reverse proxy.

Privacy

Do not expect to find here solutions like using CDNs, Google Analytics, Facebook plugins, etc. Privacy is one of the most important things in life. While impossible to prevent tracking us and collecting our valuable private data, I believe we all must make an effort to minimize this.

Security

Security always is a work in progress. It starts with design for security which also means that you must put a lot of effort in logging things. There are great tools  like OWASP ZAP and online services like securityheaders.com and detectify.com that can help you identify vulnerabilities. 

Multilanguage

While the text of this website is written in English, it supports multiple languages using the Flask-Babel extension. The other language texts are machine translated at the moment using the DeepL API and sometimes are far from perfect, but you can always edit the messages.po files.

Machine learning

Artificial intelligence (AI) is invading our lives in many ways. Python is the language used with machine learning and deep learning. Personally I do not like these developments because no one can be held liable for the decisions taken. But AI can also help us in good ways like recommending other news items at the end of a news item. 

More: Kivy

Was also looking for a Python GUI. Started using tkinter but soon found this had many limitations for my purpose. Bumped into Kivy and went building a first app with it. You can also deploy a Kivy app on Android, but do we want to support the Android ecosystem? Will also be posting about my Kivy project.

Whats next?

The next months I will try to document some of the things I did to make this work, like using SQLAlchemy without Flask-SQLAlchemy, avoiding poorly maintained Flask extensions, migrations using Alembic, minimizing the size of a Docker image, docker-compose configurations. 

Thank you, Peter

Leave a comment

Comment anonymously or log in to comment.

Comments (2)

Leave a reply

Reply anonymously or log in to reply.

avatar

Hallo Peter,
Super dat je zoveel kennis deelt op je site, goed leesbaar en je kan er wat van leren! IK volg i.p.v. Kivi https://beeware.org/. Wel een complexe setup en tot nu toe nog weinig ontwikkelingen voor het web, meer voor APPS.
Groet,
Marcel

avatar
peter 8 months ago Anonymous visitor (not logged in)

Hallo Marcel,
Nog bedankt voor je bericht. Beeware ziet er ook goed uit. Ben even gestopt met Kivy i.v.m. tijdgebrek. Was wel een leuk project om Flask op mijn OnePlus One met Ubuntu Touch te laten werken. Groeten, Peter