Search for:
Series on “Serving Static Files using Nginx with the Django Framework”

Part 1: Installing Django using Anaconda & VS Code

Django a web framework with which one can develop an entire app, backend and front end inclusive. To install Django on your computer depends on how you want to use it. The recommended way would be to start with installing Visual Studio Code as the Integrated Development Environment. Then install an the Python Extension as shown below

screenshot of VS Code showing the Python Extension
Screenshot of VS Code showing the Python Extension

NOTE: You must already have Python installed on your system.

We prefer using Anaconda. Install that too.

What you should have installed by now:

  1. Visual Studio Code, and the Python Extension
  2. Python
  3. Anaconda

Next, run the Anaconda Navigator app

Screenshot of Anaconda Navigator showing the "base" environment which is created by default
Screenshot of Anaconda Navigator showing the “base” environment which is created by default

Then create a new virtual environment by clicking “Create”. Name the environment “djangoAppEnv”.

Once the environment is created choose that environment

Screenshot of Anaconda Navigator showing the "djangoAppEnv" environment
Screenshot of Anaconda Navigator showing the “djangoAppEnv” environment

Then in the search box on the top right, search for django and install the django packages shown below (except django-location-field, not needed at the moment). Make sure to click on “All” in the drop-down menu next to the “Channels” button; this allows you to search for all packages, namely those installed and those not yet installed.

Screenshot of Anaconda Navigator showing the search results for "django"
Screenshot of Anaconda Navigator showing the search results for “django”

Now open your VS Code application.

In VS Code go ahead and launch a new terminal session; in the menu bar click on “Terminal” then click on “New Terminal”. In that new terminal type

conda activate djangoAppEnv
Screenshot of VS Code showing a terminal with "djangoAppEnv" virtual environment activated
Screenshot of VS Code showing a terminal with “djangoAppEnv” virtual environment activated

If successful the beginning of the prompt line will change from (base) to (djangoAppEnv).

You are ready to develop within the virtual environment. We’ll go into more details but for now you can install other python packages that you may need for your specific application. For example install tensorflow for Machine Learning things. To do so you’ll type in the terminal

conda install -c conda-forge tensorflow

This installs Tensorflow into your virtual environment (djangoAppEnv). Note that you also could do this using the Anaconda Navigator application by searching for “tensorflow”.

Building Advanced Technology Now Rather Than Later
Published in honor of Independence Day (6 July) in the Republic of Malawi

Since the 1960s computers have advanced significantly. Cars on the other hand have hardly changed. We explore these two technology products to show that whether a technology is complex or not does not explain a country’s failure of developing the technology. This philosophy is more important at the national level where one may hear arguments such as “We are not that advanced country, so we cannot do X”. Often this is said by a country (or more specifically countrymen) that is itself trying to be like that advanced country. So, as we celebrate, we believe these key points are worth noting:

  1. Nobody, country or person, altruist or hypocrite, will ever really teach you how a technology truly works. Not even if they genuinely wanted to!
  2. Thus, to make the best use of any technology you must adopt, adapt, or some other how participate not as a user but as a designer, manufacturer, supply chain supplier or such other role where you can have an insider’s view.
  3. Building complex systems requires a huge set of simple skills, not complex skills. An example of this is the building of an aeroplane which requires an incredible orchestration of numerous skills, including seemingly unrelated skills such as supply chain management. We can say therefore that, “Nobody builds the aeroplane. Each person does a somewhat simpler task that contributes to the making of the plane.” So the earoplane is built using what can be called “collective knowledge” which does not reside in any one individual. It goes without saying that this knowledge cannot be gained even from a billion hours of classroom work—it is knowledge that is minted in the course of the work.
  4. Thus, pretty much any country or company, can make most if not all technology products in existence today, from computers to rockets to vaccines because all these technology products often bring together simpler skills that a society with basic education can expect to already possess or easily acquire.
  5. Finally, to reiterate, the most useful and practical learning happens when actually building the product, the tool, the technology. That is why it is hardly possible to learn by observation, no matter how long that observation is for; there are many little things that can simply never be taught.  

The definition of technology is rather broad: Wikipedia says it is the sum of techniques, skills, methods, and processes used in the productions of goods. The technology can also be embedded into machines which can then be run by someone who lacks some skills. We look at the microchip and the car as examples of technologies.

The microchip, or more generally integrated circuit, began being used in earnest in the 1960s–indeed around the time that Malawi became an independent nation (6 July 1964). A microchip refers to a network of connected electronic components that are placed on a small die chipped from a larger substrate; presently the common substrate is a semiconductor such as silicon. The microchip components can be arranged in such a way as to carry out computations; when the components of the microchip are transistors and gates, the chip is a microprocessor. The beauty of the microchip is that it brings components together so densely that one can have thousands (2,250 is in the Intel 4004 chip in the 1970s) to billions of transistors in the processors of 2021 and thus be able to implement complex logic.

Back in the day chips were simple. When Malawi was gaining independence logic microchips had 1 to 10 transistors and 1 to 12 gates; one could perhaps point at these components while teaching another person about gates! That was the time to get into the chip business for sure, since things were much less complex. But it’s understandable that the country didn’t: we had a nation to start building and without the internet and the world wide web, perhaps news about these inventions never reached Malawi.

So chips were complex and unknown. But what of cars? As of 1964 cars had been around for around 100 years—if we arbitrarily choose the 1877 internal combustion engine by Nikolaus Otto as the beginning of the car revolution. Around 1964—1966 to be exact—the greatest innovation with regards to the car was the invention of the electronic fuel injection system that allowed much more precisely controlled delivery of fuel and air to the engine. However, the core of the engine was rather similar to what it had been many years earlier, efficiency improvements notwithstanding. In other words if someone was able to build an engine 100 years earlier, they would not have had too much trouble building one in the 1960s; conversely, if someone were to join the car revolution in the 1960s—rather than 1870s—they would not be that late to the game, since very little had changed. So at the time it would have made great sense to get in. But again, perhaps the state of things was such that we had other priorities.

What’s even more striking is that the car has since the 1960s not changed much! The internal combustion engines of 2021 are much like those of the 1960s, though modern cars are in general more intelligent thanks to advances in computing and to some degree better materials. The computer on the other hand has changed vastly; the making of the microprocessors has become so so complex that as of this writing there are really less than 10 companies that are truly killing it in the business of making microprocessors and other logic circuits(such as memory modules). The key companies in order of market share (in terms of volume) are: the Taiwanese giants Taiwan Semiconductor Manufacturing Company (TSMC) at 28 percent and United Microelectronics Corporation (UMC) at 13 percent, the Chinese Semiconductor Manufacturing International Corporation (SMIC) with 11 percent and the South Korean conglomerate Samsung with 10 percent. The likes of TSMC focus primarily on the manufacturing while getting their designs from American companies such as AMD and NVIDIA. Making chips has gotten overwhelmingly complex that setting up a manufacturing plant costs billions of United States Dollars! One may say complex and expensive is no good news.

But it is extremely important to learn this: computers or cars are not going to get easier to make. So, computer chips have indeed gotten more complex, but they will not be less complex in the future. But surely complexity of the technology cannot be a sound reason for not making something: cars have hardly changed over 200 years, and are really much simpler to make. Malawi as a country was very young during the ‘car revolution’ (defined as when Asian car makers were coming onto the scene) so perhaps then there weren’t enough people to get involved in this field. But now with a far more educated workforce if we are not able to even make such a simple technology product that has stayed static for two centuries, then it is worrying.

But what to do? The answer is DO. Really there is no apt moment to say this: “Just Do It!” It is important to know that no country, no entity, no company, in their right state of mind will give you the secret sauce for their technology. Let me share a story to illustrate this.

