Skip to content

Instantly share code, notes, and snippets.

@fhightower
Created December 9, 2017 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fhightower/bbb806db4c74ca4bd145e942d7363ba7 to your computer and use it in GitHub Desktop.
Save fhightower/bbb806db4c74ca4bd145e942d7363ba7 to your computer and use it in GitHub Desktop.
sudo apt-get update
sudo apt-get install python3-pip python3-dev libpq-dev postgresql postgresql-contrib
sudo -u postgres psql
<<<
CREATE DATABASE myproject;
CREATE USER myprojectuser WITH PASSWORD 'password';
ALTER ROLE myprojectuser SET client_encoding TO 'utf8';
ALTER ROLE myprojectuser SET default_transaction_isolation TO 'read committed';
ALTER ROLE myprojectuser SET timezone TO 'UTC';
GRANT ALL PRIVILEGES ON DATABASE myproject TO myprojectuser;
\q
>>>
# it is assumed that the requirements.txt is accurate and has things like django and psycopg2
pip3 install -r requirements.txt
# Taken from: https://www.digitalocean.com/community/tutorials/how-to-use-postgresql-with-your-django-application-on-ubuntu-16-04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment