Django and Git

Working together for successful web development

A quick look at Django, an interesting back-end web development framework, and Git, the most popular method of keeping track of a sprawling set of inter-related files and folders.

Amongst many, there are two realities in today’s ever-expanding field of technology. Those are the complexity of having a competent digital presence, by way of a website, and secondly, when developing any worthwhile application such as a website, the sheer number of interdependent folders and files that are spawned.

About twenty years ago clunky, slow, amateurish websites comfortably viewable only on laptop or desktop, and just delivering some basic text and a few photos, may have been of some limited use. But they’ve been largely a waste of time for many years now, if they ever were much use.

To be relevant, websites have to offer fast, slick and efficient access to whatever experience a user is likely to be looking for, almost instantly, such as searching, communicating, making bookings, shopping, etc. And it has to be mobile first. No simple task!

Back-end (server-side, where the website files and folders sit) programming can be done in many languages, of which PHP would probably be the most popular. But since I’ve been spending a fair amount of time working with the Python language recently, I was looking at the Django back-end framework, which is built on Python. Though not up there yet with PHP, it has become very popular in recent years, in line with Python’s growing popularity.

As a first general purpose programming language Python is highly recommended for various reasons. Just one such reason would be the easy, English-language-type syntax. And skills in Python can be transferred to other programming languages. Another would be the availability of so many special-purpose code libraries for expanding the capabilities of basic Python. And of course, Python’s free, or open-source in jargonistic terms.

A back-end framework is usually modular and allows a website to do many things such as:

In doing all that, the framework usually generates thousands of coding and configuration files, and dozens or hundreds of folders. These usually require customisation by the developer, depending of the particular end-use application and specification. For example, a single comma in the wrong place, or a comma missing from a line in a key application file can crash the entire application. What if the development website crashes and we don’t even know which file might have caused the problem, or where the problem might be in a particular file? All we know is it was fine up to a particular point. Believe me, this can upset one’s equilibrium!

One great answer is an application called Git Version Control – ‘versioning’ for short. It is free, quick and easy to install on the developer’s local machine. It tracks changes to targeted folders and files, called the ‘repository’. Not only that, but one can revert from the latest work to any previously tagged working state. We can tag working states and add an appropriate label as we go along, so it’s quick and easy to revert to any desired point if needs be. Can save a ton of time and frustration.

We can also branch off the main project to try out different things before incorporating them into the main project. How convenient!

All this is done on the local machine, but it can be pushed to the cloud on Github, if one wants. This safeguards against losing work and ideal if more than one developer is working on the project. The free Github account repositories are open to the public, which might be a consideration. But the premium Github can be set to a private repository. Alternatively, local Git will work with BitBucket, which is cloud-based, and free BitBucket repositories are private for a team of up to 5 developers.

While on the subject of web development, I’ve spent most time on WordPress, which is a Content Management System (CMS) rather than a back-end web development framework. WordPress is based on PHP for server-side programming and uses quite a bit of JavaScript (not the same as Java) for making the front-end (what the user sees and uses on the screen) interactive, as well as HTML for content and CSS for styling. The is the normal function of a ‘Theme’ in WordPress, of which there are multitudes, and many free. On the other hand, a back-end framework like Django can be combined with a front-end framework like Bootstrap to do the content, styling and interactivity bit.

All these are great digital skills to work on building. But just bear in mind, Rome wasn’t built in a day, or as some American wiseguy said “It takes longer to build a skyscraper than a chicken coup!”, and so it is with web frameworks and websites! Two other key principles worth bearing in mind would be, in the vast majority of cases you get what you pay for, and cheap is just that – it is not a measure of value.