2 __Description__: A django application for sharing and uploading class notes.
4 __Copyright__: FinalsClub, a 501c3 non-profit organization
6 __License__: GPLv3 except where otherwise noted
8 __Contact__: info@karmanotes.org
10 v3.0 of the karmanotes.org website from the FinalsClub Foundation
17 KarmaNotes is an online database of college lecture notes. KarmaNotes empowers college students to participate in the free exchange of knowledge.
21 Clone the project from the central repo using your github account:
23 git clone git@github.com:FinalsClub/karmaworld.git
25 If you aren't using a system setup for github, then grab the project with
28 git clone https://github.com/FinalsClub/karmaworld.git
30 Generally speaking, this will create a subdirectory called `karmaworld` under
31 the directory where the `git` command was run. This git repository directory
32 will be referred to herein as `{project_root}`.
34 There might be some confusion as the git repository's directory will likely be
35 called `karmaworld` (this is `{project_root}`), but there is also a `karmaworld`
36 directory underneath that (`{project_root}/karmaworld`) alongside files like
37 `fabfile.py` (`{project_root}/fabfile.py`) and `README.md`
38 (`{project_root}/README.md`).
42 If you need to setup the project for development, it is highly recommend that
43 you grab an existing development virtual machine or create one yourself.
44 Configure the virtual machine for production with the steps shown in the
45 next section (Production Install). Instructions for creating a virtual machine
48 1. Install [VirtualBox](http://www.virtualbox.com/)
50 1. Install [vagrant](http://www.vagrantup.com/) 1.3 or higher
52 1. Use Vagrant to create the virtual machine.
53 * While in `cd {project_root}`, type `vagrant up`
57 If you're starting to work on this project and you need it setup for production,
58 follow the steps below.
60 1. Ensure the following are installed:
62 * `PostgreSQL` (server and client)
65 * `virtualenv` and `virtualenvwrapper`
67 1. Generate a PostgreSQL database and a role with read/write permissions.
68 * For Debian, these instructions are helpful: https://wiki.debian.org/PostgreSql
70 1. Modify configuration files.
71 * There are settings in `{project_root}/karmaworld/settings/dev.py`
72 * There are additional configuration options for external dependencies
73 under `{project_root}/karmaworld/secret/`.
74 * Copy files with the example extension to the corresponding filename
75 without the example extension (e.g.
76 `cp filepicker.py.example filepicker.py`)
78 * Ensure `PROD_DB_USERNAME`, `PROD_DB_PASSWORD`, and `PROD_DB_NAME`
79 inside `db_settings.py` match the role, password, and database
80 generated in the previous step.
81 * Ensure *.py in `secret/` are never added to the git repo. (.gitignore
82 should help warn against taking this action)
84 1. Make sure that you're in the root of the project that you just cloned and
89 This will make a virtualenv, install the development dependencies and create
92 1. Now you can run ``./manage.py runserver`` and visit the site in the browser.
94 # Accessing the Vagrant Virtual Machine
96 ## Connecting to the VM via SSH
97 If you have installed a virtual machine using `vagrant up`, you can connect
98 to it by running `vagrant ssh` from `{project_root}`.
100 ## Connecting to the development website on the VM
101 To access the website running on the VM, point your browser at
102 http://localhost:6659/ using your host computer.
104 Port 6659 on your local machine is set to forward to the VM's port 80.
106 Fun fact: 6659 was chosen because of OM (sanskrit) and KW (KarmaWorld) on a
109 ## Updating the VM code repository
110 Once connected to the virtual machine by SSH, you will see `karmaworld` in
111 the home directory. That is the `{project_root}` in the virtual machine.
113 `cd karmaworld` and then use `git fetch; git merge` and/or `git pull origin` as
116 The virtual machine's code repository is set to use your host machine's
117 local repository as the origin. So if you make changes locally and commit them,
118 without pushing them anywhere, your VM can pull those changes in for testing.
120 This may seem like duplication. It is. The duplication allows your host machine
121 to maintain git credentials and manage repository access control so that your
122 virtual machine doesn't need sensitive information. Your virtual machine simply
123 pulls from the local repository on your local file system without needing
126 ## Other Vagrant commands
127 Please see [vagrant documentation](http://docs.vagrantup.com/v2/cli/index.html)
128 for more information on how to use the vagrant CLI to manage your development
134 * KarmaNotes.org is a project of the FinalsClub Foundation with generous funding from the William and Flora Hewlett Foundation
136 * Also thanks to [rdegges](https://github.com/rdegges/django-skel) for the django-skel template