Skip to content

Local Environment Setup

Basim Ramadhan edited this page Sep 6, 2017 · 8 revisions

The following instructions assume you are using Ubuntu.

  1. Ensure Python 3.6 is installed: python3.6 -V
  2. Installing Python 3.6 on Ubuntu >16.04:
    • sudo apt-get update
    • sudo apt-get install python3.6 python3.6-dev
  3. Installing Python 3.6 on Ubuntu 16.04:
    • sudo add-apt-repository ppa:jonathonf/python-3.6
    • sudo apt-get update
    • sudo apt-get install python3.6 python3.6-dev
  4. Install virtualenv: sudo apt install virtualenv
  5. Install Postgres:
    • sudo apt-get install postgresql postgresql-contrib
    • recommended GUI: sudo apt-get install pgadmin3
    • enter the database as the postgres user: sudo su - postgres psql
    • set your own password for the postgres database role: \password postgres
    • set up the database:
      • CREATE DATABASE projectlovelace;
      • CREATE USER admin WITH PASSWORD 'foobar';
      • ALTER ROLE admin SET client_encoding TO 'utf8';
      • ALTER ROLE admin SET default_transaction_isolation TO 'read committed';
      • ALTER ROLE admin SET timezone TO 'UTC'; (confirm that Django setting USE_TZ is True)
      • GRANT ALL PRIVILEGES ON DATABASE projectlovelace TO admin;
      • \q
    • start Postgres on login: sudo systemctl enable postgresql
  6. Clone the lovelace-website repo:
    • cd dir-of-your-choice
    • git clone https://github.com/project-lovelace/lovelace-website.git
    • cd lovelace-website
  7. Download dependencies and create the virtual Python environment: make prepare-venv
  8. Activate the virtual environment: source env/bin/activate
  9. Set up the development web server:
  10. Install PyCharm Community:
  11. Set up PyCharm:
Clone this wiki locally