This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import admin | |
from django.urls import path, include | |
from rest_framework import routers | |
from employee_app import views | |
#Use the router to dynamically create our urls | |
router = routers.DefaultRouter() | |
router.register('employees', views.EmployeeAPI) | |
router.register('departments', views.DepartmentsAPI) | |
router.register('deptemp', views.DeptEmpAPI) | |
router.register('deptmanager', views.DeptManagerAPI) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import admin | |
from . import models | |
# Register your models here. | |
admin.site.register(models.Employees) | |
admin.site.register(models.Departments) | |
admin.site.register(models.DeptEmp) | |
admin.site.register(models.DeptManager) | |
admin.site.register(models.Salaries) | |
admin.site.register(models.Titles) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$python manage.py runserver 0.0.0.0:8080 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP 200 OK | |
Allow: GET, HEAD, OPTIONS | |
Content-Type: application/json | |
Vary: Accept | |
{ | |
"employees": "http://127.0.0.1:8080/api/employees/", | |
"departments": "http://127.0.0.1:8080/api/departments/", | |
"deptemp": "http://127.0.0.1:8080/api/deptemp/", | |
"deptmanager": "http://127.0.0.1:8080/api/deptmanager/", | |
"salaries": "http://127.0.0.1:8080/api/salaries/", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP 200 OK | |
Allow: GET, POST, HEAD, OPTIONS | |
Content-Type: application/json | |
Vary: Accept | |
[ | |
{ | |
"emp_no": 10001, | |
"salary": 60117, | |
"from_date": "1986-06-26", | |
"to_date": "1987-06-26" |
OlderNewer