As of 2019 my football skills had become impressive. In my high school years I happened to be one of the worst players—I had come to believe. I could not make it into the school team because to get in you had to be really good player. Whenever I played football there was much laughter because it seems each time I got the ball I was going to make a comic move, a mistake so classic that people would laugh instead of get mad at me.

For seven years therefore I was known as the guy who could not play football. Then I moved to Abu Dhabi for college, where I heard fewer and fewer voices that said, “You are not a good player.” And indeed over time I became a reasonably good and respectable defender. I as an individual hadn’t changed much. I had just changed environments and beliefs; all along I had some capacity to play well. Often we all do have such capacity; the problem often is finding that environment where you can thrive. In fact such environments where you can show your capacity do not exist or come by so easily; you may have to create the environment.

So, “who will let the new player in?” In my smalltime soccer career our games have often been 7 v 7 people. Something interesting happens when a new player comes along: how to let her in? Does one on the team get out, giving up their spot? Or do we play 7 v 8—that is, change the game?

This 7v7 game really is somewhat how the technology industry is like. Nobody wants to get out of the game, so nobody will let you in. We see periodically fights over intellectual property and lawsuits against Asian companies that got truly good at copying. This shows that in truth we will never have someone come down from the North or heaven to hand us the keys to the technology kingdom. We must create, even if it means copying others at the beginning. In fact we must copy and then adapt the technology to our context–the adaptation itself is often an organic process.

The history of Malawi stretches far back before independence, but for the sake of this article let us assume our history begins in 1960s. The country was uneducated, poverty reigned, the internet and WWW hadn’t been invented, electricity hardly a thing locally. One could understand why it may have been hard to do “Advanced Technology”. But in 2021, the population is far more educated (really more educated than America was when the Wright brothers built their plane!), on average people have sufficient food (minus the 2001/2 famine), there is some connectivity among people to facilitate the flow of ideas and knowledge both within the country as well as internationally. A lot of has changed. And yet a lot still hasn’t.

So then what’s stopping us? Perhaps people believe there is some magical, out-of-this-world kind of thing that we simply don’t know of? Perhaps there is a belief that we are a people that just cannot do “Advanced Technology” for whatever reason? The naked truth is that anything that is being built anywhere on God’s green Earth can be built in Malawi. This is the miracle of biology: the brains we have are like general purpose computers—they can be programmed to do anything. So just as we have been able to use the 12000-year+ technology called farming we can program ourselves to make quantum computers, to make Wi-Fi modules, 5G/6G gear; we can start setting up our own city on the moon and manned missions to Mars; we can locally develop mRNA vaccines against HIV; we can build the energy generation, transmission and distribution equipment so that we have over 30 gigawatts(which is about what is needed not 1 or 2 GW) of electrical energy capacity; we can do these and so much more. We just need to start. Now. In 1964 we were young and unsure in a world where information was locked behind university and corporate doors. Some information has since been unlocked but we have also seen that unless we make something with our own hands we never learn, because access to education and information alone is not enough. The only way for us to be a technologically advanced country is not to wait until we are a high-income nation; no, to be a high-income nation we must first develop and deploy advanced technologies. Remember the definition for technology: sum of techniques, skills, methods, and processes used in the production of goods—this definition requires what we have had all along: a versatile brain.

KCHKNA DNA: Our Philosophy, Our Culture!

Published in honor of World DNA day

What is a code?

To code means to represent information using symbols that we had agreed to earlier. For example, we could agree that when I raise my right hand it means “I am very, very happy” and if I clap twice it means “I am going to the market”. The two symbols are “raising my right hand” and “clapping twice”. Some of the reasons for using a code are: to simplify communication and to allow communication across large distances or across time. There are many codes in existence today. One famous one is the Morse Code which uses two symbols—represented visually by dashes and dots, or aurally by a long duration tone (equivalent to dash) and short duration tone (equivalent dot). An agreed-upon combination of these symbols is used to represent letters of the alphabet and the ten numerals of the (e.g. Arabic) numeral system (The numerals, 0,1,2, etc. are in fact also symbols that represent/encode the abstract mathematical objects called number—e.g. 1 represents the number 1.) These two Morse Code—dash and dot—symbols can then be used to encode any message we desire. To encode the word “KCHKNA” for example, we would use:

