Backend is created with Django
This project was bootstrapped with Geodjango Template
sudo apt-get install python3
sudo apt-get install -y python3-pip
sudo apt install python3-virtualenv
virtualenv env
source ./env/bin/activate
chmod +x library.sh
./library.sh
ogrinfo --version
Change the GDAL verision in requirements.txt if your installed version is different from default one (gdal version can be checked from previous command ogrinfo--version
pip install -r requirements.txt
Create .env in root backend project , and add the credentials as provided on .env_sample , Export your secret key and database url to your env
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
Now server will be available in your 8000 port in web , you can check out your localhost:8000/admin for admin panel
To login on admin panel , create your superuser and login with your credentials restarting the server
python manage.py createsuperuser
fAIr uses oauth2.0 Authentication using osm-login-python
- Get your login Url
Hit
/api/v1/auth/login/
- URL will give you login URL which you can use to provide your osm credentials and authorize fAIr
- After successfull login you will get access-token that you can use accross all osm login required endpoints in fAIr
- Check authentiation by getting back your data
Hit
/api/v1/auth/me/
- URL requires access-token as header and in return you will see your osm username , id and image url