My First Django Website

Willy Lee
3 min readMar 20, 2021

THE PROJECT: It is finally the weekend so I decided to open a new project. This one is focused on making a personal stream website for myself. I don’t mean that like coding up twitch.tv from the ground up haha but more that I want a website that viewers of my stream can open while watching to stay more engaged with my content.

Think of it like a personal portfolio but this is dedicated towards an audience that is interested in watching someone play video games. Streaming on Twitch.tv is something that I’ve wanted to do more of but I don’t like how it can be very unengaging for the viewers at times. I’m hoping a stream website where I can put viewers names on it and give out prizes might make for an interesting concept.

RAMBLINGS: I decided on making my website using Django since I know I want my website to be dynamic and I also know that I want an easy way to create an admin side. Django seemed to check these boxes for me so I’m deciding to move forward with my concept.

Starting my learning on the Django tutorial on MDN, I’ve just started to get more acquainted with the concepts of Django and what it is. I started with creating my first test project in a local environment. Reading through the first part of the tutorial, everything seems pretty intuitive. The tutorial has 11 parts so I am done with part 1 of 11 (yikes…) hoping to get through the next 10 parts over the next month since work is getting pretty busy.

WHAT I LEARNED: So far in the tutorial, I have learned the following things:

  1. Setting up a virtual enviornment. I usually use PyCharm which normally does this for me but I decided to try and learn this through powershell. It was actually much easier than I thoguht it would be. The MDN tutorial says you should download the

virtualenvwrapper

package but I found that not helpful. Instead, I used the command

virtualenvwrapper

package but I found that not helpful. Instead, I used the command

py -m venv env

This worked muchhhh better for me and was far more intuitive. The way you activate it is by navigating the env directory that the command creates in your current directory and going through the Scripts folder to find the activate command. You can just call that command to start your environment and call deactivate from where ever to stop the virtual environment. If you want to activate the environment from the directory hold env then you can just use the following command.

.\env\Scripts\activate

2. I learned how to start my Django site. I already know how to pip download content so that wasn’t anything new to me but I learned some basic commands on how to start my Django site and test it locally as well. The two commands I learned were:

django-admin startproject <NAME OF SITE/PROJECT>

python manage.py runserver

The first one create the django project in the directory you are in and the second is the run server command that can be used once you navigate into the project folder and try to run the site locally. These are both helpful and rewarding since I feel like I have a good grasp of the starting things that need to be done to run the code.

Fun little project I have started here and excited to keep learning more so I can have an stream site I can use on Twitch.tv/notyouravgwilly

--

--