Contents
About Django
Django is a opensourced python-based web framework.
Step 1. Do some preparation works before we begin
First, if you don’t have Homebrew (the package manager for your mac), you can see how to set up homwbrew on your mac.
Now, you got Homebrew on your laptop.
Then you can use this command to install Python3 on your mac(If you don’t have it)
brew install python3
After install python3, you can check your Python version by execute the command:
python3 --version
Step2 install pipenv
Install the pipenv for Django. Pipenv is a virtual environment for Python.
pip3 install pipenv
pipenv --version
Homebrew allow you to install pip3 and python3, pip3 is also a package manager, but it’s only for python packages, including pipenv.
Here, pip3 is a package manager for Python, if you installed Python3, it also should be installed along with it.
Anyway, after this process, you actually ready to create your first project with Django.
Step3 Install Django with pipenv
Virtual environment specifies which version of Django you want to use.
create a folder and run install command to install particular Django version.
cd ~/Desktop
mkdir foldername
cd foldername
pipenv install django==2.1
We can see, after the installation of the django, there is two files in the distination directory.
Pipfile and Pipfile.lock
Step4 Run the project
pipenv shell
this command to activate this project’s virtual environment.
Step 5. create a Django project
django-admin startproject editdojo_project .
.(dot) represents current directory in UNIX.
This will create a new Django project for us.
Step 6. Start up our django server
After this, let’s start up our django server, type the command below:
python manage.py runserver
We can see the output like below:
Then, we can see we set up Django successfully.
The End~
If you like this blog, please press the like button, I’ll be very appreciate for that.