Setting Up Django

None

ZEBEDEE 3 out of 9
Tip

Setting up Django


You’ll need python installed. You can download python here and run the installer.


If you’ve never used Django before, check out the documentation here.


Open VS Code, our code editor, open a folder where you want to store the project and then select Yes, I trust the authors.



Let’s go ahead and create our own virtual environment. Close the welcome screen now and start a new terminal.



Now, go ahead and create a virtual environment. This ensures that all the libraries and packages that you install are only related to this specific app. It’ll also help if you share the code, like I am.


python3 -m venv env



Now let’s go ahead and activate the virtual env.


source ./env/bin/activate


You’ll now see a prefix of (env) in front of your username in the terminal or command prompt.



Let’s install Django, now that we have our virtual environment setup.


python3 -m pip install Django



Awesome! Now we have Django installed. Let’s go ahead and start a project, which is our top-level structure for Django. If you want to follow a verbose guide on Django setup, check out this page.

Run the following command:


django-admin startproject lightning_app




Navigate to the core project directory by entering cd lightning_app into your terminal.