Skip to content

nditc/nditcDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NDITC Members Database

Build-with

  • Python
  • Django
  • Django-REST-Framework
  • Django-Jazzmin
  • Pandas

How to run

git clone https://github.com/nditc/nditcDB.git
cd nditcDB
python3 -m pip install -r requirements.txt
python3 manage.py collectstatic
python3 manage.py runserver

Functionalites

Admin Panel

You can add , edit , delete , view student by logging in on Admin Panel

Token Authentication

  • To get token,you have to post valid username and password in https://nditcdb.pythonanywhere.com/api/v1/getToken/ .It will return a JSON response
  • To authenticate, the token key should be included in the Authorization HTTP header. The key should be prefixed by the string literal "Token", with whitespace separating the two strings. For example:
{
  Authorization: 'Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b'
}
  • You have to add authentication credentials to perform anything

Fetch all Students data

Send a GET request to https://nditcdb.pythonanywhere.com/api/v1/

Fetch Students data by year

Send a GET request to the server and add the year in the URL

Example of URL : https://nditcdb.pythonanywhere.com/api/v1/year/2025/

Fetch data of a specific student

Send a GET request to the server and add the id of the student in the URL

Example of URL : https://nditcdb.pythonanywhere.com/api/v1/3666/

Add Student data

Send a POST request with data to https://nditcdb.pythonanywhere.com/api/v1/

Include data in the HTTP Body.For example:

{
  year : 0000,
  name : '',
  admission_serial : '',
  college_roll : '',
  serial : '',
  contact_number : '',
  email : '',
  father : '',
  mother : '',
  present_address : ''
  permanent_address : ''
  blood_group : ''
  institutional_background : ''
  background_club_Activities : ''
  competitions : ''
}

Update Student data

Send a PUT/PATCH request with updated data to the server and add the id of the student in the URL . Include updated data in the HTTP Body

Example of URL : https://nditcdb.pythonanywhere.com/api/v1/3666/

Delete Student data

Send a DELETE request to the server and add the id of the student in the URL

Example of URL : https://nditcdb.pythonanywhere.com/api/v1/3666/

Run query

  • You can run query only for the Table named CORE_MEMBER
  • The fields of the Table CORE_MEMBER are :
    • ID
    • YEAR
    • NAME
    • ADMISSION_SERIAL
    • COLLEGE_ROLL
    • SERIAL
    • CONTACT_NUMBER
    • EMAIL
    • TRANSECTION_ID
    • FATHER
    • MOTHER
    • PRESENT_ADDRESS
    • PERMANENT_ADDRESS
    • BLOOD_GROUP
    • INSTITUTOINAL_BACKGROUND
    • BACKGROUND_CLUB_ACTIVITIES
    • COMPETITIONS
  • DON'T CREATE ANY TABLE OR ADD ANY FIELD IN ANY TABLE BY RUNNING QUERY WITH THIS.

  • Create Table and add fields by only using django Model
  • You have to post the query in https://nditcdb.pythonanywhere.com/api/v1/query/ . Include the post data in the HTTP Body. For example:
{
  query : 'SELECT * FROM CORE_MEMBER'
}

Note : Running query with this is not recommended . It may cause unusual internal errors.