-
Run command
git clone https://github.com/Gradient-IIITS/IIIT-Council-Backend.git
and movie in the repository -
Create a virtual environment
env
in the repository (use virtualenv, etc) -
Activate virtual environment
Windows:
.\env\Scripts\activate
Ubuntu/Linux:source env/bin/activate
Install the requirements
pip install -r requirements.txt
-
Run
python manage.py check
to check any errors -
Run
python manage.py makemigrations
to make the migrations -
un
python manage.py migrate
to update the database schema
-
Install postgreSQL and configure it. (Set postgres password, Note down the PORT, etc).
-
Start postgreSQL shell and create a new user
user1
.CREATE USER user1 WITH PASSWORD 'password';
-
Edit properties to optimize queries (optional)
ALTER ROLE user1 SET client_encoding TO 'utf8'; ALTER ROLE user1 SET default_transaction_isolation TO 'read committed'; ALTER ROLE user1 SET timezone TO 'UTC';
-
Create a new database named
iiits_council
and giveuser1
the access using the following commandCREATE DATABASE iiits_council WITH OWNER = user1 ENCODING = 'UTF8' CONNECTION LIMIT = -1; GRANT ALL ON DATABASE iiits_council TO user1;