In Morse Codedash dot dashdash dot dash dotdot dot dot dotdash dot dashdash dotdot dash

Tip: On Android phones you can input characters using Morse Code. With the Google Virtual Keyboard, do so by going to “Languages”, choosing “English” and then scrolling to the right until you find the “Morse code” option

Human language is also a kind of code. We use an agreed-upon set of sounds to encode information. And while there are many human languages, there is ONE language that we all speak: the genetic code.

What is DNA?

Cells have to communicate with other cells and within themselves, too! For humans we use the code of language to, for example, issue an instruction such as “Stand up”. The listener understands because she knows the code. Likewise, the cell needs to talk using a language. The cell is continuously using a cryptic language to issue instructions about what proteins to produce in the body; these proteins can then be used for intracellular or intercellular communication, to build some structures in the body, or effect a change in a distant organ in the body.

 Proteins in the human body are made by chemically chaining together several amino acids (these are organic molecules). The human body uses about 22 amino acids to build its many proteins. 9 amino acids are called ‘essential’ because the body is not able to synthesize them by itself: so, it is essential that we ingest them. Often we do not directly consume amino acids; instead we consume proteins which the body then breaks down into its constituent amino acids.

Now, when all the amino acids are there, the cell needs to synthesize a specific protein. How does it tell the protein-making machinery (a key component being ribosome) to make a specific protein? The cell uses the genetic code to refer to specific amino acids.

Deoxyribonucleic acid (DNA) molecules are strung together in such a manner that they encode information. Just as we can code for a letter of the alphabet by arranging dashes and dots in one way (for Morse code), when DNA molecules are arranged in a specific way they can code for an amino acid. Instead of using just two symbols such as the dash and dot in Morse code, the genetic code consists of 4 symbols, referred to by their letters A, T, C, and G. Each amino acid is encoded by three of the four symbols. For example, the amino acid tryptophan is encoded by TGG.  There are other protein complexes in the cell that “understand” this language; they translate and execute the instruction. A region of DNA that codes for some protein or other functional unit (rather than just an amino acid) is generally called a gene, hence the term genetic code.

So while we may differ in the human languages we use, we all speak this one language called the genetic code!

Philosophy, culture and DNA

Any social grouping has what can be thought of as its DNA. This is the set of symbols used to communicate, the set of protocols and principles to be adhered to as well as the total sum of their knowledge, experiences, and wisdom. This is called the group’s philosophy. This philosophy then determines the group’s culture—that is what individual members or social functional units actually do (or not do).

Without prior agreements as to how to interpret symbols it is not possible to communicate and function as a unit. The cell issues instructions using the genetic code because of prior agreements as to how to interpret the symbols. Likewise, as a social unit (company) we must have a consensus as to what means what, what manner to behave, what rules of thumb to follow and more generally how to treat one another. Our emphasis on promoting a specific kind of culture does not imply this is the best culture or way of doing things. Not at all! (In fact, there is hardly any proof that one language is superior to another—it just happens that some languages manage to establish a stronger brand than others.) However, the important bit is to agree that this is how things would go. In other words, once we have agreed that our language  (and culture in general) consists of these symbols, those protocols and rules, everyone must acquiesce or else no (clear) communication or functional collaboration will happen.

