Git Product home page Git Product logo

university-backend-and-api's Introduction

Sample university rest api

This is a sample rest api using DjangoRestFramework for a university. It contains the models

  • Students
  • Degrees
  • Cohorts
  • Modules
  • Grades

The system has been populated with dummy data from the file /university/management/commands/seed.py To clear the database and rebuild with fresh random data use

python manage.py seed

Warning this command can take some time to run, it populates a lot of data

The superuser details are:

username: admin
password: testing123456

Running the app

Clone the repo and run

python manage.py runserver

This will then run on your own machine at http://127.0.0.1:8000

Docker

If you have Docker installed have a DockerHub account you can download a docker image of this app by typing

docker pull scrineymvm/ca298restassignment:latest

To then start the image in a container run

docker run -p 8000:8000 --name ca298restassignment scrineymvm/ca298restassignment:latest

Then you can go to http://localhost:8000 to view the running instance

URLs

The homepage will take you straight to an interactive swagger interface

  • /api will take you to the standard django rest framework api page
  • /api/schema/redoc/ will take you to an interactive redoc page for the api
  • /api/schema/ will allow you to download the schema.yml to import into other tools such as postman

A note on Cors

This app has allowed localhost:3000 through for CORS, if you need additional ports add them in restexample/settings.py

CORS_ALLOWED_ORIGINS = [
    "http://localhost:3000", # node on port 3000
    "http://127.0.0.1:3000"  # node on port 3000
]

university-backend-and-api's People

Contributors

razvan-gorea avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.