Skip to content

sthasam2/bumblebee-backend

Repository files navigation

Bumblebee

version

A social media for YOU


Changelogs

Find the Changlogs @docs/changelogs.md

Dependedencies

Main Dependencies

  • Python 3.8
  • pip ( python default package manager)
  • poetry ( Package and virtualenv manager | pip install poetry)
  • PostgreSQL (database | Check docs for full setup process)

Installation

MANUAL SETUP

  1. Setup a virtuial environment
  • install virtualenv using pip install virtualenv

  • create a virtualenv in the repo base directory using virtualenv .venv

  1. Activate virtualenv
  • Windows
.venv\scripts\activate
  • Linux
source .venv/bin/activate
  1. After all the mentioned dependencies are installed, run command:
poetry install

This will install all the required dependencies for the project using the poetry.lock file which are needed for the projects.

To check more dependencies enter command

poetry show

Setup Database

Open postgres terminal

  • Windows
  1. On windows, after installation of Postgres open the SQL Shell (psql) app. (You can find it on search menu)

Start SQL Shell

  1. Login to the shell by using default values (ie blanks) except the password. Use the password you had createed during postgres setup.

SQL Shell

  1. Run database script found @database sql script by copying everthing into the postgres shell

  2. Use \l command to check databases.

SQL Shell Databases

if bumblebee database appears, the database is set up.

  • Linux
  1. After installation, open postgres in terminal using
   sudo -u postgres psql

This opens the postgres shell using user postgres.

  1. Run database script found @database sql script by copying everthing into the postgres shell

  2. Use \l command to check databases.

if bumblebee database appears, the database is set up.

Create Django Migrations

REMEMBER TO ACTIVATE VIRTUAL ENVIRONMENT

In order to setup django app tables, migations must be made. it can be done simply by the commands

python manage.py makemigrations

To apply migrations, use command.

python manage.py migrate

Then the migrations should be applied and the database is ready.

Note sometimes migrations may not work, and in such cases makemigrations should explicitly mention the apps explicitly like

 python manage.py makemigrations activities, admin, auth, buzzes, comments, connections, contenttypes, feeds, notifications, profiles, sessions, token_blacklist, user