Skip to content

Inter IIT Tech Meet ISRO Challenge IIT Kanpur backend repo

Notifications You must be signed in to change notification settings

SomTambe/AstroSat-Backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IsroApp

Inter IIT Tech Meet ISRO Challenge IIT Kanpur backend repo

How to host

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

API endpoints

Fetch Data API

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'}, ...]}, ...]

View Card API

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'}, ...]
          }

Add Source API

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.

Add Publication API

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.

About

Inter IIT Tech Meet ISRO Challenge IIT Kanpur backend repo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages