Tools: Update: Getting Started with Django: From Zero to 70% in Record Time . Step 1 :Starting phase (For Linux this time)

Tools: Update: Getting Started with Django: From Zero to 70% in Record Time . Step 1 :Starting phase (For Linux this time)

Quick disclaimer (the post below is meant to mirror the previous post but for the Linux operating system. Please try to implement these methods and if they do not work on your machine leave a comment and allow me to find a solution.) For this post, I would like to help anyone who is not familiar with Django to get somewhat of an understanding on how to use it to get from 0 to maybe 70% completion of a project in record time. The objective today is to learn how to start, after 2 posts you should be able to speedrun projects. First things first, you have to understand that there are multiple Python frameworks out there(Flask, FastAPI). The choice of which one to use is always up to you and the constraints on the project your working on. With that being said let's dive in. Step 1: Ensure that you download PythonFor my device I am using Windows Subsystem For Linux (for more information : https://learn.microsoft.com/en-us/windows/wsl/install) this allows me to run an Linux Ubuntu terminal on my machine.For the installation we will use apt (Advanced Package Tool) to install python3.1.sudo apt update2.sudo apt install python3 Step 2: Ensure you have to have Django installedTo install Django we will be using pip(a python package installer) which means you should have Python downloaded and configured in your path. Something else I would like to encourage is the use of a Python virtual environment. You may not be familiar with this concept but trust me - there is not better time to learn how to use it.The idea behind it is that, you install all your python packages while inside your project environment and as long as you initialize your environment all your project dependencies will work (eg Django, pillow). Sounds good? Considering that we are on Linux we will need to download the specific packages that we want to use ( eg venv) in order to get our virtual environments active. This is because unlike windows, downloading python3 does not come with the venv package already installed.This means that if you try to run python3 -m venv MyProjectyou will be met by an error. So for every individual package we want to use we will have to install it as we go along.1.sudo apt install python3-venv From here we create and activate the project environment usingpython3 -m venv Project and source Project/bin/activate Now that you are in your environment, use pip to install Django. Step 3: Creating a projectSo to start a project the command is django-admin startproject ProjectName Once you ran this command, it will create a folder where there are a few preconfigured python code files inside. (Pre-configured project files) Now that we have created a project, we will need to initialize a Django app while inside that folder. The command is python3 manage.py startapp <name_of_your_app> Now once you open your IDE, you will realized that you have a few code files inside your NewProject folder. Step 4: Running the serverThe final part of this post focuses on how to run the server. In later entries we will dive deeper and create a small-scale working example using all of Django's extensive features, but that is for later. To run the server use python3 manage.py runserver. So when you go to localhost at port 8000 you will find And there you have it! You have successfully installed Django, created a project, initialized an app, and got your development server running (on linux). While this may seem like a small set of steps, this is the foundation that every Django project is built on. Templates let you quickly answer FAQs or store snippets for re-use. as well , this person and/or