Setting up Django Project
This page goes over the bare minimum to set up an email client with Django.
Installing Django
If you have come to this documentation with an existing Django project, you can skip this portion.
To start, we need to get all set up for a Django project.
- Make sure Python and Pip are installed. If you're using Windows, in a Command Prompt, you can use the following commands below. If you're using Mac or Linux, you can use the below commands in a Terminal.
- To check if Python is installed:
python3 --version
orpython --version
- To check if Pip is installed:
pip3 --version
orpip --version
- To install Django, run
python -m pip install Django
orpython3 -m pip install Django
in your Terminal or Command Prompt.
If everything installed without any errors, you should be good to go! To create a project, simply run django-admin startproject my_project_name
in your Command Prompt or Terminal. To confirm that everything is looking good so far, you can navigate to the new folder that was just created, and run python manage.py runserver
or python3 manage.py runserver
. Your Terminal or Command Prompt should then show something like what is shown below; if that is the case, everything is good so far. You can even visit localhost:8000 in your browser.
Installing Dependencies
Other than having your Django project, you'll need djangorestframework
. You can install this with the command below.
pip3 install djangorestframework
You'll also need django-cors-headers
.
pip3 install django-cors-headers
Create Email Client App
Next is to create our email client app in our Django project.
python3 manage.py startapp email_client
After running the command, if it's not already added, add email_client
to your INSTALLED_APPS
in settings.py
.
Part of: Django Email Client