Skip to content
vky25 edited this page Apr 19, 2022 · 1 revision

Welcome to the PDA-WEB wiki! GETTING STARTED

Installation steps

sudo apt update & sudo apt upgrade

sudo apt install python3-pip

python3 -m pip install --upgrade pip

pip install django==3.2

sudo pip3 install virtualenv

To verify run:

python3 --version

pip --version

django-admin --version

git clone https://github.com/arghyam/PDA-WEB.git

Creating virtual environment:

virtualenv env

source env/bin/activate

Checking out branch:

cd PDA-WEB

git checkout dev

Configurations

https://github.com/PDA-Open-Source/PDA-WEB/wiki/PDA-WEB#configuration

Code Changes

  1. Changes in mobileNumberValidation.js - Disabling min max length mobile number validation on the login screen since the validation was not working as expected
  • Set phoneNumberMinLength, phoneNumberMaxLength to 10 var phoneNumberMinLength = 10; var phoneNumberMaxLength = 10;
  • Comment line number 19 mobileNumberLengthValidation(filter, mobNum);
  • Comment lines 22 to 33
  • Remove lines 68 to 88
  • Change line 71 to $("#phoneNumberErrorMessage").text(Please enter phone number");
  1. Changes in requirements.txt - earlier mentioned versions could not be installed
  • Change line 11 to psycopg2-binary
  • Change line 18 to six==1.10.0
  • Add
certifi==2017.7.27.1
  1. Changes in settings/base.py - Timezone had to be disabled. This may need additional configuration in order to be enabled.
  • Comment line 139 USE_TZ = True
  1. Changes in apps/program/views.py - The response handling was broken and this is a fix for it.
  • Change line 58 and 59 to

if response.status_code == 200:

response_result = response.json()

  1. Add files core/migrations/0002_auto_20220209_0922.py and apps/program/migrations/0011_auto_20220209_0922.py - adding missing fields in the models as part of migration

Steps to run the application

  1. Run pip3 install -r requirements.txt from the root directory
  2. In case you run into errors in step 1, run these following steps

sudo apt install libcurl4-openssl-dev libssl-dev

sudo apt-get install libjpeg-dev zlib1g-dev

pip3 install Pillow

  1. Re-run step 1
  2. Run python3 manage.py makemigrations
  3. Run python3 manage.py migrate
  4. In case you run into errors in step 5, run python3 manage.py migrate –fake instead.
  5. Run screen
  6. Run python3 manage.py runserver 0:8000
Clone this wiki locally