You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cd /home/user_name/your_path/curate_science
python3 -m venv cs_env
source cs_env/bin/activate
Install all necessary Python packages
Make sure that wheel is installed wheel-V, if not, install it using pip3 install wheel. Then install all required Python packages, e.g. Django, Google Cloud Storage.
pip3 install -r requirements.txt
PostgreSQL set up
Install PostgreSQL >= 9.4
sudo apt install postgresql postgresql-contrib
Create .env file and set environmental variables with your own name, password, and key
CREATEDATABASEcurate;
CREATE USER [DB_USER] WITH PASSWORD '[DB_PASS]';
GRANT ALL PRIVILEGES ON DATABASE curate TO [DB_USER];
ALTERUSER [DB_USER] CREATEDB;
Get backup data Email Curate Science admin to get access to the current backup file
Quit PostgreSQL shell and restore dump. Here its name is backup.bak
\q
psql curate < backup.bak
Django set up
Execute Django migrations
Make new migrations
python manage.py makemigrations
Apply migrations
python3 manage.py migrate
Access Django admin
Fill in your username, email, password
Today I updated my OS to Ubuntu 20.04 and the app did not work. I tried to restore the virtual environment, but couldn't run python manage.py runserver_plus afterward. I had to change the version of psycopg in the requirements.txt file before the installation of python dependencies
from psycopg2==2.7.5 psycopg2-binary==2.7.5
to psycopg2==2.8 psycopg2-binary==2.8
Somehow psycopg 2.7.5 couldn't be installed using pip. Now everything's fine.
Detailed and reorganized instructions based on READ.md and issue #76 prepared on Ubuntu, POP!_OS 19.10.
Prerequisites
Update OS and clone this repo
Python set up
Check if pip3 and python3 are installed
Create and activate virtual environment
Install all necessary Python packages
Make sure that
wheel
is installedwheel-V
, if not, install it usingpip3 install wheel
. Then install all required Python packages, e.g. Django, Google Cloud Storage.PostgreSQL set up
Install PostgreSQL >= 9.4
sudo apt install postgresql postgresql-contrib
Create .env file and set environmental variables with your own name, password, and key
Login to postgresql interactive terminal
Create a database, user, and add access
Get backup data
Email Curate Science admin to get access to the current backup file
Quit PostgreSQL shell and restore dump. Here its name is
backup.bak
Django set up
Execute Django migrations
Make new migrations
Apply migrations
Access Django admin
Fill in your username, email, password
Get images
See Google Cloud API to install
gsutil
Copy files from the staging bucket
Create a new folder
media
that contains images and copy files from the bucket using multithreadedgsutil cp
Preparation for development
Check if
npm
is installed. Install dependencies,yarn
globally andwebpack
locallyRunning Tests
Starting local server for development
python3 manage.py runserver_plus # In a new terminal (to compile JS bundle(s) and HTML) yarn start
App should be running at
localhost:8000
Django admin should be available at
localhost:8000/admin
The text was updated successfully, but these errors were encountered: