Getting Started
Learn how to make a docker for Django on Educative. Let's begin! :)
Introduction
Authors on Educative can set up their own environments for code executions for a course. A custom environment can be set up by providing a tarball containing:
-
a Dockerfile
-
resources required to build the docker image
All the live and non-live code execution can then be configured to execute in the custom environment created by the Author.
Necessary files for setting up our Docker Environment
Before we can use our Dockerfile for the setup, we need to upload all files onto the Educative platform.
All files are zipped and present in the django-docker.tar.gz tarball file at the end of this lesson and can be downloaded.
But before we learn how to upload files on Educative’s platform, we need to see what exactly is inside our tarball.
Project files
Every file that we need will be present in one tarball, django-docker.tar.gz as mentioned above.
Let’s see what this contains:
django-docker.tar.gz/ # tar zip file--Dockerfile--requirements.txt--start.sh--helloworld/ # project folder---manage.py---db.sqlite3---helloworld # project subfolder----__init__.py----__pycache__----settings.py----urls.py----views.py----wsgi.py
The above was converted into a tarball using the following command:
tar -czvf django-docker.tar.gz Dockerfile helloworld requirements.txt start.sh
As you can see from the directory layout above, this tar file consists of all the dependencies needed for our project and LiveVM setup.
Getting to know the files inside our tarball
The only files that you really need to know about in full detail are highlighted above and are as follows:
- Dockerfile
- requirements.txt
- start.sh
- helloworld (main project folder)
- wsgi.py
- settings.py
- manage.py
These may seem like a lot, but don’t worry: we’ll be discussing each of the files in satisfactory detail.
Now that we know what our tarball holds for us and the directory structure within let’s discuss the highlighted files one by one in the upcoming lessons, starting with the Dockerfile.
Appendix
Files to Download
Author’s Guide
If you are unfamiliar with the content creation widgets available for use on our platform, e.g., the Single Page App (SPA) widget or our LiveVM support, please refer to The Author’s Guide.
This guide will help you with everything you need to know in order to make a course on our platform.