Skip to content

Instantly share code, notes, and snippets.

@wordyallen
Created March 22, 2016 00:48
Show Gist options
  • Save wordyallen/78d1c70f09e756d59dfa to your computer and use it in GitHub Desktop.
Save wordyallen/78d1c70f09e756d59dfa to your computer and use it in GitHub Desktop.
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
apt-get update
apt-get upgrade
apt-get install python3-pip git libpq-dev tree nginx postgresql-9.4
alias python=python3
alias pip=pip3
sudo su - postgres
CREATE DATABASE mia_councilmatic;
CREATE USER codeformiami WITH PASSWORD 'code4miami';
ALTER ROLE codeformiami SET client_encoding TO 'utf8';
ALTER ROLE codeformiami SET default_transaction_isolation TO 'read committed';
ALTER ROLE codeformiami SET timezone TO 'UTC';
GRANT ALL PRIVILEGES ON DATABASE mia_councilmatic TO codeformiami;
\q
exit
# pip install virtualenvwrapper
#
# nano ~/.profile
#
# VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3.4
# export VIRTUALENVWRAPPER_PYTHON
# export WORKON_HOME=$HOME/.virtualenvs
# export PROJECT_HOME=$HOME/Devel
# source /usr/local/bin/virtualenvwrapper.sh
#
#
# source ~/.profile
#
#
# mkvirtualenv chi-councilmatic
pip3 install virtualenv
git clone https://github.com/Code-for-Miami/miami-dade-councilmatic.git
cd miami-dade-councilmatic
virtualenv venv
source venv/bin/activate
nano requirements.txt
-e git+https://github.com/datamade/django-councilmatic.git#egg=django-councilmatic==0.51
gunicorn
pip install -r requirements.txt
cp councilmatic/settings_deployment.py.example councilmatic/settings_deployment.py
nano councilmatic/settings_deployment.py
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'mia_councilmatic',
'USER': 'codeformiami',
'PASSWORD': 'code4miami',
'HOST': 'localhost',
}
}
ocd-jurisdiction/country:us/state:fl/county:miami-dade/legislature
4d011b3b-4906-47ac-9947-05f3422e83d0
python manage.py migrate --no-initial-data
python manage.py createsuperuser
email: ehsiung@codeforamerica.org
python manage.py createcachetable
#this takes a few mins. the further out the date the better
#ignore https warnings
# might need to run twice
python manage.py loaddata --update_since 2016-08-02 #year month day
python manage.py runserver 0.0.0.0:8000
SNAPSHOT
update readme
- mia_councilmatic 162.243.115.7
- djangTemp 192.241.253.153
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment