Since this repository has submodule, when you clone it, please use git clone --recursive git@github.com:ELVIS-Project/simssadb.git, so that the submodule can also be cloned.
Make sure you have
homebrewand python 3.6 or above installedInstall PostgreSQL with
brew install postgresqlStart the PostgreSQL server with
brew services start postgresqlStart a virtual environment with
python3 -m venv venvStart virtual environment
source venv/bin/activateSet up environment variables with:
cat env.txt >> ~/.bash_profileandsource ~/.bash_profile(NOTE: If you use PyCharm or other IDE, please restart the IDE for the environmental settings to work!)Install python packages
pip3 install -r requirements.txtSetup database:
> createdb `whoami`> createdb ${POSTGRES_DB}> createuser ${POSTGRES_USER} -d -e -l -r -s > psql -d ${POSTGRES_DB} -c "ALTER DATABASE $POSTGRES_DB OWNER TO $POSTGRES_USER;"> psql ${POSTGRES_DB} -c "ALTER USER $POSTGRES_USER WITH PASSWORD '$POSTGRES_PASSWORD';"
Make migrations:
python manage.py makemigrationsMigrate:
python manage.py migrateStart a server to see if it worked:
python manage.py runserverGo to
http://127.0.0.1:8000on your web browser
- Start virtual environment
source venv/bin/activate - Link environment variables
source ~/.bash_profile - Start the server
python manage.py runserver - Go to
http://127.0.0.1:8000on your web browser
See the Wiki for more information: