Giter VIP home page Giter VIP logo

bloggit's Introduction

BloggIt

Deployed Link

https://bloggit-v1.herokuapp.com/


About

BloggIt is a social media blogging website. Create, share, comment, explore!


Goal For Project

My goal is to get more comfortable utilizing Python and Django. As of the start of this project, I don't have any personal works utilizing these two specific technologies. My hope is learn to become a better Python & Django developer through the help of this project.


Installation Instructions

  1. Fork and clone the repository
  2. Run pip3 install -r requirements.txt in your terminal to install dependencies
  3. Run python3 manage.py runserver in your terminal and go to your browser and type in "localhost:8000"

User Stories

  • As a user, I want to be able to create a personal account
  • As a user, I want to be able to create my own posts
  • As a user, I want to be able to add comments and likes on other posts

URL Chart

Path Purpose
/ Home Page
/signup User registration page
/login User login page
/explore Displays all blogs chronologically from all users
/blogs Displays logged in user's blogs
/blogs/create Create a blog
/blogs/:id/ View page for selected blog - access to blog edit page link / can delete blog / can add comments / access to comment edit page link / can delete comments
/blogs/:id/edit Page to edit the selected blog
/blogs/:id/edit_comment/:commment_id Page to edit the selected comment

Routing Chart

Method Path Purpose
GET / Home page
GET /register Page to create a new user
POST /register Adds new user created to database
GET /login Login Page
POST /welcome Authenticate login information
GET /explore Page with blogs from all users displayed
GET /blogs Page with all blogs displayed
GET /blogs/create Page with template/form to create blog
POST /blogs/create Create a new blog
GET /blogs/:id Page with selected blog's info and comments
GET /blogs/:id/edit Page to edit blog
PUT /blogs/:id/edit Edit a blog
DELETE /blogs/:id/delete Delete a blog
GET /blogs/:id/edit_comment/:comment_id Page to edit a comment
PUT /blogs/:id/edit_comment/:comment_id Edit a comment
Delete /blogs/:id/delete_comment/:comment_id Delete a comment

ERDs

ERD image


Wireframes

wireframe image


Final Product Image


Tech Utilized

  • PostgreSQL
  • Python
  • Django
  • Bootstrap

MVP Checklist

  • Be able to create new users and save in the database
  • Be able to create new blogs that save in the database
  • Be able to edit and delete own blogs
  • Be able to comment on all blogs (user's own blogs and other users' blogs)
  • Be able to delete own comments

Stetch Goals

  • Implement a "like" button
  • Implement a "share" button
  • Implement a "follow" feature
  • Implement a DM/chat feature
  • Implement a search feature where you can search blogs by "title" or "hashtags"

Code Highlights

@login_required(login_url='/login/')
def edit_comment(request, pk, comment_pk):
    comment = Comment.objects.get(blog_id=pk, id=comment_pk)
    if request.method == 'POST':
        form = CommentForm(request.POST, instance=comment)
        if form.is_valid():
            comment = form.save()
            return redirect(f'/blogs/{pk}')
    else:
        form = CommentForm(instance=comment)
    return render(request, 'edit_comment.html', {'comment_form': form})

@login_required(login_url='/login/')
def delete_comment(request, pk, comment_pk):
    comment = Comment.objects.get(blog_id=pk, id=comment_pk)
    if comment.user_id == request.user.id:
        comment.delete()
    return redirect(f'/blogs/{pk}')

Resources

bloggit's People

Contributors

taekim90 avatar

Stargazers

 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.