Code Monkey home page Code Monkey logo

wpcodevo / django_crud_project Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 6.0 15 KB

In this article, you'll learn how to build a CRUD API with Django and Django REST framework. The RESTful API will have endpoints for performing CRUD operations against an SQLite database.

Home Page: https://codevoweb.com/build-crud-api-with-django-rest-framework/

Python 99.43% Makefile 0.57%
api api-rest crud crud-api django django-crud django-framework django-rest-framework python rest

django_crud_project's Introduction

Build CRUD API with Django REST framework

In this article, you'll learn how to build a CRUD API with Django and Django REST framework. The RESTful API will have endpoints for performing CRUD operations against an SQLite database.

Build CRUD API with Django REST framework

Topics Covered

  • Run the Django CRUD API Locally
  • Run a React.js App with the Django API
  • Setup Django
  • Create the Django Models
    • Database Model
    • Model Serializer
  • Create the CRUD API Views in Django
    • GET and POST API Views
    • GET, PATCH, and DELETE API Views
  • Add the CRUD Routes
    • Add the CRUD API URLs
    • Add the Base URL of the CRUD App to the Project
  • Setup CORS in Django
  • Create the Migration File and Start the Server
  • Test the Django CRUD API
    • Create Note
    • Update Note
    • Get All Notes
    • Delete Note
  • Create Documentation for the CRUD API

Read the entire article here: https://codevoweb.com/build-crud-api-with-django-rest-framework/

django_crud_project's People

Contributors

wpcodevo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

django_crud_project's Issues

Created model 'NoteModel' don't show in the 'http://127.0.0.1:8000/admin/' url.

Issue Description

Summary:
Created model named "NoteModel" is not appearing in the Django admin URL.

Expected Behavior:
When accessing the Django admin URL, the created models with their fields should be visible or accessible from the Django admin panel.

Steps to Reproduce the error.

  1. Access the Django admin URL (/admin/).
  2. Observe that created models are not visible.

Proposed Solution

  1. Import the created models to the admins.py file.
  2. Register the models with the custom admin class using admin.site.register().

Code Example

Here's an example of how the custom admin class can be implemented for a model named YourModel:

from django.contrib import admin
from .models import YourModel

admin.site.register(YourModel)

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.