installing packages within the environment does not need superuser permissions.
cd $SRC_ROOT
+
virtualenv beta
+
source beta/bin/activate
a) Development
- pip install -r reqs/dev.txt
+ pip install -r reqs/dev.txt
b) Production
- pip install -r reqs/prod.txt
+ pip install -r reqs/prod.txt
Once all dependencies have been installed, we need to edit our manage.py file
so that we are reading the proper settings.py file:
a) Development
- ./manage.py syncdb
- ./manage.py migrate djcelery
+ ./manage.py syncdb
+
+ ./manage.py migrate djcelery
If notes / apps migrations exist, then:
- ./manage.py schemamigration notes --auto
- ./manage.py schemamigration courses --auto
+ ./manage.py schemamigration notes --auto
+
+ ./manage.py schemamigration courses --auto
If they do not exist:
- ./manage.py schemamigration notes --init
- ./manage.py schemamigration courses --init
+ ./manage.py schemamigration notes --init
+
+ ./manage.py schemamigration courses --init
b) Production
- sudo apt-get install postgresql-9.1 python-psycopg2
- sudo passwd postgres
- sudo su postgres
- sudo -u postgres createuser -P djkarma
- psql template1
- create database karmanotes owner djkarma encoding 'UTF8';
- #### add this line to your postgres install's /etc/postgresql/9.1/main/pg_hba.conf ####
- local karmanotes djkarma md5
- sudo service postgresql restart
- ./manage.py syncdb
+ sudo apt-get install postgresql-9.1 python-psycopg2
+
+ sudo passwd postgres
+
+ sudo su postgres
+
+ sudo -u postgres createuser -P djkarma
+
+ psql template1
+
+ create database karmanotes owner djkarma encoding 'UTF8';
+
+ #### add this line to your postgres install's /etc/postgresql/9.1/main/pg_hba.conf ####
+ local karmanotes djkarma md5
+
+ sudo service postgresql restart
+
+ ./manage.py syncdb
Then create a file called karmaworld/secret/db_secret.py. Please see 'secrets.rst' in $SRC_ROOT/docs/source/secrets.rst.
To get started, we need to get the .json files:
- git clone https://github.com/FinalsClub/notesjson.git
- mv notesjson/* .
+ git clone https://github.com/FinalsClub/notesjson.git
+
+ mv notesjson/* .
Then we run the imports (in our virtual environment):
- ./manage.py import_json all
+ ./manage.py import_json all
4. Set up S3 bucket support (optional)
to modify:
DJANGO_PROJECT_DIR
+
VIRTUAL_ENV
Also note that permissions for /var/run/*.pid and /var/log/*.log need