We will be using a rebase workflow. This is much easier for rollbacks, and since we are not open-sourced, we don't have to deal with pull requests.
Use the following template.
git checkout -b fb1
# do your work here
...
# end of work
git fetch origin master:master # this is the same as `git checkout master && git pff && git checkout fb1`
git rebase -i master
git checkout master
git mff fb1
git pull
does not always do the right thing, as it tries to merge. We never want merging, so I recommend adding the following aliases to your ~/.gitconfig:
[alias]
...
pff = pull --ff-only
mff = merge --ff-only
...
# on master
git fetch
git rebase origin/master
ReCal uses Heroku. For testing, it is recommended to use Heroku's Foreman, as opposed to using Django's built-in testing web server. To get Foreman, install Heroku Toolbelt.
Copy the file .env_example
into .env
and fill in the appropriate variable. Then, execute it as a Bash script, or to make things easier, use autoenv.
ReCal uses Postgres as its database. First, download Postgres. For Mac, the easiest thing is to install Postgres.app. Create an empty database for use with ReCal. Django will take care of the rest.
We use PIP to keep track of our required packages. First, install PIP. Optionally, but recommended, use virtualenv to keep ReCal's PIP packages separate from your other projects. On a Mac, also install virtualenvwrapper, which exposes a nice command-line interface. When you have everything setup, run the following:
pip install -r requirements.txt
Two things you may have to install to successfully run this command:
- MySQL - We are working to eliminate this, as we don't actually need MySQL. But for now, we don't want to change the production code, so go ahead and install it.
- PDFtk
We need to give django a chance to set up everything. To do that, run the script setup_database
. Note that you must have your environmental variables set up correctly for this to work.
Issue this command:
foreman start
You can now access the test environment at localhost:PORT
, where PORT is the actual port number.
Whenever you make changes to the static file, you must tell Django about it. To do that, run:
python manage.py collectstatic