Making a website

john | May 16, 2020, 8:46 a.m.

Why Django?

Because you will stop procrastinating and do the one thing you need to do, which is starting to actually build the website.

Step 1, Choosing a Web Hosting provider

Choose either DigitalOcean or Vultr and sign up for their cheapest Ubuntu 18.04 VPS server in any region. Deploy a Ubuntu 18.04 server.

Step 2, Log in and secure server

When you make your server in DO you should have had the ability to enter your root password, if you used vultr, they will supply you one and it will be in your admin panel.

The first thing to do is to ssh into the server, Windows (use putty) and Mac users user Finder to search for terminal, and Ubuntu users type ctrl+alt+t

With the ssh client, open and type the following into it.

ssh root@

Of course you should use your own ip Address.

Once you log in to your server, the first thing you want to do is make another user that has `sudo privileges and disable root user login to make your server more secure.

So first we are going to do,

adduser cooluser

then once that is done, you do

adduser cooluser sudo

Ok now we have our cooluser made so now we need to disable root login and log out, so next we type

sudo passwd -l root



Step 3, Installing requirements and virtual environment

Now you should be back in your local terminal, from there we now ssh in with our new user

ssh cooluser@

Creating And Activating A Virtual Environment
When making a website with python, it’s a good practice to work in virtual environments to keep your project, and it’s dependency isolated on your machine.  There are a few reasons for this, you can google around and figure it out if you really care to know.

Next we are going to make the directory and virtual environment, you will have to enter your sudo password which you made earlier when making your cool user.

sudo mkdir /home/www && cd /home/www
sudo mkdir django
python3 -m venv env
source env/bin/activate
cd django

Once you have this activated you should see something along the lines of


Now that we have the virtualenv activated, we are going to install Django to the virtual environment by typing

pip install Django

This should install Django in your virtual environment.  From here we set up Django by typing

django-admin startproject mysite

Awesome! We now are almost there to having a skeleton website up and running!

if you type in ls you should see folders and directories that are something like this, you can use the cd command to go between them for example cd mysite will move you to mysite directory and typing ls will show you whats in there.  To go back one directory type cd ..

This is the layout of your basic website


This is the layout of your basic Django website.  Now if we type

python runserver

We should see the following output, which lets us know the website is up and running.

Performing system checks...

System check identified no issues (0 silenced).

You have unapplied migrations; your app may not work properly until they are applied.
Run 'python migrate' to apply them.

January 08, 2020 - 15:50:53
Django version 2.0, using settings 'mysite.settings'
Starting development server at
Quit the server with CONTROL-C.

This lets us know that the server is up and running on port :8000. But that it also missing its migrations haven't been applied.  We can worry about this later. 

At this point we have successfully installed and set up a basic website on a server.

You can access it now, even though it's in development by going to youripaddress:8000

At this point, my job is done here. 

From here I hand you off to the very capable hands of Django Project

There is a walkthrough on a little bit of python, to how to fully run and manage and make your Django project do anything you want.  They also have Django project forums where you can ask questions, or see what other people have asked.  And if not, always remember that you can ask in StackOverflow Django.

P.S. Subscribe to my newsletter and follow me on twitter