Full Stack - Blog App - Backend

Table of Contents

Overview

  • This is the backend side of my Full Stack Blog App project.
  • I used reactjs for frontend.
    You can see the frontend side of this project from here 👈

Project Info

  • User and Blog tables are interconnected and each user has its own profile.
  • Users can update their user information and profile picture by coming to the profile section.
  • Users who have logged into the system can create, edit and delete their own posts.
  • In addition to creating your own posts, you can comment or like your own posts and other users' posts.
  • I did construct this structure using a generic view. In order to override Class methods, i did provide a if-else structures that should act accordingly whether the person is a authenticated or not. I did use IsAuthenticated from Rest framework permissions, IsAuthorOrReadOnly and IsAdminOrReadOnly from my custom permissions file.
  • I used django filters for searching posts and filtering user's own posts .
  • I used nested serializer and method fields in my serializers.
  • I used the cors-headers package to connect the frontend to my API.

Entity Relationship Diagram

erd

Project Link

You can reach my project from here 👈

Preview of the Project

erd

Built With

  • Django
  • Django Rest Framework
  • Django Rest Auth
  • Django Rest Authtoken
  • Django Filter
  • Django Cors Headers
  • Swagger

Project Structure

.──── fs-django-blog-app-drf (repo)
│
├── main
│     ├── __pycache__
│     ├── __init__.py
│     ├── asgi.py
│     ├── urls.py
│     ├── wsgi.py
│     └── settings.py
│─── blog
│       ├── __pycache__
│       ├── migrations
│       ├── __init__.py
│       ├── admin.py
│       ├── apps.py
│       ├── models.py
│       ├── pagination.py
│       ├── permissions.py
│       ├── serializers.py
│       ├── signals.py
│       ├── tests.py
│       ├── urls.py
│       └── views.py
├──── users
│       ├── __pycache__
│       ├── migrations
│       ├── __init__.py
│       ├── admin.py
│       ├── apps.py
│       ├── models.py
│       ├── serializers.py
│       ├── signals.py
│       ├── tests.py
│       ├── urls.py
│       └── views.py
├── .env
├── .gitignore
├── db.sqlite3
├── drf-blog-erd.jpg
├── manage.py 
├── README.md 
└── requirements.txt

How To Use

To clone and run this application, you'll need Git

# Clone this repository
$ git clone https://github.com/esadakman/fs-django-blog-app-drf

# Install dependencies
    $ py -m venv env
    > env/Scripts/activate (for win OS)
    $ source env/bin/activate (for macOs/linux OS)
    $ pip install -r requirements.txt


# Add .env file for secret key and set your secret_key

- Create a .env file for =>
  -- SECRET_KEY,

- After these you can run the project as usual =>
    $ py manage.py migrate
    $ py manage.py createsuperuser

# Run the app
    $ python manage.py runserver

Contact