Mac Instructions

Note: Current recommended setup is to follow Docker Instructions

First, make sure you have Homebrew installed:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

You should also install pip if you haven't already:

sudo easy_install pip

Database

Dispatch requires a MySQL database to store information. Install mysql with Homebrew.

brew install mysql

Now run the server and create a fresh database:

mysql.server start
echo "CREATE DATABASE ubyssey" | mysql -u root

If you're seeing "ERROR 1045 (28000): Access denied for user 'root'@'localhost'", try:

echo "CREATE DATABASE ubyssey" | mysql -u root -p

Next, populate the database with sample data:

curl https://storage.googleapis.com/ubyssey/dropbox/ubyssey.sql | mysql -u root ubyssey

If you're seeing "curl: (23) Failed writing body" try:

curl https://storage.googleapis.com/ubyssey/dropbox/ubyssey.sql | tac | tac | mysql -u root ubyssey

If you're seeing "ERROR 1045 (28000): Access denied for user 'root'@'localhost'", try:

curl https://storage.googleapis.com/ubyssey/dropbox/ubyssey.sql | mysql -u root ubyssey -p

Getting the code

We recommend working inside a virtualenv, but it's not required.

# Install virtualenv if you don't have it
pip install virtualenv
# Create a new virtual environment
virtualenv ubyssey-dev
cd ubyssey-dev
# Activate the virtualenv
source bin/activate

First, fork ubyssey.ca repository by following this tutorial. Afterward clone the ubyssey.ca repository:

# Change the url to your cloned repo
git clone https://github.com/<YOUR-USERNAME>/ubyssey.ca
cd ubyssey.ca

Install the required Python packages with pip:

pip install -r requirements.txt

Note: you might get an error saying that libjpeg is required. You can install it with Homebrew:

brew install libjpeg zlib

Note: if mySQL-python fails to install, you might be missing some of Apple's Command Line Tools. Install Xcode from the Mac App Store, then:

xcode-select --install

Project settings

Copy the sample settings file into the project root:

cp _settings/settings-local.py ubyssey/settings.py

Static files

Install the required Node packages with npm:

cd ubyssey/static
npm install

Install a global version of gulp (if you don't have it already) and build the static files:

npm install -g gulp
gulp buildDev

Media Files

Download and unzip the sample media folder to ubyssey.ca/media/. This will make it so the images attached to the sample articles are viewable.

Running the server

Go back to the root of the project ("ubyssey.ca" directory)

Now start the server!

python manage.py runserver

If you're seeing "django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb", run pip install MySQL-python and try again.

Admin Panel

You can log in to the admin panel at http://localhost:8000/admin/:

Email: volunteer@ubyssey.ca

Password: volunteer