Skip to content

Arkiralor/BlogProjectDjangoRF

Repository files navigation

Blog Engine in Django Restframework

A blog-engine Rest API constructed in django restframework with custom user models and login.

Definition

A blog-engine is a a software or tool which let’s one create and manage a blog or website.

Conventional websites are a collection of web pages that are accessible from a website. A blog differs from a website in that it is generally managed using a blogging platform which stores your content, media, files, links and all other necessary things required for the operation and working of your blogs which are created by the users of the site and not the administrators.

Social Media Websites can be considered the technological descendants of the original blog-engine concept, popularized in the early 2000s.

Source: cultofweb.com

Basic Level 0 Control Flow

  1. Sign up a new user if not already registered.
  2. Generate an author from the new user if not already generated.
  3. Whenever a new blog post is added, the author is derived from request.user and added to the blog post model object.
  4. A blog post can only be updated or deleted if request.user is either the owning user or a member of the staff.
  5. The list of all users can only be viewed/deleted if request.user is a member of the staff.

Details

  1. Type: REST API
  2. Authentication: Token Authetication
  3. Database Type: Relational
  4. Database: PostgreSQL
  5. Types of Users: Superuser, Staff, User
  6. Timezone: Asia/Kolkata (UTC +05:30hrs)

Development Environment Setup

  1. Create a virtualenv named such as env and switch to it.

  2. Run: python -m pip install --upgrade pip to upgrade the PythonPackageManager (just to save you an hour's worth of headache 5 minutes later).

  3. Run: pip install -r requirements.txt

  4. Run: [ chmod +x run.sh , chmod +x migrate.sh, chmod +x shell.sh ]

  5. Create the .env file and fill the values as per the format given below.

  6. Run: ./migrate.sh

  7. Run: python manage.py createsuperuser

    7.1. Enter the superuser credentials as required.

  8. Run: ./run.sh to run the server.

    8.1. Run: ./shell.sh to run the Django Shell when required.

Installed Custom Applications

  1. Userapp:

    Used for user registration and verification via author-generation.

  2. Blogapp:

    Used to perform CRUD operations on blog posts in/from the database.

.env File Format

## Website Encryption:
SECRET_KEY = ' '

## Database Settings:
DATABASE = ' '
USER = ' '
PASSWORD = ' '
HOST = ' '
PORT =  

## Site Settings:
DEBUG = True/False
LANGUAGE_CODE = ' '
TIME_ZONE = ' '
USE_I18N = True/False
USE_TZ = True /False

## AWS S3 Settings:
AUDIO_POST_URL = ' '

Documentation:

documenter.getpostman.com (To be updated...)

Collaboraters & (C)

  1. Prithoo Medhi, 2021

About

A blog engine backend constructed in django restframework with custom user models and login.

Topics

Resources

Stars

Watchers

Forks