In the spirit of creating my own website,  I decided that Python3 would be right because of its ease of coding, stable, reliable, increasingly mature and kept up to date,  programming language as there is.  I started as is smart to do, a learning experience of reinventing the wheel, in such a way that it’s not bloatware but incrementally adding one as simple as it gets thing, then another in such a way that one thing after another accomplishes the task, and it does so very well, simply as it can be done.

With that said.

First, I need the following, to traverse webpages in such a way that a session variable, known as a cookie variable, is required to remember a login, or authentication, or some other configuration of a webpage, such as a layout option of a page, for example, in 2 columns, or perhaps 3 columns, etc.  This is because a webpage is stateless, defined as no information connects one page to another, however, in what is known as a session, using a cookie session variable will allow to remember configurations from one webpage to another.

Next, I’ll need a way to receive data in the form of GET or POST requests.  I’ll need to login to a page, known as authentication. I also need a way to store the information provided from a server software using a database program. The server should be https via ssl and this encryption will keep sensitive data secure during the transmission of data, for example, address or payment information of a credit card.  And as a nicety, and really a requirement, backups of the database data periodically, every so often.

Python3 provides some import of modules to assist in web development, for example, to escape received unsanitized data from any formats or characters unaccepted.  It also provides connectivity to a database and a way to print, or output information to a request of data, as well as the usual things a programming language can do, such as string tinkering, such as replacing substring within a string, system files of the os traversing, and so forth.  Then UTF8 characters for the  international purpose is a feature.

My programs are stored in the folder structure like so.

🌐 = Internet webpages

Internal pages = database connectivity, session SQL code, error_handling, database schemas, etc.

project_name / www / html / Project_Name/🌐

                         / within the www folder

                         /  internal pages

The webpage is generated via MVC.

Simply, the Model, View, Controller design.

To start, the Controller is the index page.

Routes are mapped with parsing a os.environ variable.

There is a page that contains all the global variable, to keep with the spirit of DRY, do not repeat yourself software methodology.  The other commonly used mythology is KISS-it-gets, keep things simply simple, as it gets.  This is to combat complexity.  Code should be self documenting with to the point function, and method names, and variable names.  In the event, there is the minimalist of anything complex, vague, or even the slightest confusion usually from abstraction, a comment that is updated and current is used that describes the what, why, purpose, and any string literals allowed by a variable used. One final note, I use incremental testing of agile programming methodology.  Write some code, then immediately test what was just written. 

The code should be solid, as in reliable.  So any arbitrary inputs is dealt with in an expected way, and error handling gracefully informs what any problem may occur, e.g. syntax misspellings, etc.

Then the Internet Pages, each page has its own template.

To be continued…

This wordpress post is the first time I’m writing it exclusively from my mobile phone.  I installed the WordPress mobile app, that then recommended a similar app with the name JetPack mobile app because my WordPress has that plugin installed.  I would like to say that writing from my mobile phone is an interesting and comfortable experience from the comfort of my recliner, but also allows the option to save the post I’m writing incrementally without the server in draft mode, so really this post can be writen anywhere including on the go during travels, then it allows to publish once your back to an Internet connection, nice.

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *