Viewing posts tagged python
We're going to explain a few things about Python's object model here. Python's object model (at least with regard to data) can be viewed as being similar to Java's and C#'s if one considers only those languages' "class types", which are reference types.
We're going to create a simple, locally-deployed Django 2.0 web site here. Django is a backend web application framework for Python and is deployed using WSGI - the Python Web Services Gateway Interface. The Django code is essentially the controller in an MVC-style web application in which the models and views are supplied by the developer.
We're going to roll our own HTML table generator here. Most programmers have had fun at least once in their lives manually writing HTML. Once the practice is mastered, however, it's not something they want to continue to do - they're content to let the front-end design people handle it (if even they do any of it manually these days). But sometimes that's not an option, which is why many Python web frameworks provide HTML generation for forms, tables, and other kinds of markup.
We're going to roll our own hexdump program here. A hexdump program is a useful tool for a Python programmer. It allows one to learn about UTF-8 and other Unicode character encodings, examine input and output data, troubleshoot Python source code encoding, and so on.
I was working with the mezzanine cms (built on django) and saw it was moving towards python3 support. Since the django and mezzanine projects prefer postgresql I decided it was time to check out the python database adapter for postgresql - psycopg - in python3.
In order to put up a python3 application on apache with mod_fastcgi I turned to the flup fastcgi-to-wsgi adapter which is also used by the django project for fastcgi deployment.
I needed to put up a python3 application on apache but had a python2/mod_python application that I couldn't touch, and since python2/mod_python and python3/mod_wsgi didn't play together (even with mod_wsgi in daemon mode), I used python3 with mod_fastcgi.