Skip to content

The API server for accessing content across the ASWWU websites. Built with Django 2, the Django REST Framework, and Python 3.7.

Notifications You must be signed in to change notification settings

ASWWU-Web/django-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-server

Build Status Codacy Quality Badge Codacy Coverage Badge

The API server for accessing content across the ASWWU websites. Built with Django 2, the Django REST Framework, and Python 3.7.

Local Deployment

Use these steps to setup your local developemnt environment.

MySQL

MySQL can be installed with Brew (not recommended), MAMP (easy but big), or Docker (hard but lightweight). Use MySQL version 5.7.22.

Brew

  1. Install with brew
$ brew install mysql
  1. Save yourself a lot of pain and skip to the Docker section

MAMP

  1. Download and install MAMP
  2. Start servers
  3. Skip to database setup

Docker

  1. Install MySQL server
$ docker run -d \
  -p 8889:3306 \
  -e MYSQL_ROOT_PASSWORD=root \
  --name=mysql-server \
  mysql/mysql-server:5.7.22
  1. Enter the MySQL command line, you may need to restart the container first
$ docker exec -it mysql-server mysql -uroot -proot
  1. Give the root user permission on localhost
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root';

Database Setup

  1. Create the databases, use Docker step 2 to enter the MySQL command line if necessary
mysql> CREATE DATABASE django CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
mysql> CREATE DATABASE elections CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
mysql> CREATE DATABASE jobs CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
mysql> CREATE DATABASE pages CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
mysql> CREATE DATABASE people CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Django Setup

  1. Install dependencies. NOTE: mysqlclient can cause issues on Mac. Ensure that you installed mysql with brew
$ pipenv install
  1. Run migrations
$ pipenv run python manage.py migrate
  1. Run server
$ pipenv run python manage.py runserver

About

The API server for accessing content across the ASWWU websites. Built with Django 2, the Django REST Framework, and Python 3.7.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published