Coder Social home page Coder Social logo

magda2307 / social-media-app-django Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 110 KB

This project is a Django-based API that provides user management and social features. It allows users to register, log in, manage their profiles, follow/unfollow other users, and perform CRUD operations on posts. The API is built using Django Rest Framework (DRF) and employs token-based authentication for secure user authentication.

Python 97.26% HTML 2.74%

social-media-app-django's Introduction

social-media-app-django

Project in progress. This repository contains the code for a Django-based API project. The project aims to provide a user management system with registration, login, profile management, and social features such as following/unfollowing other users, posting posts with/without photos and viewing user's feed in future.

Implemented Features:

  • User Registration: Users can register by providing necessary information, including username, email, and password. The registration process is handled through the UserRegistrationAPIView API view.

  • User Login: Registered users can log in using their credentials. The login functionality is implemented in the UserLoginAPIView API view.

  • User Profile: Users can view and edit their profiles. The UserProfileAPIView API view allows users to retrieve and update their profile information.

  • Following/Unfollowing Users: Users can follow/unfollow other users. The UserFollowAPIView API view handles the follow and unfollow actions.

  • List of Followers and Following: Users can view a list of their followers and the users they are following. The UserFollowersAPIView and UserFollowingAPIView API views provide these lists.

  • CRUD Operations on Posts: Users can perform CRUD (Create, Retrieve, Update, Delete) operations on posts using the UserPostViewSet viewset.

Setting Up PostgreSQL Environment

To run this project locally, you will need to set up a PostgreSQL database and configure the necessary environment variables. Follow the instructions below to get started:

1. Install PostgreSQL

Make sure you have PostgreSQL installed on your machine. You can download and install it from the official website: PostgreSQL Downloads

2. Create a PostgreSQL Database

Create a new PostgreSQL database for the project. You can use either the command-line interface (CLI) or a graphical user interface (GUI) like pgAdmin.

For example, using the CLI, open your terminal and run the following command:

createdb social_media_app

Replace social_media_app with the desired name for your database.

3. Configure Environment Variables

Create a .env file in the root directory of the project and set the following environment variables:

DB_NAME=your_database_name
DB_USER=your_database_user
DB_PASSWORD=your_database_password
DB_HOST=your_database_host
DB_PORT=your_database_port

Replace your_database_name, your_database_user, your_database_password, your_database_host, and your_database_port with the appropriate values for your PostgreSQL database.

4. Run Database Migrations

Apply the database migrations to set up the required tables and schema. In your terminal, navigate to the project's root directory and run the following command:

python manage.py migrate

5. Start the Development Server

You're all set! Start the development server by running the following command:

python manage.py runserver

The project will now be accessible at http://localhost:8000/.

social-media-app-django's People

Contributors

magda2307 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.