Search for:
Go Green Campaign

We believe in working with the entire community so that we can together create a circular economy wherever we are; the ideas about circularity need to be learned and understood from an early age. Here are some pictures from some of our events where we worked with schools and other partners.

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”.