Getting Started (on Mac or Linux)
-
Make an account on github
-
Using github, make a fork of this repository (got to github.com/HarleyCommons/commonssite and click on 'Fork')
-
Make a directory "~/code" on your machine
-
From the command-line, navigate to "~/code" and run
git clone git@github.com:your-user-name/commonssite.git
-
(if you don't have it already, install Python and pip. You can check if you have them by running
which python
andwhich pip
from the command line). -
Download and install virtualenv with pip by running
sudo pip install virtualenv
(if you aren't an administrator on your computer, install it locally withpip install virtualenv --user
) -
Make a directory "/your/username/.virtualenv". Go there in the command line and run
virtualenv --system-site-packages Django
(if you installed virtualenv with--user
, you may need to find where it is first.. on my machine it was "/your/username/.local/bin/virtualenv") -
Open the file "/your/username/.virtualenv/Django/bin/activate" with your editor of choice. In the blank space after "export PATH", add the following:
export PYTHONPATH="~/code:$PYTHONPATH" export DJANGO_SETTINGS_MODULE="commonssite.server.webapp.settings"
-
That's pretty much it for setup! Now when you run
source ~/.virtualenv/Django/bin/activate
, you should be able to run any of the code in the commonssite repository. Just typedeactivate
to get out of that virtual environment. Since that's a lot of typing, a shortcut is to modify "/.bash_aliases" (or "/.bashrc" if it doesn't exist) with the following:alias djenv='source ~/.virtualenv/Django/bin/activate'
Now run source ~/.bashrc
, and you should be able to start our new Django environment just by typing djenv
One last thing is that there are two configuration files, sql_creds.txt
and private.py
, which are required to run the server, but aren't provided on github for security reasons. Contact 'rlange at harleyschool dot org' for more info or to get the required files
To submit your changes, go to github.com/HarleySchool/commonssite and click on 'Pull Request'