-
Notifications
You must be signed in to change notification settings - Fork 4
Local Environment Setup
Basim Ramadhan edited this page Sep 2, 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
- change to
postgres
user to access the database:sudo su - postgres
- enter the database:
psql
- set your own password for the
postgres
database role:\password postgres
- set up the database for Lovelace:
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
- return to your user:
exit
- 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: