https://mom-network-backend.herokuapp.com/ and one of the following endpoints:
- admin/ api-auth/ dj-rest-auth/ dj-rest-auth/registration/
- profiles/
- profiles/id
- posts/
- posts/id
- comments/
- comments/id
- likes/
- likes/id
- followers/
- followers/id
- newsletter/
- newsletter/id
- messages/
- messages/id
- page/
- page/id
-
Install Django: pip3 install django
-
Create Project: django-admin startproject api_for_mom .
-
Install Cloudinary Storage: pip install django-cloudinary-storage
-
Install Pillow (Image Processing): pip install Pillow
-
Create env.py file and store the Cloudinary url value
-
In settings.py, add Cloudinary to installed apps and create storage
-
Create the App: python manage.py startapp my_app_name
- add it to installed apps in settings.py.
-
Make a Model:
- from django.db import models
- from django.contrib.auth.models import User
- class my_Model_name(models.Model):
- all the fields, methods and the Meta class
- migrate into your database: in the Terminal
- python manage.py makemigrations
- python manage.py migrate
-
Create a Serializer for this Model: create the serializers.py file, inside that file:
- from rest_framework import serializers,
- .models import my_model_name
-
Make generic Viewset, in views.py:
- from rest_framework import generics, permissions
- from my_main_app_name.permissions import IsOwnerOrReadOnly
- from .models import my_Model_name
- from .serializers import my_Serializer_name
- other imports
-
Create the Route(s) in urls.py
With Postman
The Deployment of the Mom Network API has been completed with the following steps:
-
Create Heroku App
-
Create a new external ElephantSQL database
-
Connect ElephantSQL to Heroku
-
Install and configure extra libraries
- Install dj_database_url
- Install gunicorn
- Create Procfile for Heroku: Add code to let Heroku know how to run the project
- Set the ALLOWED_HOSTS
- Install CORS
-
Set remaining environment variables
- in settings.py
- Heroku config vars
-
Connect the project’s GitHub repo to Heroku
Build a REST API with Django REST Framework: https://medium.com/swlh/build-your-first-rest-api-with-django-rest-framework-e394e39a482c
Draw SQL Graph: https://drawsql.app/
Seán Murphy - the course tutor for friendly help with database reset and refactoring some code
Richard Wells - the course mentor for friendly guidance and a project initiation session
Jakob Lövhall - help with maintaining the study schedule, countless hours of babysitting and motivational encouragement



