Inter IIT Tech Meet ISRO Challenge IIT Kanpur backend repo
Installing Django and Django REST API Framework -
pip install Django
pip install djangorestframework
Hosting the server -
# make sure you are in this repository
python manage.py makemigrations
python manage.py migrate
python manage.py runserver
URL: /isro/getdata/
Method: GET
parameters: nothing
Successful: 200_OK
Unsuccessful: 404_NOT_FOUND
Response: [{'name','ra','dec','astrosat','dateobs','timeobs','srctype','prop_id',
'obs_id','tgt_id','instrument','porb','flux','pubs':[{'id','title','link'}, ...]}, ...]
URL: /isro/card/
Method: POST
parameters: {'ra','dec'}
Successful: 200_OK
Unsuccessful: 404_NOT_FOUND
Response:{'name',
'ra',
'dec',
'astrosat',
'dateobs',
'timeobs',
'srctype',
'prop_id',
'obs_id',
'tgt_id',
'instrument',
'porb',
'flux',
'pubs':[{'id','title','link'}, ...]
}
URL: /isro/addSrc/
Method: POST
mandatory parameters: {'name',
'ra',
'dec',
'astrosat',
'dateobs',
'timeobs',
'srctype',
'prop_id',
'obs_id',
'tgt_id',
'instrument',
'porb',
'flux'
}
Successful: 200_OK
Unsuccessful: If source with the same name already exists -> 406_NOT_ACCEPTABLE
If wrong parameters -> 404_NOT_FOUND
No response field. Source is added to the database if operation is successful.
URL: /isro/addPub/
Method: POST
parameters: {'title','link','sources'}
Successful: 200_OK
Unsuccessful: 404_NOT_FOUND
No response field. Publication is added to the database if operation is successful.