Skip to content

Latest commit

 

History

History
112 lines (82 loc) · 2.81 KB

README.md

File metadata and controls

112 lines (82 loc) · 2.81 KB

✨ My Django Blog

A blog built by Django framework and has features such as comment system, star rating system, separate author and manager, hot articles, most visited articles (visit counting system), API, ....


🚀 Starting

These instructions allow you to get a copy of the running project on your local machine.

📋 Pre-requisites

You need to have a 3.X version of Python

🔧 Installation

  • Make a git clone or download it in zip

    git clone https://github.com/irania9O/My-Django-Blog.git
  • Get in the directory

    cd My-Django-Blog
  • Install from your terminal with pip requirements.txt:

    pip install -r requirements.txt
  • Create new migrations based on the changes you have made to your models:

    python manage.py makemigrations
  • Apply migrations:

    python manage.py migrate
  • To Create an admin user

    python manage.py createsuperuser

🧮 Start the development server

python manage.py runserver

Now, open a Web browser and go to “/admin/” on your local domain – e.g., http://127.0.0.1:8000/admin/. You should see the admin’s login screen and home page on your local domain – e.g., http://127.0.0.1:8000/.


🌐 Api

  • 👨‍✈️ Authorization

    All API requests require the use of a generated Token or API Key. You can find your API key, on blew routers.

    POST /api/rest-auth/login/
    POST /api/rest-auth/registration/
    POST /api/token/
    POST /api/token/refresh/
    Header Type Required Description
    Authorization string Yes "Bearer " + "Your JWT access token"


  • ✋ Permissions

    Users are limited based on their position on the site.

    Position Permissions
    SuperUser /api/comments/ - /api/rest-auth/ - /api/token/ - /api/articles/ - /api/users/
    Author /api/comments/ - /api/rest-auth/ - /api/token/ - /api/articles/
    Member /api/comments/ - /api/rest-auth/ - /api/token/ - /api/articles/ -> ReadOnly


  • 📇 Status Codes

    Api returns the following status codes in its API:

    Status Code Description
    200 OK
    201 CREATED
    400 BAD REQUEST
    401 UNAUTHORIZED
    404 NOT FOUND
    500 INTERNAL SERVER ERROR

🖼️ Screenshots


home article_detail comments profile article_list_admin add_article