-
Notifications
You must be signed in to change notification settings - Fork 4
Local Environment Setup
Basim Ramadhan edited this page Sep 4, 2017
·
8 revisions
The following instructions assume you are using Ubuntu.
- Ensure Python 3.6 is installed:
python3.6 -V
- Installing Python 3.6 on Ubuntu >16.04:
sudo apt-get update
sudo apt-get install python3.6
- 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
- Install virtualenv:
sudo apt install virtualenv
- Install Postgres:
sudo apt-get install postgresql postgresql-contrib
- recommended web interface:
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 isTrue
) GRANT ALL PRIVILEGES ON DATABASE projectlovelace TO admin;
\q
- start Postgres on login:
sudo systemctl enable postgresql
- Clone the lovelace-website repo:
cd dir-of-your-choice
git clone https://github.com/project-lovelace/lovelace-website.git
cd lovelace-website
- Download dependencies and create the virtual Python environment:
make prepare-venv
- Activate the virtual environment:
source env/bin/activate
- Start the development web server:
cd src
python manage.py runserver
- Install PyCharm Community:
- download: https://www.jetbrains.com/pycharm/download/#section=linux
- follow installation instruction on the JetBrains website
- TODO: make page for PyCharm setup
- Set up PyCharm: