Giter VIP home page Giter VIP logo

blog-app's Introduction

Blog App

This is a simple blog app that allows users to create, read, update and delete blog posts. It is built with Django and React js.

Features

  • User authentication
  • Create, read, update and change status blog posts
  • Comment on blog posts
  • Like and unlike blog posts
  • Update user profile

Technologies

  • Django
  • React js

Dependencies

  • Redis
  • MinIo
  • Memcached

Installation

  1. Clone the repository
  2. Install dependencies for server can be installed by running the following command pip install -r requirements.txt for client can be installed by running the following command yarn
  3. Run migrations python manage.py migrate
  4. Run the server python manage.py runserver
  5. Run the client yarn start

Usage

  1. Run redis server, minio and memcached server Minio Redis Memcached redis_minio
  2. Create a superuser python manage.py createsuperuser
  3. Login to the admin dashboard and create a user
  4. Login to the user account and create a blog post
  5. View the blog post

Screenshots

  • Sign in signin
  • Sign up signup
  • Home home
  • Detail Post detail
  • List Users list_user
  • Profile profile
  • Upload Profile Picture upload
  • Edit Profile edit
  • Change Password change
  • Create Post create
  • Update Post update
  • List Post list
  • List Post Search search

ERD

erd

Flowchart

flowchart

API Endpoints

https://documenter.getpostman.com/view/11566293/2sA35G2MX6

MYPROJECT

my project is a test new app for learning how to django ORM works. if you want to add new create seeder in migration can be run by running the following command python manage.py makemigrations new_app -n create_data and add the following code in the migration file

from django.db import migrations

def create_data(apps, schema_editor):
    TestModel = apps.get_model('new_app', 'TestModel')
    TestModel.objects.create(tag='tag1', text_field1='text'*5, text_field2='text'*5)

class Migration(migrations.Migration):

    dependencies = [
        ('new_app', '0001_initial'),
    ]

    operations = [
        migrations.RunPython(create_data),
    ]

after that run the following command python manage.py migrate

Run cron job

i have python script that function to count active user, you can run the script by running the following command python manage.py count_active_user

  1. Open the crontab editor by typing crontab -e in your terminal.

  2. In the editor, you can add a new cron job by adding a new line. A cron job line has the following structure:

* * * * * command-to-be-executed

  • The five asterisks can be replaced with specific time units to schedule the job. From left to right, they represent: minute (0 - 59), hour (0 - 23), day of the month (1 - 31), month (1 - 12), and day of the week (0 - 7, where both 0 and 7 are Sunday). To run your standalone.py script every day at midnight, for example, you can add the following line:
  1. Replace /usr/bin/python3 with the path to your Python interpreter, and /path/to/your/cron_count_active_users.py with the path to your standalone.py script.

  2. Save and close the editor to install the new cron job.

blog-app's People

Contributors

exceldeo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.