Skip to content

code-for-canada/adult-ed-platform

 
 

Repository files navigation

Overview

This is the code for the Adult Education Platform and Matchmaker developed by Code for Canada in partnership with the Ministry of Advanced Education and Skills Development, the Ministry of Education and the Ministry of Citizenship and Immigration.

The setup documentation can be found below.

Tech stack

Python (2.7.14)
PostgreSQL (10.4)
Django (1.11)
Vue.js (2.5.16)

Django packages:
Model translation (0.12.2)
Smart selects (1.5.4)
Easy PDF (0.1.1)
Widget tweaks (1.4.2)

Installation

In order to run the project you will need to download and/or install the software and packages specified above. Follow this guide to get you started.

Python

Python 3 is the most recent version of the programming language but Python 2 comes preinstalled in most Linux distributions and is available as a package in all others. Furthermore, there are third-party libraries and packages that are still not compatible with Python 3 as of today. We will be using Python 2.7 in particular because most recent versions of Macs come with it preinstalled. If Python is not preinstalled in your computer, get Python 2.7.14 (released in September 2017) here or with your operating system's package manager.

PostgreSQL

Here you can find a list of detailed PostgreSQL installation guides for different operating systems.
For Mac OS X, I recommend installing PostgreSQL via Homebrew by running two commands:

$ brew update
$ brew install postgresql

Follow the instructions at the end of the install to initialize the DB, add startup items, and start PostgreSQL.

Django

The official Django docs provide detailed instructions on how to install Django. We will use Django 11.1 (released in April 2017) because it is the latest Django version that works with Python 2.7.

Django packages

To install the required Django packages, refer to the links to their repositories provided above.

Vue.js

For this project we're using the direct <script> include for Vue.js version 2.5.16 (released in March 2018), which is found in this folder, so you don't have to download or install anything. If you're curious, here are the official installation guides for Vue.js.

Setup

PostgreSQL

1: Django works with different data stores. The settings file specifies that for this project we're using PostgreSQL (look for the DATABASES section in the file) and that our database will be called adultedu. The first step is thus to create this database in PostgreSQL. You can do this with command in your command line:

$ createdb adultedu    

2: Load this database with this DB dump with the following command:

$ pg_restore -d adultedu pgbackup.dump

3: You can test the database exists and it contains information by starting the PostgreSQL interactive terminal and listing all of the tables it contains with the commands:

$ psql adultedu
adultedu=# \dt

4: Exit the PostgreSQL interactive terminal with the command:

adultedu=# \q    

Django

1: Run this command from the root directory of the Django project (adult-ed-platform/) to start the development server. By default, it'll be on the internal IP at port 8000. Please note that this Django development server should not be used for production. It's OK for when you want to run your own local copy of Django in your computer. There are a few tweaks that need to be done before deploying Django to production.

$ python manage.py runserver

Django tutorial

If you're new to Django, this very throughout tutorial can quickly get up and running. Also refer to this other document DJANGO.md for an overview of the most important Python files in Django for this project and how they interact with each other and with the database. It also provides a summary of the most commonly-used Django commands that will be needed to make updates to the project, including updating translations.

About

Adult ed platform and matchmaker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 64.1%
  • CSS 14.9%
  • HTML 11.1%
  • Python 9.9%