Git Product home page Git Product logo

django-school-api's Introduction

School API

By the end of this assignment you will have a fully serviceable CRUD API with user authentication capabilities that will allow School staff to easily manage students and schollastic equipment.

Student Model

In this assignment we will create a Student Django Model with the following fields

field required type example data
name True string John W. Watson
student_email True string(email) [email protected]
personal_email False string(email) [email protected]
locker_number True int 137
locker_combination True string 37-68-98
good_student True boolean True

Django Set Up

Creating and activating VENV

  #creating venv
  python -m venv <name_of_env>

  #activating venv
  source <name_of_env>/bin/activate

Installing Django and starting a project with an app

    #installing Django
    pip install django

    #creating project
    django-admin startproject school_proj .

    #creating student app
    python manage.py startapp student_app

Creating Database

    createdb school_db

Don't forget to add the app under the INSTALLED_APPS section in settings.py and changing from sqlite to postgresql with a database name!

Installing Psycopg3 to speak with PostgreSQL

  pip install "psycopg[binary]"

Once the Student Model is completed makemigrations and migrate to the school_db

  python manage.py makemigrations
  python manage.py migrate

Running Tests

Replace the test.py file inside your app with the test.py file already attached to this repository.

Now you can run the test suite by typing the following

  python manage.py test
  • . means a test passed
  • E means an unhandled error populated on a test
  • F means a test completely failed to run

django-school-api

django-school-api's People

Contributors

fravila08 avatar blackrebelradio1992 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.