CS3216 Assignment 1 - Life of a Facebook Application
Group Name: Group 8
App Name: Would You ___?
App URL: https://wouldyou.space
Le Xuan Manh (A0126501W)
Piyush Varanjani (A0105178H)
You Jing (A0133895U)
Zhang YiJiang (A0135817B)
Check you have the prerequisites installed. Python 3.5 is required for the server and Node 6.x and gulp is required for the asset pipeline.
Grab a copy of the repo with
Create a Python 3.5 virtual environment somewhere (home folder usually) by following the instruction from https://docs.python.org/3/library/venv.html and activate it by running
Install the Python prerequisites with
cd cs3216_wouldyou pip install -r requirements.txt
cd cs3216_wouldyou cp .env.example .env nano .env
and fill in the blanks.
SECRET_KEYcan be created using http://www.miniwebtool.com/django-secret-key-generator/
FACEBOOK_SECRETare from http://developer.facebook.com. Use the test app for local testing and the actual app for staging and production
Return to the project root (
cd ..) and run the database migrations using
./manage.py migrateor for OSX
python manage.python migrate
Load fixture data using
./manage.py loaddata wouldyou/fixtures/verbs.json
Start the server using
./manage.py runserveror for OSX
python manage.python runserver
Create a superuser using
./manage.py createsuperuserand follow the instructions
To start with the asset pipeline,
- Change to the asset directory
- Install the prerequisites
- If necessary, install gulp globally
npm i -g gulp
gulp serveto start the Browsersync server, or
gulp watchto watch for asset changes without using Browsersync
Remember to include the compiled CSS and JS files. You should also run
gulp build --env=productionbefore pushing so that the minified files are included in the commit.
You can also used the included githook to do this automatically on each commit.
ln -s /full/path/to/githook/pre-commit /path/to/repo/.git/hook/pre-commit
Fabric is a automatic deployment and system administration utility. We use this for deployment and other server admin tasks.
- Ensure you have a ssh key registered with the
appuser of the server
- Install Fabric
fab deploy - Deployment
This will pull a copy of the code from the master branch to the server and run through the steps needed to update the site including
fab createsuperuser - Create admin user
Creates an admin user on the server. Please pick a strong password because this is on the actual server!