From 496f8808f7ad8dce4416c5b8841392a78d7ee0bc Mon Sep 17 00:00:00 2001 From: Charles Connell Date: Wed, 18 Dec 2013 12:30:34 -0500 Subject: [PATCH] Format commands better --- docs/source/os-install.rst | 57 ++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/docs/source/os-install.rst b/docs/source/os-install.rst index 7c68452..3740bf8 100644 --- a/docs/source/os-install.rst +++ b/docs/source/os-install.rst @@ -72,16 +72,18 @@ After installing virtualenv, we need to configure our new environment. Note that 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: @@ -104,31 +106,42 @@ environment, make sure to follow the instructions in section b first. 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. @@ -143,12 +156,13 @@ Karmaworld has facilities built-in so that these json files can easily be import 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) @@ -178,6 +192,7 @@ this script can be found in $SRC_ROOT/bin/celeryd . Just make sure to modify: DJANGO_PROJECT_DIR + VIRTUAL_ENV Also note that permissions for /var/run/*.pid and /var/log/*.log need -- 2.25.1