What are some of our beliefs?

  1. You are not that important—at KCHKNA we believe in the power of not the individual but in how well they are connected to the rest of the team. We look at our organization as an organ or a system. Individual components make the system but the system itself is an emergent being that cannot be understood or fully appreciated by studying the individuals. What this means is that no matter how intelligent, how hardworking, how visionary one individual is is not the most important thing. Think perhaps of a heart cell. No one single heart cell has the ability to pump blood. And yet, together with all the others that make up the heart, these cells can now pump blood. We are organ, too. We function as a unit.
  2. You are that important—it is true that an individual heart cell cannot pump blood. However, it is equally true that without that individual heart cell, the heart is no longer the same. So an individual cell is indeed very important! Even more importantly, a collection of neuron cells will not pump blood. In other words while the connectedness is very  important, the type of individuals who are connected is of equal importance. Practically speaking this means that we do care about your individual quirks, dreams, and style. You are an invaluable part of this organ(isation)!
  3. Come for the people, work to pass time. Imagine you are with your best friend or another person whom you love spending time with. You can spend forever with this person just sitting side by side. But instead of just sitting around you decide to be doing something together—you decide to build a company, to advance your community, to bring love and positivity to the people who are around you. You do this not because you need to, but because you love being with the other person. This is not just metaphorical: it is what we strive to have our people experience. A large chunk of life is spent working so it doesn’t make sense that a large chunk of your life would be spent with people whom you don’t enjoy being with.
  4. Experiment. Experiment. Experiment. We are seekers of truth (the definition of which we agree on as a team) and in doing so we are willing to reexamine and adjust our worldview when presented with new data. We perform experiments as frequently as possible because we know there is more to discover, better things to come, better ways of doing things.

As a side note, communication devices that we use have one or many underlying protocols. When you buy a Wi-Fi capable device for example, this means that it has a microcontroller and other circuitry that implement the Wi-Fi protocol. The web clients we use to access the World Wide Web use the hypertext transfer protocol to talk to servers. When you have a USB device, it means that that device implements and thus understands the Universal Serial Bus protocol. The examples are too many to list! What is key to understand is that device manufacturers need to have first agreed on how to interpret the symbols in order for effective functioning of their devices to happen.

Philosophy and Technology

Human civilization has significantly advanced with innovations spanning a vast spectrum of industries. Researchers as well as entrepreneurs have created a world that was perhaps far from imaginable in the 20th century. From the way we live, travel and communicate to how we conduct business, what money is or means, a lot has changed—at least in some places! We should expect more changes because the world is still evolving and people all over the globe are still making innumerable discoveries. But underlying all this is a philosophy as to how humanity ought to evolve, what knowledge is worth seeking, what applications are worth developing, and so on.

A company’s philosophy is like its DNA. Alexander Leivesley pointed out in Huffington Post that, “Philosophy is not obsolete. Philosophy brings the important questions to the table and works towards an answer. It encourages us to think critically about the world.” The reason why a business exists is due to its DNA. This DNA is made up of the philosophy that underpins the actions of individuals. In other words, the culture is the outcome, a measurable property of a social grouping. The philosophy defines the culture and then the culture is manifested in the everyday actions and outcomes of the social group.

We strive to create a culture where people are genuinely and practically there for each other, but we cannot force people to behave in a specific way. We aim to create an environment where people can be caring, and yet give each individual the freedom for the specific actions they take to exhibit that care.

Our Goal at KCHKNA Inc.

 As KCHKNA, we are thus guided by a certain philosophy that is core to our existence. Unfortunately, as you may have noted from this note, a culture or philosophy is not something one can define in one line, or point at the same way we can point at our shiny office complex. We can share examples, but even they fall short. For example, we see the human as the greatest capital. Given the right tools and resources, she can achieve the extraordinary. We take inspiration from Jeff Bezos when he says, “Failure and invention are inseparable twins. To invent you have to experiment, and if you know in advance that it’s going to work, it’s not an experiment.” Thus we gloat neither over our failures nor our successes; but we dissect and learn from both experiences.  And while failure and invention are indeed inseparable twins, we never venture into something haphazardly in the hope of learning lessons from the failure; no, we do our utmost to plan and derisk our endeavors and maximize the probability for phenomenal success. And yet these examples never fully represent our philosophy, our DNA. Ultimately, you would have to come and join us to know and experience our core philosophy!

Happy World DNA day!