WARNING: This document tested only on MacOS High Sierra and Ubuntu 18.
You can test it on live! Click here.
-
Install project with the following command to your computer.
$
git clone https://github.com/canadiyaman/jenga_bookapp.git
-
Install virtualenv to your computer(https://virtualenvwrapper.readthedocs.io/en/latest/install.html).
$
pip install virtualenvwrapper
$
export WORKON_HOME=$HOME/.virtualenvs
$
export PROJECT_HOME=$HOME/Devel
$
source /usr/local/bin/virtualenvwrapper.sh
-
Install requirements for the project.
$
pip install -r requirements.txt
-
Create .env file for your local settings and configure .env file.
$
cp .env-example .env
-
Create Database on terminal (or you can create with PgAdmin3~4 It's up to you)
-
If you get psql: could not connect to server: error
$
sudo chown -R postgres:postgres /var/lib/postgresql/9.6
$
sudo chmod -R u=rwX,go= /var/lib/postgresql/9.6
-
Now you can continue create database
$
psql postgres
postgres=# create role {database_user} with password '{database_password}';
postgres=# alter role {username} createrole superuser;
postgres=# alter role {username} createrole login;
postgres=# create database {database_name};
postgres=# grant all privileges on database {database_name} to {database_user};
postgres=# \q
-
-
Make Migration if everythings is good until now.
$
python manage.py migrate
-
Run server
$
python manage.py runserver
It's done! Now you can visit site (http://127.0.0.1:8000)
First you must create an aws account and set trier Elastic Beanstalk server. You can find more information in this link.
Create postresql database. How to configure Postgresql on Elastic Beanstalk
Install project to your computer and move to main directory of project
-
Connect your elastic beanstalk server with ssh. About ssh settings
$
eb ssh
-
Create .env file use with .env-example file.
$
cp .env-example .env
$nano .env
-
Your .env must be like below. Fill with your settings save and exit(CTRL+X).
THEME=blue CACHE_TIME_TYPE_MINUTES=1 DATABASE_NAME=ebdb DATABASE_USER= PASSWORD= DATABASE_HOST= DATABASE_PORT=5432
-
Go back to local directory
$
exit
-
Deploy project.
$
eb deploy
This project created by Can ADIYAMAN. You can use it what every you want.