Created on 29 Aug 2018 ;    Modified on 24 Jul 2020 ;    Translationitalian

The rstblog project

rstblog is a simple blog driven by articles written using the reStructuredText markup language.

I developed it using Django, based on the Python language.

The basic idea is to adopt a hybrid publication model, halfway between a static site (pure html) and a dynamic one (all inside a DB, as Wordpress).

In practice, the author writes his article locally, at his PC, in a text file, using a markup language. As markup language you can use:

After that, he puts a series of lines at the top of the article; they serve to categorize it, indicating the language used (the markup language and the human language used to write the article contents :-) the title, and other attributes ...

He adds a line of text, of fixed format, which separates the attributes from the article content.

Finally he calls an address (URL) of the site that allows him to upload the article. If the user is not logged in to the site, this address asks for user and password.

When the article is uploaded to the site, rstblog uses its attributes to classify it in the database. The content of the article is not loaded in the DB; when necessary, it is resumed from the file uploaded on the site.

If the author wants to modify the content of the article (or its attributes), he edits the file on his PC, then upload it again.

What are the reasons that led me to this design choice? The following:

  • I can always count on a local backup of all the contents of the site;
  • I can work without an Internet connection, and connect only when I want to upload;
  • the program is extremely light, it runs smoothly on servers with limited CPU capacity as with little RAM and HDU space (as long as accesses are contained, and I haven't this problem: my readers are an elite, so my accesses are very limited :-);
  • I do not renounce the flexibility and speed of research that a DB allows me;
  • if I have a few articles [1] the DB can be implemented with the support library of Python (sqlite3), without using big programs (in the sense that they commit a lot of resources) like MySQL, PostgreSQL, ...

The project consists of a demo site [2] and the Django application rstblog.

The features that the project currently implements are:

  • the index of articles, indicating the number of consultations of each article and the main attributes;
  • display of an article (or a page of the site);
  • upload of an article (or a page of the site);
  • complete reconstruction of the DB starting from the files of the articles uploaded to the site;
  • administration of the DB contents (who knows Django knows that I'm cheating: in the Django development environment this functionality is embedded);
  • generation of the site's sitemap.xml;
  • articles may have translations, they can be present in more than one language;
  • indication of site statistics; in the sense of how many articles are loaded, how many languages ​​are used, how many articles are present in each classification topic and language.

What are the contraindications to the use of this environment? The following:

  • the installation in production of a Django project is not trivial, but if you want to challenge yourself, I wrote (only in Italian language) an article about it: Installare una applicazione Django usando Nginx e Gunicorn; however this activity requires: complete control of the server (root user), and the system knowledge needed don't combine a disaster playing with the aforementioned user;
  • so as the adaptation of the site is not trivial; your needs are for sure different from mine, and to change the site that uses the app requests a bit of practice with Django.

If all this does not scare you, and you are the adventurous guy:

Enjoy by ldfa.


[1]Not so few: with hundreds articles, everything reacts well.
[2]Demo up to a certain point: I use it for my blog. Who knows me knows that I am a minimalist. What isn't there cannot be broken and it doesn't devise attention. And what isn't needed, there isn't.