GithubHelp home page GithubHelp logo

django_crud's Introduction

Django_Crud

Learning backend using Django. Creating CRUD operation using Django .

Initial setup

  1. python -m venv env // for creating the virtual environment
  2. env/Script/activate // activate virtual enironment
  3. create a new folder and cd newforder
  4. pip install djangorestframework // run command inside the newfolder
  5. django-admin startproject main . // command for initiallization of new project
  6. go inside project (main/setting.py) inside settings.py update in { INSTALLED_APPS = ['rest_framework'] }
  7. python manage.py migrate // initial migrate command for migrating default models like admin and etc...
  8. python manage.py runserver // for running the server

Creating Super user

  1. python manage.py createsuperuser // creating the super user({admin,root}) for login in admin pannel
  2. python manage.py runserver goto {http://127.0.0.1:8000/admin/} //run the server again and try to login as {admin,root}

Creating New App

  1. python manage.py startapp home // creating app (home)
  2. go inside project (main/setting.py) inside settings.py update in { INSTALLED_APPS = ['home'] }

Creating Models

  1. creating models inside (home/models.py) create a class and define the fields
  2. go inside (home/admin.py) and register the model
  3. python manage.py makemigrations // now make the migration for model
  4. python manage.py migrate // now migrate the updates of model

Setup serializer and APIViews

  1. create a file of (serializer.py) and setup serializer
  2. go to (home/views.py) create api using APIViews (get function)

Creating url

  1. goto (main/usls.py) and create a path for {home/} url

django_crud's People

Contributors

harsh12chauhan 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.