Skip to content

beckaberhanu/TextBookSwap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

TextBookSwap

Django setup

PostgreSQL setup

  • Install Homebrew
  • Install PostgreSQL
  • Start PostgreSQL database
    • Open PostgreSQL command line tool
      • $ psql
    • Create a database called ‘mydb’
      • # CREATE DATABASE mydb WITH OWNER [insert username here];
  • Install the PostgreSQL trigram extension
    • psql
    • Choose the database you want to install the extension for, in this case "mydb"
      • # \c mydb
    • istall the extension
      • # CREATE EXTENSION pg_trgm;
  • Install psycopg2
  • Connect the Django project to the PostgreSQL database
    • Export your database username as a local variable
      • $ export mydb_USER=[insert username here]
    • Export your database password as a local variable
      • $ export mydb_PASSWORD=[insert password here]
  • Delegate an email as the orgnization email
    • Export an email as a local variable
      • $ export TEXTBOOK_SWAP_EMAIL_USER=[insert email here]
    • Export the app password as a local variable
      • $ export TEXTBOOK_SWAP_EMAIL_PASS=[insert app password here]
  • Create the necessary migration files
    • $ python3 manage.py makemigrations
  • Perform the migrations
    • $ python3 manage.py migrate
  • Create super user
    • $ python3 manage.py createsuperuser
    • follow the prompt
  • [OPTIONAL] create instances
    • run the django shell
      • $ python3 manage.py shell
    • create randomized user and post instances
      • \ python from createInstances import reinitialize as re re() \
    • create real book instances
      • \ python from createInstances import createRealInstances as cri cri() \
  • Start the server
    • $ python3 manage.py runserver
  • [OPTIONAL] view webpage on mobile device

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published