Version 2.0.0
Umeqo - a new faster and smarter way for recruiters to find potential student candidates.
- NEVER execute python manage.py migrate without the --no-initial-data flag on production. This will load in the existing fixtures (last dump of prod data) and has the potential of overwriting the latest production data.
- Install python 2.7.
- Install virtualenv by running "pip install virtualenv". If you don't have pip install it by running "easy_install pip". If you don't have easy_install, google "python setuptools" and install that to get it.
- Create whatever name directory you want to work in ("workstation" or "dev"), cd into it, and run "git clone [email protected]:Dpetters/Umeqo.git".
- Create a python virtual environment named UMEQO somewhere using virtualenv by running
virtualenv --no-site-packages UMEQO
. - Execute
pip install -r requirements.txt
from the project root. You might get compilation errors. If you do, you're likely just missing some dev package. Google to find a fix. - Create a copy of settings_local_template.py in the project root and name it settings_local.py.
- Open settings_local.py and add a tuple (Your name, your email) to the ADMINS variable.
- Create a folder named media in the project root. Create a folder named ckeditor inside of that folder.
- Install java if you don't have it.
- In the project root, execute
fab create_database
, followed byfab load_local_data
. - From the project root, run
python manage.py clear_prod_stripe_ids
. We don't want to use prod employer stripe ids locally and there is no way to keep them from getting committed atm. - From the project root, execute
python manage.py runcserver
. You should get no errors. - Go to localhost:8000 in your browser. The site landing page should load without any errors.
###This workflow assumes you completed everything in the installation section.
- Open three terminals.
- In the first one run the search engine, Apache Solr, by executing
java -jar apache-solr-*/example/start.jar
from the project root. - In the second run the local server by executing
python manage.py runcserver
. You will use this to test whatever changes you make. - In the third run
git branch
and make sure you are on the dev branch. If there is no dev branch or you are not on it, rungit checkout dev
. - Make whatever changes you need to in this third terminal (or any other that you want).
- Execute
git add <files to add>
to stage the files you changed. - Execute
git commit -m <commit message>
to commit your changes. - Execute
git push origin dev
to push the changes to staging. - Execute
fab staging update
locally to update staging. - Test the changes on staging.
- If everything works as expected, execute
git checkout master
followed bygit merge dev
to merge your changes to the master branch. - Execute
git push origin master
to push your changes to master. - Run
fab prod update
locally to update prod.
These are custom commands that can be run using python manage.py <command-name>
from the project root.
clear_stripe_test_customers
- clears all test mode customers from the Umeqo stripe account.
clear_prod_stripe_ids
- clears all employer Stripe customer ids that got committed from prod.
http://docs.fabfile.org/en/1.5/
restart
- restarts apache. Can be run on staging prod or demo. Needs to be called whenever python code is updated and is thus called by update
.
restart_all
- restarts nginx and apache. Can be run on raging prod or demo. Ty
migrate
- runs all available migrations for all apps. Is called by update
.
create_database
- deletes existing database, creates a new one, runs migrations, and loads in production data. Can only be called locally and on staging.
schemamigrate
- runs through all the apps and checks for schema changes. Creates migrations for any new ones.
We ideally want to set up something that monitors all the logs below and lets us know of any issues. Sentry only reports part of /var/www/umeqo/logs/umeqo.log
.
/var/log/umeqo_cron.log
- all cronjobs log to here.
/var/log/nginx/umeqo.access.log
- nginx logs all requests to here.
/var/log/nginx/error.log
- nginx logs all errors here.
/var/log/apache2/access.log
- apache logs all requests to here.
/var/log/apache2/error.log
- apache logs all errors to here.
/var/www/umeqo/logs/solr-reboots.log
- is incorrectly named (should just be solr.log). The solr process logs to here. If search queries are failing, this is the first place to check.
/var/www/umeqo/logs/umeqo.log
- everything that you see in sentry + more gets logged to here.