├── .gitignore ├── .idea ├── .gitignore ├── DjangoCRUDwithMySQL.iml ├── dataSources.xml ├── inspectionProfiles │ └── profiles_settings.xml ├── misc.xml ├── modules.xml └── vcs.xml ├── CRUDapp ├── __init__.py ├── admin.py ├── apps.py ├── form.py ├── migrations │ ├── 0001_initial.py │ ├── 0002_auto_20191107_0734.py │ └── __init__.py ├── models.py ├── serializers.py ├── tests.py └── views.py ├── DjangoCRUDwithMySQL ├── __init__.py ├── settings.py ├── urls.py └── wsgi.py ├── README.md ├── manage.py ├── static └── script.js ├── templates ├── base.html └── index.html └── venv └── lib └── python3.7 └── site-packages ├── djangorestframework-3.11.0.dist-info ├── INSTALLER ├── LICENSE.md ├── METADATA ├── RECORD ├── WHEEL └── top_level.txt └── rest_framework ├── __init__.py ├── apps.py ├── authentication.py ├── authtoken ├── __init__.py ├── admin.py ├── apps.py ├── management │ ├── __init__.py │ └── commands │ │ ├── __init__.py │ │ └── drf_create_token.py ├── migrations │ ├── 0001_initial.py │ ├── 0002_auto_20160226_1747.py │ └── __init__.py ├── models.py ├── serializers.py └── views.py ├── checks.py ├── compat.py ├── decorators.py ├── documentation.py ├── exceptions.py ├── fields.py ├── filters.py ├── generics.py ├── locale ├── ach │ └── LC_MESSAGES │ │ └── django.mo ├── ar │ └── LC_MESSAGES │ │ └── django.mo ├── be │ └── LC_MESSAGES │ │ └── django.mo ├── ca │ └── LC_MESSAGES │ │ └── django.mo ├── ca_ES │ └── LC_MESSAGES │ │ └── django.mo ├── cs │ └── LC_MESSAGES │ │ └── django.mo ├── da │ └── LC_MESSAGES │ │ └── django.mo ├── de │ └── LC_MESSAGES │ │ └── django.mo ├── el │ └── LC_MESSAGES │ │ └── django.mo ├── el_GR │ └── LC_MESSAGES │ │ └── django.mo ├── en │ └── LC_MESSAGES │ │ └── django.mo ├── en_AU │ └── LC_MESSAGES │ │ └── django.mo ├── en_CA │ └── LC_MESSAGES │ │ └── django.mo ├── en_US │ └── LC_MESSAGES │ │ └── django.mo ├── es │ └── LC_MESSAGES │ │ └── django.mo ├── et │ └── LC_MESSAGES │ │ └── django.mo ├── fa │ └── LC_MESSAGES │ │ └── django.mo ├── fa_IR │ └── LC_MESSAGES │ │ └── django.mo ├── fi │ └── LC_MESSAGES │ │ └── django.mo ├── fr │ └── LC_MESSAGES │ │ └── django.mo ├── fr_CA │ └── LC_MESSAGES │ │ └── django.mo ├── gl │ └── LC_MESSAGES │ │ └── django.mo ├── gl_ES │ └── LC_MESSAGES │ │ └── django.mo ├── he_IL │ └── LC_MESSAGES │ │ └── django.mo ├── hu │ └── LC_MESSAGES │ │ └── django.mo ├── id │ └── LC_MESSAGES │ │ └── django.mo ├── it │ └── LC_MESSAGES │ │ └── django.mo ├── ja │ └── LC_MESSAGES │ │ └── django.mo ├── ko_KR │ └── LC_MESSAGES │ │ └── django.mo ├── lv │ └── LC_MESSAGES │ │ └── django.mo ├── mk │ └── LC_MESSAGES │ │ └── django.mo ├── nb │ └── LC_MESSAGES │ │ └── django.mo ├── nl │ └── LC_MESSAGES │ │ └── django.mo ├── nn │ └── LC_MESSAGES │ │ └── django.mo ├── no │ └── LC_MESSAGES │ │ └── django.mo ├── pl │ └── LC_MESSAGES │ │ └── django.mo ├── pt │ └── LC_MESSAGES │ │ └── django.mo ├── pt_BR │ └── LC_MESSAGES │ │ └── django.mo ├── pt_PT │ └── LC_MESSAGES │ │ └── django.mo ├── ro │ └── LC_MESSAGES │ │ └── django.mo ├── ru │ └── LC_MESSAGES │ │ └── django.mo ├── sk │ └── LC_MESSAGES │ │ └── django.mo ├── sl │ └── LC_MESSAGES │ │ └── django.mo ├── sv │ └── LC_MESSAGES │ │ └── django.mo ├── tr │ └── LC_MESSAGES │ │ └── django.mo ├── tr_TR │ └── LC_MESSAGES │ │ └── django.mo ├── uk │ └── LC_MESSAGES │ │ └── django.mo ├── vi │ └── LC_MESSAGES │ │ └── django.mo ├── zh_CN │ └── LC_MESSAGES │ │ └── django.mo ├── zh_Hans │ └── LC_MESSAGES │ │ └── django.mo ├── zh_Hant │ └── LC_MESSAGES │ │ └── django.mo └── zh_TW │ └── LC_MESSAGES │ └── django.mo ├── management ├── __init__.py └── commands │ ├── __init__.py │ └── generateschema.py ├── metadata.py ├── mixins.py ├── negotiation.py ├── pagination.py ├── parsers.py ├── permissions.py ├── relations.py ├── renderers.py ├── request.py ├── response.py ├── reverse.py ├── routers.py ├── schemas ├── __init__.py ├── coreapi.py ├── generators.py ├── inspectors.py ├── openapi.py ├── utils.py └── views.py ├── serializers.py ├── settings.py ├── static └── rest_framework │ ├── css │ ├── bootstrap-theme.min.css │ ├── bootstrap-tweaks.css │ ├── bootstrap.min.css │ ├── default.css │ ├── font-awesome-4.0.3.css │ └── prettify.css │ ├── docs │ ├── css │ │ ├── base.css │ │ ├── highlight.css │ │ └── jquery.json-view.min.css │ ├── img │ │ ├── favicon.ico │ │ └── grid.png │ └── js │ │ ├── api.js │ │ ├── highlight.pack.js │ │ └── jquery.json-view.min.js │ ├── fonts │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ ├── fontawesome-webfont.woff │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 │ ├── img │ ├── glyphicons-halflings-white.png │ ├── glyphicons-halflings.png │ └── grid.png │ └── js │ ├── ajax-form.js │ ├── bootstrap.min.js │ ├── coreapi-0.1.1.js │ ├── csrf.js │ ├── default.js │ ├── jquery-3.4.1.min.js │ └── prettify-min.js ├── status.py ├── templates └── rest_framework │ ├── admin.html │ ├── admin │ ├── detail.html │ ├── dict_value.html │ ├── list.html │ ├── list_value.html │ └── simple_list_value.html │ ├── api.html │ ├── base.html │ ├── docs │ ├── auth │ │ ├── basic.html │ │ ├── session.html │ │ └── token.html │ ├── document.html │ ├── error.html │ ├── index.html │ ├── interact.html │ ├── langs │ │ ├── javascript-intro.html │ │ ├── javascript.html │ │ ├── python-intro.html │ │ ├── python.html │ │ ├── shell-intro.html │ │ └── shell.html │ ├── link.html │ └── sidebar.html │ ├── filters │ ├── base.html │ ├── ordering.html │ └── search.html │ ├── horizontal │ ├── checkbox.html │ ├── checkbox_multiple.html │ ├── dict_field.html │ ├── fieldset.html │ ├── form.html │ ├── input.html │ ├── list_field.html │ ├── list_fieldset.html │ ├── radio.html │ ├── select.html │ ├── select_multiple.html │ └── textarea.html │ ├── inline │ ├── checkbox.html │ ├── checkbox_multiple.html │ ├── dict_field.html │ ├── fieldset.html │ ├── form.html │ ├── input.html │ ├── list_field.html │ ├── list_fieldset.html │ ├── radio.html │ ├── select.html │ ├── select_multiple.html │ └── textarea.html │ ├── login.html │ ├── login_base.html │ ├── pagination │ ├── numbers.html │ └── previous_and_next.html │ ├── raw_data_form.html │ ├── schema.js │ └── vertical │ ├── checkbox.html │ ├── checkbox_multiple.html │ ├── dict_field.html │ ├── fieldset.html │ ├── form.html │ ├── input.html │ ├── list_field.html │ ├── list_fieldset.html │ ├── radio.html │ ├── select.html │ ├── select_multiple.html │ └── textarea.html ├── templatetags ├── __init__.py └── rest_framework.py ├── test.py ├── throttling.py ├── urlpatterns.py ├── urls.py ├── utils ├── __init__.py ├── breadcrumbs.py ├── encoders.py ├── field_mapping.py ├── formatting.py ├── html.py ├── humanize_datetime.py ├── json.py ├── mediatypes.py ├── model_meta.py ├── representation.py ├── serializer_helpers.py └── urls.py ├── validators.py ├── versioning.py ├── views.py └── viewsets.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Project exclude paths 2 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /workspace.xml 3 | # Datasource local storage ignored files 4 | /dataSources/ 5 | /dataSources.local.xml 6 | -------------------------------------------------------------------------------- /.idea/DjangoCRUDwithMySQL.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 29 | 30 | -------------------------------------------------------------------------------- /.idea/dataSources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mysql.8 6 | true 7 | true 8 | $PROJECT_DIR$/DjangoCRUDwithMySQL/settings.py 9 | com.mysql.cj.jdbc.Driver 10 | jdbc:mysql://127.0.0.1:3306/students 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /CRUDapp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/CRUDapp/__init__.py -------------------------------------------------------------------------------- /CRUDapp/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /CRUDapp/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CrudappConfig(AppConfig): 5 | name = 'CRUDapp' 6 | -------------------------------------------------------------------------------- /CRUDapp/form.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | from .models import Student 3 | 4 | 5 | class StudentForm(forms.ModelForm): 6 | name = forms.CharField(widget=forms.TextInput( 7 | attrs={ 8 | 'id': "nameStudent", 9 | 'name': "name", 10 | 'max_length': '30', 11 | 'placeholder': 'Name Here...' 12 | } 13 | )) 14 | branch = forms.CharField(widget=forms.TextInput( 15 | attrs={ 16 | 'id': "branchStudent", 17 | 'name': "branch", 18 | 'max_length': '20', 19 | 'placeholder': 'Branch Here...' 20 | } 21 | )) 22 | eno = forms.CharField(widget=forms.TextInput( 23 | attrs={ 24 | 'id': "enoStudent", 25 | 'name': "eno", 26 | 'max_length': '10', 27 | 'placeholder': 'Enrollment Number Here...' 28 | } 29 | )) 30 | 31 | class Meta: 32 | model = Student 33 | fields = '__all__' 34 | -------------------------------------------------------------------------------- /CRUDapp/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.7 on 2019-11-07 06:49 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='Student', 16 | fields=[ 17 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 18 | ('name', models.CharField(max_length=30)), 19 | ('branch', models.CharField(max_length=20)), 20 | ('eno', models.TextField(max_length=10)), 21 | ], 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /CRUDapp/migrations/0002_auto_20191107_0734.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 2.2.7 on 2019-11-07 07:34 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('CRUDapp', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='student', 15 | name='eno', 16 | field=models.CharField(max_length=10), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /CRUDapp/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/CRUDapp/migrations/__init__.py -------------------------------------------------------------------------------- /CRUDapp/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | 4 | class Student(models.Model): 5 | name = models.CharField(max_length=30) 6 | branch = models.CharField(max_length=20) 7 | eno = models.CharField(max_length=10) 8 | -------------------------------------------------------------------------------- /CRUDapp/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from . import models 3 | 4 | 5 | class StudentSerializer(serializers.ModelSerializer): 6 | class Meta: 7 | model = models.Student 8 | fields = ('name', 'branch', 'eno') 9 | -------------------------------------------------------------------------------- /CRUDapp/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /CRUDapp/views.py: -------------------------------------------------------------------------------- 1 | from django.http import JsonResponse 2 | from django.shortcuts import render 3 | 4 | from .serializers import StudentSerializer 5 | from .form import StudentForm 6 | from .models import Student 7 | from django.views import View 8 | 9 | 10 | class CRUDOps(View): 11 | # def getmodal(self): #never used - just for future reference 12 | # data = Student.objects.all() 13 | # modal = "" 14 | # for entry in data: 15 | # modal += " " + entry.eno + "" + entry.name + "" + entry.branch + "" 16 | # modal += "" 17 | # modal += "" 18 | # modal += "" 19 | 20 | # return modal 21 | 22 | def get(self, request): 23 | form = StudentForm(request.POST) 24 | 25 | studentdata = Student.objects.all() 26 | 27 | context = {'form': form, 'studentdata': studentdata} 28 | return render(request, 'index.html', context) 29 | # return JsonResponse(context) 30 | 31 | def post(self, request, sid=None): 32 | form = StudentForm(request.POST) 33 | 34 | if sid is not None: 35 | student = Student.objects.get(id=sid) 36 | form = StudentForm(request.POST, instance=student) 37 | 38 | if form.is_valid(): 39 | form.save() 40 | 41 | studentdata = Student.objects.all() 42 | 43 | context = {'form': form, 'studentdata': studentdata} 44 | return render(request, 'index.html', context) 45 | 46 | def put(self, request, sid): 47 | 48 | if sid is not None: 49 | studentdata = Student.objects.get(id=sid) 50 | 51 | return JsonResponse(StudentSerializer(studentdata).data, safe=False) 52 | 53 | def delete(self, request, sid): 54 | form = StudentForm(request.POST) 55 | student = Student.objects.get(id=sid) 56 | student.delete() 57 | studentdata = Student.objects.all() 58 | context = {'form': form, 'studentdata': studentdata} 59 | return render(request, 'index.html', context) 60 | -------------------------------------------------------------------------------- /DjangoCRUDwithMySQL/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/DjangoCRUDwithMySQL/__init__.py -------------------------------------------------------------------------------- /DjangoCRUDwithMySQL/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for DjangoCRUDwithMySQL project. 3 | 4 | Generated by 'django-admin startproject' using Django 2.2.7. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.2/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/2.2/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = '!g2r_pyx(v5um@d^x*qsl8q_9jwt=2k20q58&z9w^66gs#-l(x' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'django.contrib.admin', 35 | 'django.contrib.auth', 36 | 'django.contrib.contenttypes', 37 | 'django.contrib.sessions', 38 | 'django.contrib.messages', 39 | 'django.contrib.staticfiles', 40 | 'CRUDapp.apps.CrudappConfig', 41 | ] 42 | 43 | MIDDLEWARE = [ 44 | 'django.middleware.security.SecurityMiddleware', 45 | 'django.contrib.sessions.middleware.SessionMiddleware', 46 | 'django.middleware.common.CommonMiddleware', 47 | 'django.middleware.csrf.CsrfViewMiddleware', 48 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 49 | 'django.contrib.messages.middleware.MessageMiddleware', 50 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 51 | ] 52 | 53 | ROOT_URLCONF = 'DjangoCRUDwithMySQL.urls' 54 | 55 | TEMPLATES = [ 56 | { 57 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 58 | 'DIRS': [os.path.join(BASE_DIR, 'templates')] 59 | , 60 | 'APP_DIRS': True, 61 | 'OPTIONS': { 62 | 'context_processors': [ 63 | 'django.template.context_processors.debug', 64 | 'django.template.context_processors.request', 65 | 'django.contrib.auth.context_processors.auth', 66 | 'django.contrib.messages.context_processors.messages', 67 | ], 68 | }, 69 | }, 70 | ] 71 | 72 | WSGI_APPLICATION = 'DjangoCRUDwithMySQL.wsgi.application' 73 | 74 | 75 | # Database 76 | # https://docs.djangoproject.com/en/2.2/ref/settings/#databases 77 | 78 | DATABASES = { 79 | 'default': { 80 | 'ENGINE': 'django.db.backends.mysql', 81 | 'NAME': 'students', 82 | 'USER': 'root', 83 | 'PASSWORD': '', 84 | 'HOST': 'localhost', 85 | 'PORT': '3306', 86 | } 87 | } 88 | 89 | 90 | # Password validation 91 | # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators 92 | 93 | AUTH_PASSWORD_VALIDATORS = [ 94 | { 95 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 96 | }, 97 | { 98 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 99 | }, 100 | { 101 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 102 | }, 103 | { 104 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 105 | }, 106 | ] 107 | 108 | 109 | # Internationalization 110 | # https://docs.djangoproject.com/en/2.2/topics/i18n/ 111 | 112 | LANGUAGE_CODE = 'en-us' 113 | 114 | TIME_ZONE = 'UTC' 115 | 116 | USE_I18N = True 117 | 118 | USE_L10N = True 119 | 120 | USE_TZ = True 121 | 122 | 123 | # Static files (CSS, JavaScript, Images) 124 | # https://docs.djangoproject.com/en/2.2/howto/static-files/ 125 | 126 | STATIC_URL = '/static/' 127 | 128 | STATICFILES_DIRS = ( 129 | os.path.join(BASE_DIR, 'static'), 130 | ) 131 | -------------------------------------------------------------------------------- /DjangoCRUDwithMySQL/urls.py: -------------------------------------------------------------------------------- 1 | """DjangoCRUDwithMySQL URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.2/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path 18 | import CRUDapp.views as CRUD 19 | 20 | urlpatterns = [ 21 | path('index/', CRUD.CRUDOps.as_view(), name='index'), 22 | path('index/insert/', CRUD.CRUDOps.as_view(), name="index"), 23 | path('index/insert/', CRUD.CRUDOps.as_view(), name="index"), 24 | path('index/update/', CRUD.CRUDOps.as_view(), name="update"), 25 | path('index/delete/', CRUD.CRUDOps.as_view(), name="delete") 26 | ] 27 | -------------------------------------------------------------------------------- /DjangoCRUDwithMySQL/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for DjangoCRUDwithMySQL project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'DjangoCRUDwithMySQL.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DjangoCRUDwithMySQL 2 | Simple Application to demonstrate Create, Read, Update and Delete Operation using MySQL Database by @akshatsoni64 3 | -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'DjangoCRUDwithMySQL.settings') 9 | try: 10 | from django.core.management import execute_from_command_line 11 | except ImportError as exc: 12 | raise ImportError( 13 | "Couldn't import Django. Are you sure it's installed and " 14 | "available on your PYTHONPATH environment variable? Did you " 15 | "forget to activate a virtual environment?" 16 | ) from exc 17 | execute_from_command_line(sys.argv) 18 | 19 | 20 | if __name__ == '__main__': 21 | main() 22 | -------------------------------------------------------------------------------- /static/script.js: -------------------------------------------------------------------------------- 1 | function getCookie(name) { 2 | var cookieValue = null; 3 | if (document.cookie && document.cookie != '') { 4 | var cookies = document.cookie.split(';'); 5 | for (var i = 0; i < cookies.length; i++) { 6 | var cookie = jQuery.trim(cookies[i]); 7 | // Does this cookie string begin with the name we want? 8 | if (cookie.substring(0, name.length + 1) == (name + '=')) { 9 | cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); 10 | break; 11 | } 12 | } 13 | } 14 | return cookieValue; 15 | } 16 | 17 | $(document).ready(function(){ 18 | // console.log("Jquery Working Fine Sir!"); 19 | 20 | // $("#editStudent").on('submit','form',function(e){ 21 | $("#editStudent").click(function(){ 22 | alert("Updating"+this.id); 23 | var cookies = document.cookie.split(";"); 24 | var cookie = cookies[0].split("=") 25 | // console.log("Cookie"+cookie[1]); 26 | 27 | var formdata = new FormData($("#addStudent")[0]); 28 | 29 | $.ajax({ 30 | url:'insert/'+cookie[1], 31 | type:'POST', 32 | processData: false, 33 | cache: false, 34 | contentType: false, 35 | data:formdata, 36 | success:function(data){ 37 | // console.log(data); 38 | alert("Updated"); 39 | $("#addStudent").trigger("reset"); 40 | window.location.href="http://localhost:8000/index"; 41 | $("#submitStudent").css("display","block"); 42 | $("#editStudent").css("display","none"); 43 | } 44 | }); 45 | }); 46 | 47 | $("#addStudent").submit(function(e){ 48 | e.preventDefault(); 49 | var formdata = new FormData(this); 50 | // for(var pair of formData.entries()) { 51 | // console.log(pair[0]+ ', '+ pair[1]); 52 | // } 53 | $.ajax({ 54 | url:'insert/', 55 | type:'POST', 56 | processData: false, 57 | cache: false, 58 | contentType: false, 59 | data:formdata, 60 | success:function(data){ 61 | // console.log(data); 62 | // alert("Inserted"); 63 | $("#addStudent").trigger("reset"); 64 | window.location.href="http://localhost:8000/index"; 65 | } 66 | }); 67 | }); 68 | 69 | $(".editStudent").on('click',function(){ 70 | console.log("Edit Request"); 71 | var sid = this.id.substr(8,9); 72 | document.cookie="sid="+sid; 73 | // console.log(sid); 74 | $.ajaxSetup({ 75 | headers: { "X-CSRFToken": getCookie('csrftoken') } 76 | }); 77 | $.ajax({ 78 | url: 'insert/'+sid, 79 | type: 'PUT', 80 | success: function(data){ 81 | // console.log("Editing"); 82 | // console.log(data) 83 | $("#nameStudent").val(data['name']); 84 | $("#branchStudent").val(data['branch']); 85 | $("#enoStudent").val(data['eno']); 86 | $("#submitStudent").css("display","none"); 87 | $("#editStudent").css("display","block"); 88 | } 89 | }); 90 | 91 | }); 92 | 93 | $(".deleteStudent").on('click',function(){ 94 | // console.log("Delete Request"); 95 | var formdata = new FormData($("#addStudent")[0]); 96 | var sid = this.id.substr(8,9); 97 | $.ajaxSetup({ 98 | headers: { "X-CSRFToken": getCookie('csrftoken') } 99 | }); 100 | $.ajax({ 101 | url: 'delete/'+sid, 102 | type: 'DELETE', 103 | processData: false, 104 | cache: false, 105 | contentType: false, 106 | data:formdata, 107 | success: function(data){ 108 | // console.log("Deleted"); 109 | window.location.href="http://localhost:8000/index"; 110 | } 111 | }); 112 | }); 113 | }); -------------------------------------------------------------------------------- /templates/base.html: -------------------------------------------------------------------------------- 1 | {% load static %} 2 | 3 | 4 | 5 | 6 | CRUD App Django 7 | 8 | 9 | 10 |

Students:

11 | 12 |

Registration Form:

13 | {% block form %} 14 | {% endblock %} 15 | 16 |

List of Students:

17 | {% block entries %} 18 | {% endblock %} 19 | 20 | 21 | 22 | {% block edit %} 23 | {% endblock %} -------------------------------------------------------------------------------- /templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block form %} 4 |
5 | {% csrf_token %} 6 | {{ form.as_p }} 7 | 8 | 9 |
10 | {% endblock %} 11 | {% block entries %} 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | {% for entry in studentdata %} 20 | 21 | 22 | 23 | 24 | 28 | 29 | {% endfor %} 30 |
Eno.NameBranchAction
{{ entry.eno }}{{ entry.name }}{{ entry.branch }} 25 | 26 | 27 |
31 | {% endblock %} -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/djangorestframework-3.11.0.dist-info/INSTALLER: -------------------------------------------------------------------------------- 1 | pip 2 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/djangorestframework-3.11.0.dist-info/LICENSE.md: -------------------------------------------------------------------------------- 1 | # License 2 | 3 | Copyright © 2011-present, [Encode OSS Ltd](https://www.encode.io/). 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/djangorestframework-3.11.0.dist-info/WHEEL: -------------------------------------------------------------------------------- 1 | Wheel-Version: 1.0 2 | Generator: bdist_wheel (0.33.6) 3 | Root-Is-Purelib: true 4 | Tag: py3-none-any 5 | 6 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/djangorestframework-3.11.0.dist-info/top_level.txt: -------------------------------------------------------------------------------- 1 | rest_framework 2 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | ______ _____ _____ _____ __ 3 | | ___ \ ___/ ___|_ _| / _| | | 4 | | |_/ / |__ \ `--. | | | |_ _ __ __ _ _ __ ___ _____ _____ _ __| |__ 5 | | /| __| `--. \ | | | _| '__/ _` | '_ ` _ \ / _ \ \ /\ / / _ \| '__| |/ / 6 | | |\ \| |___/\__/ / | | | | | | | (_| | | | | | | __/\ V V / (_) | | | < 7 | \_| \_\____/\____/ \_/ |_| |_| \__,_|_| |_| |_|\___| \_/\_/ \___/|_| |_|\_| 8 | """ 9 | 10 | __title__ = 'Django REST framework' 11 | __version__ = '3.11.0' 12 | __author__ = 'Tom Christie' 13 | __license__ = 'BSD 3-Clause' 14 | __copyright__ = 'Copyright 2011-2019 Encode OSS Ltd' 15 | 16 | # Version synonym 17 | VERSION = __version__ 18 | 19 | # Header encoding (see RFC5987) 20 | HTTP_HEADER_ENCODING = 'iso-8859-1' 21 | 22 | # Default datetime input and output formats 23 | ISO_8601 = 'iso-8601' 24 | 25 | default_app_config = 'rest_framework.apps.RestFrameworkConfig' 26 | 27 | 28 | class RemovedInDRF312Warning(DeprecationWarning): 29 | pass 30 | 31 | 32 | class RemovedInDRF313Warning(PendingDeprecationWarning): 33 | pass 34 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class RestFrameworkConfig(AppConfig): 5 | name = 'rest_framework' 6 | verbose_name = "Django REST framework" 7 | 8 | def ready(self): 9 | # Add System checks 10 | from .checks import pagination_system_check # NOQA 11 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/authtoken/__init__.py: -------------------------------------------------------------------------------- 1 | default_app_config = 'rest_framework.authtoken.apps.AuthTokenConfig' 2 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/authtoken/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from rest_framework.authtoken.models import Token 4 | 5 | 6 | class TokenAdmin(admin.ModelAdmin): 7 | list_display = ('key', 'user', 'created') 8 | fields = ('user',) 9 | ordering = ('-created',) 10 | 11 | 12 | admin.site.register(Token, TokenAdmin) 13 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/authtoken/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | from django.utils.translation import gettext_lazy as _ 3 | 4 | 5 | class AuthTokenConfig(AppConfig): 6 | name = 'rest_framework.authtoken' 7 | verbose_name = _("Auth Token") 8 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/authtoken/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/authtoken/management/__init__.py -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/authtoken/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/authtoken/management/commands/__init__.py -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/authtoken/management/commands/drf_create_token.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth import get_user_model 2 | from django.core.management.base import BaseCommand, CommandError 3 | 4 | from rest_framework.authtoken.models import Token 5 | 6 | UserModel = get_user_model() 7 | 8 | 9 | class Command(BaseCommand): 10 | help = 'Create DRF Token for a given user' 11 | 12 | def create_user_token(self, username, reset_token): 13 | user = UserModel._default_manager.get_by_natural_key(username) 14 | 15 | if reset_token: 16 | Token.objects.filter(user=user).delete() 17 | 18 | token = Token.objects.get_or_create(user=user) 19 | return token[0] 20 | 21 | def add_arguments(self, parser): 22 | parser.add_argument('username', type=str) 23 | 24 | parser.add_argument( 25 | '-r', 26 | '--reset', 27 | action='store_true', 28 | dest='reset_token', 29 | default=False, 30 | help='Reset existing User token and create a new one', 31 | ) 32 | 33 | def handle(self, *args, **options): 34 | username = options['username'] 35 | reset_token = options['reset_token'] 36 | 37 | try: 38 | token = self.create_user_token(username, reset_token) 39 | except UserModel.DoesNotExist: 40 | raise CommandError( 41 | 'Cannot create the Token: user {} does not exist'.format( 42 | username) 43 | ) 44 | self.stdout.write( 45 | 'Generated token {} for user {}'.format(token.key, username)) 46 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/authtoken/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | from django.conf import settings 2 | from django.db import migrations, models 3 | 4 | 5 | class Migration(migrations.Migration): 6 | 7 | dependencies = [ 8 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 9 | ] 10 | 11 | operations = [ 12 | migrations.CreateModel( 13 | name='Token', 14 | fields=[ 15 | ('key', models.CharField(primary_key=True, serialize=False, max_length=40)), 16 | ('created', models.DateTimeField(auto_now_add=True)), 17 | ('user', models.OneToOneField(to=settings.AUTH_USER_MODEL, related_name='auth_token', on_delete=models.CASCADE)), 18 | ], 19 | options={ 20 | }, 21 | bases=(models.Model,), 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/authtoken/migrations/0002_auto_20160226_1747.py: -------------------------------------------------------------------------------- 1 | from django.conf import settings 2 | from django.db import migrations, models 3 | 4 | 5 | class Migration(migrations.Migration): 6 | 7 | dependencies = [ 8 | ('authtoken', '0001_initial'), 9 | ] 10 | 11 | operations = [ 12 | migrations.AlterModelOptions( 13 | name='token', 14 | options={'verbose_name_plural': 'Tokens', 'verbose_name': 'Token'}, 15 | ), 16 | migrations.AlterField( 17 | model_name='token', 18 | name='created', 19 | field=models.DateTimeField(verbose_name='Created', auto_now_add=True), 20 | ), 21 | migrations.AlterField( 22 | model_name='token', 23 | name='key', 24 | field=models.CharField(verbose_name='Key', max_length=40, primary_key=True, serialize=False), 25 | ), 26 | migrations.AlterField( 27 | model_name='token', 28 | name='user', 29 | field=models.OneToOneField(to=settings.AUTH_USER_MODEL, verbose_name='User', related_name='auth_token', on_delete=models.CASCADE), 30 | ), 31 | ] 32 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/authtoken/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/authtoken/migrations/__init__.py -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/authtoken/models.py: -------------------------------------------------------------------------------- 1 | import binascii 2 | import os 3 | 4 | from django.conf import settings 5 | from django.db import models 6 | from django.utils.translation import gettext_lazy as _ 7 | 8 | 9 | class Token(models.Model): 10 | """ 11 | The default authorization token model. 12 | """ 13 | key = models.CharField(_("Key"), max_length=40, primary_key=True) 14 | user = models.OneToOneField( 15 | settings.AUTH_USER_MODEL, related_name='auth_token', 16 | on_delete=models.CASCADE, verbose_name=_("User") 17 | ) 18 | created = models.DateTimeField(_("Created"), auto_now_add=True) 19 | 20 | class Meta: 21 | # Work around for a bug in Django: 22 | # https://code.djangoproject.com/ticket/19422 23 | # 24 | # Also see corresponding ticket: 25 | # https://github.com/encode/django-rest-framework/issues/705 26 | abstract = 'rest_framework.authtoken' not in settings.INSTALLED_APPS 27 | verbose_name = _("Token") 28 | verbose_name_plural = _("Tokens") 29 | 30 | def save(self, *args, **kwargs): 31 | if not self.key: 32 | self.key = self.generate_key() 33 | return super().save(*args, **kwargs) 34 | 35 | def generate_key(self): 36 | return binascii.hexlify(os.urandom(20)).decode() 37 | 38 | def __str__(self): 39 | return self.key 40 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/authtoken/serializers.py: -------------------------------------------------------------------------------- 1 | from django.contrib.auth import authenticate 2 | from django.utils.translation import gettext_lazy as _ 3 | 4 | from rest_framework import serializers 5 | 6 | 7 | class AuthTokenSerializer(serializers.Serializer): 8 | username = serializers.CharField(label=_("Username")) 9 | password = serializers.CharField( 10 | label=_("Password"), 11 | style={'input_type': 'password'}, 12 | trim_whitespace=False 13 | ) 14 | 15 | def validate(self, attrs): 16 | username = attrs.get('username') 17 | password = attrs.get('password') 18 | 19 | if username and password: 20 | user = authenticate(request=self.context.get('request'), 21 | username=username, password=password) 22 | 23 | # The authenticate call simply returns None for is_active=False 24 | # users. (Assuming the default ModelBackend authentication 25 | # backend.) 26 | if not user: 27 | msg = _('Unable to log in with provided credentials.') 28 | raise serializers.ValidationError(msg, code='authorization') 29 | else: 30 | msg = _('Must include "username" and "password".') 31 | raise serializers.ValidationError(msg, code='authorization') 32 | 33 | attrs['user'] = user 34 | return attrs 35 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/authtoken/views.py: -------------------------------------------------------------------------------- 1 | from rest_framework import parsers, renderers 2 | from rest_framework.authtoken.models import Token 3 | from rest_framework.authtoken.serializers import AuthTokenSerializer 4 | from rest_framework.compat import coreapi, coreschema 5 | from rest_framework.response import Response 6 | from rest_framework.schemas import ManualSchema 7 | from rest_framework.views import APIView 8 | 9 | 10 | class ObtainAuthToken(APIView): 11 | throttle_classes = () 12 | permission_classes = () 13 | parser_classes = (parsers.FormParser, parsers.MultiPartParser, parsers.JSONParser,) 14 | renderer_classes = (renderers.JSONRenderer,) 15 | serializer_class = AuthTokenSerializer 16 | if coreapi is not None and coreschema is not None: 17 | schema = ManualSchema( 18 | fields=[ 19 | coreapi.Field( 20 | name="username", 21 | required=True, 22 | location='form', 23 | schema=coreschema.String( 24 | title="Username", 25 | description="Valid username for authentication", 26 | ), 27 | ), 28 | coreapi.Field( 29 | name="password", 30 | required=True, 31 | location='form', 32 | schema=coreschema.String( 33 | title="Password", 34 | description="Valid password for authentication", 35 | ), 36 | ), 37 | ], 38 | encoding="application/json", 39 | ) 40 | 41 | def post(self, request, *args, **kwargs): 42 | serializer = self.serializer_class(data=request.data, 43 | context={'request': request}) 44 | serializer.is_valid(raise_exception=True) 45 | user = serializer.validated_data['user'] 46 | token, created = Token.objects.get_or_create(user=user) 47 | return Response({'token': token.key}) 48 | 49 | 50 | obtain_auth_token = ObtainAuthToken.as_view() 51 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/checks.py: -------------------------------------------------------------------------------- 1 | from django.core.checks import Tags, Warning, register 2 | 3 | 4 | @register(Tags.compatibility) 5 | def pagination_system_check(app_configs, **kwargs): 6 | errors = [] 7 | # Use of default page size setting requires a default Paginator class 8 | from rest_framework.settings import api_settings 9 | if api_settings.PAGE_SIZE and not api_settings.DEFAULT_PAGINATION_CLASS: 10 | errors.append( 11 | Warning( 12 | "You have specified a default PAGE_SIZE pagination rest_framework setting," 13 | "without specifying also a DEFAULT_PAGINATION_CLASS.", 14 | hint="The default for DEFAULT_PAGINATION_CLASS is None. " 15 | "In previous versions this was PageNumberPagination. " 16 | "If you wish to define PAGE_SIZE globally whilst defining " 17 | "pagination_class on a per-view basis you may silence this check.", 18 | id="rest_framework.W001" 19 | ) 20 | ) 21 | return errors 22 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/documentation.py: -------------------------------------------------------------------------------- 1 | from django.conf.urls import include, url 2 | 3 | from rest_framework.renderers import ( 4 | CoreJSONRenderer, DocumentationRenderer, SchemaJSRenderer 5 | ) 6 | from rest_framework.schemas import SchemaGenerator, get_schema_view 7 | from rest_framework.settings import api_settings 8 | 9 | 10 | def get_docs_view( 11 | title=None, description=None, schema_url=None, urlconf=None, 12 | public=True, patterns=None, generator_class=SchemaGenerator, 13 | authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES, 14 | permission_classes=api_settings.DEFAULT_PERMISSION_CLASSES, 15 | renderer_classes=None): 16 | 17 | if renderer_classes is None: 18 | renderer_classes = [DocumentationRenderer, CoreJSONRenderer] 19 | 20 | return get_schema_view( 21 | title=title, 22 | url=schema_url, 23 | urlconf=urlconf, 24 | description=description, 25 | renderer_classes=renderer_classes, 26 | public=public, 27 | patterns=patterns, 28 | generator_class=generator_class, 29 | authentication_classes=authentication_classes, 30 | permission_classes=permission_classes, 31 | ) 32 | 33 | 34 | def get_schemajs_view( 35 | title=None, description=None, schema_url=None, urlconf=None, 36 | public=True, patterns=None, generator_class=SchemaGenerator, 37 | authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES, 38 | permission_classes=api_settings.DEFAULT_PERMISSION_CLASSES): 39 | renderer_classes = [SchemaJSRenderer] 40 | 41 | return get_schema_view( 42 | title=title, 43 | url=schema_url, 44 | urlconf=urlconf, 45 | description=description, 46 | renderer_classes=renderer_classes, 47 | public=public, 48 | patterns=patterns, 49 | generator_class=generator_class, 50 | authentication_classes=authentication_classes, 51 | permission_classes=permission_classes, 52 | ) 53 | 54 | 55 | def include_docs_urls( 56 | title=None, description=None, schema_url=None, urlconf=None, 57 | public=True, patterns=None, generator_class=SchemaGenerator, 58 | authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES, 59 | permission_classes=api_settings.DEFAULT_PERMISSION_CLASSES, 60 | renderer_classes=None): 61 | docs_view = get_docs_view( 62 | title=title, 63 | description=description, 64 | schema_url=schema_url, 65 | urlconf=urlconf, 66 | public=public, 67 | patterns=patterns, 68 | generator_class=generator_class, 69 | authentication_classes=authentication_classes, 70 | renderer_classes=renderer_classes, 71 | permission_classes=permission_classes, 72 | ) 73 | schema_js_view = get_schemajs_view( 74 | title=title, 75 | description=description, 76 | schema_url=schema_url, 77 | urlconf=urlconf, 78 | public=public, 79 | patterns=patterns, 80 | generator_class=generator_class, 81 | authentication_classes=authentication_classes, 82 | permission_classes=permission_classes, 83 | ) 84 | urls = [ 85 | url(r'^$', docs_view, name='docs-index'), 86 | url(r'^schema.js$', schema_js_view, name='schema-js') 87 | ] 88 | return include((urls, 'api-docs'), namespace='api-docs') 89 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/ach/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/ach/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/ar/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/ar/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/be/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/be/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/ca/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/ca/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/ca_ES/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/ca_ES/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/cs/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/cs/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/da/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/da/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/de/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/de/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/el/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/el/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/el_GR/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/el_GR/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/en/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/en/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/en_AU/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/en_AU/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/en_CA/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/en_CA/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/en_US/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/en_US/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/es/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/es/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/et/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/et/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/fa/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/fa/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/fa_IR/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/fa_IR/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/fi/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/fi/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/fr/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/fr/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/fr_CA/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/fr_CA/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/gl/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/gl/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/gl_ES/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/gl_ES/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/he_IL/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/he_IL/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/hu/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/hu/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/id/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/id/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/it/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/it/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/ja/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/ja/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/ko_KR/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/ko_KR/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/lv/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/lv/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/mk/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/mk/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/nb/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/nb/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/nl/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/nl/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/nn/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/nn/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/no/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/no/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/pl/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/pl/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/pt/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/pt/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/pt_BR/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/pt_BR/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/pt_PT/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/pt_PT/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/ro/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/ro/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/ru/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/ru/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/sk/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/sk/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/sl/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/sl/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/sv/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/sv/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/tr/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/tr/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/tr_TR/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/tr_TR/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/uk/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/uk/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/vi/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/vi/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/zh_CN/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/zh_CN/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/zh_Hans/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/zh_Hans/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/zh_Hant/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/zh_Hant/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/locale/zh_TW/LC_MESSAGES/django.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/locale/zh_TW/LC_MESSAGES/django.mo -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/management/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/management/__init__.py -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/management/commands/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/management/commands/__init__.py -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/management/commands/generateschema.py: -------------------------------------------------------------------------------- 1 | from django.core.management.base import BaseCommand 2 | from django.utils.module_loading import import_string 3 | 4 | from rest_framework import renderers 5 | from rest_framework.schemas import coreapi 6 | from rest_framework.schemas.openapi import SchemaGenerator 7 | 8 | OPENAPI_MODE = 'openapi' 9 | COREAPI_MODE = 'coreapi' 10 | 11 | 12 | class Command(BaseCommand): 13 | help = "Generates configured API schema for project." 14 | 15 | def get_mode(self): 16 | return COREAPI_MODE if coreapi.is_enabled() else OPENAPI_MODE 17 | 18 | def add_arguments(self, parser): 19 | parser.add_argument('--title', dest="title", default='', type=str) 20 | parser.add_argument('--url', dest="url", default=None, type=str) 21 | parser.add_argument('--description', dest="description", default=None, type=str) 22 | if self.get_mode() == COREAPI_MODE: 23 | parser.add_argument('--format', dest="format", choices=['openapi', 'openapi-json', 'corejson'], default='openapi', type=str) 24 | else: 25 | parser.add_argument('--format', dest="format", choices=['openapi', 'openapi-json'], default='openapi', type=str) 26 | parser.add_argument('--urlconf', dest="urlconf", default=None, type=str) 27 | parser.add_argument('--generator_class', dest="generator_class", default=None, type=str) 28 | 29 | def handle(self, *args, **options): 30 | if options['generator_class']: 31 | generator_class = import_string(options['generator_class']) 32 | else: 33 | generator_class = self.get_generator_class() 34 | generator = generator_class( 35 | url=options['url'], 36 | title=options['title'], 37 | description=options['description'], 38 | urlconf=options['urlconf'], 39 | ) 40 | schema = generator.get_schema(request=None, public=True) 41 | renderer = self.get_renderer(options['format']) 42 | output = renderer.render(schema, renderer_context={}) 43 | self.stdout.write(output.decode()) 44 | 45 | def get_renderer(self, format): 46 | if self.get_mode() == COREAPI_MODE: 47 | renderer_cls = { 48 | 'corejson': renderers.CoreJSONRenderer, 49 | 'openapi': renderers.CoreAPIOpenAPIRenderer, 50 | 'openapi-json': renderers.CoreAPIJSONOpenAPIRenderer, 51 | }[format] 52 | return renderer_cls() 53 | 54 | renderer_cls = { 55 | 'openapi': renderers.OpenAPIRenderer, 56 | 'openapi-json': renderers.JSONOpenAPIRenderer, 57 | }[format] 58 | return renderer_cls() 59 | 60 | def get_generator_class(self): 61 | if self.get_mode() == COREAPI_MODE: 62 | return coreapi.SchemaGenerator 63 | return SchemaGenerator 64 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/mixins.py: -------------------------------------------------------------------------------- 1 | """ 2 | Basic building blocks for generic class based views. 3 | 4 | We don't bind behaviour to http method handlers yet, 5 | which allows mixin classes to be composed in interesting ways. 6 | """ 7 | from rest_framework import status 8 | from rest_framework.response import Response 9 | from rest_framework.settings import api_settings 10 | 11 | 12 | class CreateModelMixin: 13 | """ 14 | Create a model instance. 15 | """ 16 | def create(self, request, *args, **kwargs): 17 | serializer = self.get_serializer(data=request.data) 18 | serializer.is_valid(raise_exception=True) 19 | self.perform_create(serializer) 20 | headers = self.get_success_headers(serializer.data) 21 | return Response(serializer.data, status=status.HTTP_201_CREATED, headers=headers) 22 | 23 | def perform_create(self, serializer): 24 | serializer.save() 25 | 26 | def get_success_headers(self, data): 27 | try: 28 | return {'Location': str(data[api_settings.URL_FIELD_NAME])} 29 | except (TypeError, KeyError): 30 | return {} 31 | 32 | 33 | class ListModelMixin: 34 | """ 35 | List a queryset. 36 | """ 37 | def list(self, request, *args, **kwargs): 38 | queryset = self.filter_queryset(self.get_queryset()) 39 | 40 | page = self.paginate_queryset(queryset) 41 | if page is not None: 42 | serializer = self.get_serializer(page, many=True) 43 | return self.get_paginated_response(serializer.data) 44 | 45 | serializer = self.get_serializer(queryset, many=True) 46 | return Response(serializer.data) 47 | 48 | 49 | class RetrieveModelMixin: 50 | """ 51 | Retrieve a model instance. 52 | """ 53 | def retrieve(self, request, *args, **kwargs): 54 | instance = self.get_object() 55 | serializer = self.get_serializer(instance) 56 | return Response(serializer.data) 57 | 58 | 59 | class UpdateModelMixin: 60 | """ 61 | Update a model instance. 62 | """ 63 | def update(self, request, *args, **kwargs): 64 | partial = kwargs.pop('partial', False) 65 | instance = self.get_object() 66 | serializer = self.get_serializer(instance, data=request.data, partial=partial) 67 | serializer.is_valid(raise_exception=True) 68 | self.perform_update(serializer) 69 | 70 | if getattr(instance, '_prefetched_objects_cache', None): 71 | # If 'prefetch_related' has been applied to a queryset, we need to 72 | # forcibly invalidate the prefetch cache on the instance. 73 | instance._prefetched_objects_cache = {} 74 | 75 | return Response(serializer.data) 76 | 77 | def perform_update(self, serializer): 78 | serializer.save() 79 | 80 | def partial_update(self, request, *args, **kwargs): 81 | kwargs['partial'] = True 82 | return self.update(request, *args, **kwargs) 83 | 84 | 85 | class DestroyModelMixin: 86 | """ 87 | Destroy a model instance. 88 | """ 89 | def destroy(self, request, *args, **kwargs): 90 | instance = self.get_object() 91 | self.perform_destroy(instance) 92 | return Response(status=status.HTTP_204_NO_CONTENT) 93 | 94 | def perform_destroy(self, instance): 95 | instance.delete() 96 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/negotiation.py: -------------------------------------------------------------------------------- 1 | """ 2 | Content negotiation deals with selecting an appropriate renderer given the 3 | incoming request. Typically this will be based on the request's Accept header. 4 | """ 5 | from django.http import Http404 6 | 7 | from rest_framework import HTTP_HEADER_ENCODING, exceptions 8 | from rest_framework.settings import api_settings 9 | from rest_framework.utils.mediatypes import ( 10 | _MediaType, media_type_matches, order_by_precedence 11 | ) 12 | 13 | 14 | class BaseContentNegotiation: 15 | def select_parser(self, request, parsers): 16 | raise NotImplementedError('.select_parser() must be implemented') 17 | 18 | def select_renderer(self, request, renderers, format_suffix=None): 19 | raise NotImplementedError('.select_renderer() must be implemented') 20 | 21 | 22 | class DefaultContentNegotiation(BaseContentNegotiation): 23 | settings = api_settings 24 | 25 | def select_parser(self, request, parsers): 26 | """ 27 | Given a list of parsers and a media type, return the appropriate 28 | parser to handle the incoming request. 29 | """ 30 | for parser in parsers: 31 | if media_type_matches(parser.media_type, request.content_type): 32 | return parser 33 | return None 34 | 35 | def select_renderer(self, request, renderers, format_suffix=None): 36 | """ 37 | Given a request and a list of renderers, return a two-tuple of: 38 | (renderer, media type). 39 | """ 40 | # Allow URL style format override. eg. "?format=json 41 | format_query_param = self.settings.URL_FORMAT_OVERRIDE 42 | format = format_suffix or request.query_params.get(format_query_param) 43 | 44 | if format: 45 | renderers = self.filter_renderers(renderers, format) 46 | 47 | accepts = self.get_accept_list(request) 48 | 49 | # Check the acceptable media types against each renderer, 50 | # attempting more specific media types first 51 | # NB. The inner loop here isn't as bad as it first looks :) 52 | # Worst case is we're looping over len(accept_list) * len(self.renderers) 53 | for media_type_set in order_by_precedence(accepts): 54 | for renderer in renderers: 55 | for media_type in media_type_set: 56 | if media_type_matches(renderer.media_type, media_type): 57 | # Return the most specific media type as accepted. 58 | media_type_wrapper = _MediaType(media_type) 59 | if ( 60 | _MediaType(renderer.media_type).precedence > 61 | media_type_wrapper.precedence 62 | ): 63 | # Eg client requests '*/*' 64 | # Accepted media type is 'application/json' 65 | full_media_type = ';'.join( 66 | (renderer.media_type,) + 67 | tuple('{}={}'.format( 68 | key, value.decode(HTTP_HEADER_ENCODING)) 69 | for key, value in media_type_wrapper.params.items())) 70 | return renderer, full_media_type 71 | else: 72 | # Eg client requests 'application/json; indent=8' 73 | # Accepted media type is 'application/json; indent=8' 74 | return renderer, media_type 75 | 76 | raise exceptions.NotAcceptable(available_renderers=renderers) 77 | 78 | def filter_renderers(self, renderers, format): 79 | """ 80 | If there is a '.json' style format suffix, filter the renderers 81 | so that we only negotiation against those that accept that format. 82 | """ 83 | renderers = [renderer for renderer in renderers 84 | if renderer.format == format] 85 | if not renderers: 86 | raise Http404 87 | return renderers 88 | 89 | def get_accept_list(self, request): 90 | """ 91 | Given the incoming request, return a tokenized list of media 92 | type strings. 93 | """ 94 | header = request.META.get('HTTP_ACCEPT', '*/*') 95 | return [token.strip() for token in header.split(',')] 96 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/response.py: -------------------------------------------------------------------------------- 1 | """ 2 | The Response class in REST framework is similar to HTTPResponse, except that 3 | it is initialized with unrendered data, instead of a pre-rendered string. 4 | 5 | The appropriate renderer is called during Django's template response rendering. 6 | """ 7 | from http.client import responses 8 | 9 | from django.template.response import SimpleTemplateResponse 10 | 11 | from rest_framework.serializers import Serializer 12 | 13 | 14 | class Response(SimpleTemplateResponse): 15 | """ 16 | An HttpResponse that allows its data to be rendered into 17 | arbitrary media types. 18 | """ 19 | 20 | def __init__(self, data=None, status=None, 21 | template_name=None, headers=None, 22 | exception=False, content_type=None): 23 | """ 24 | Alters the init arguments slightly. 25 | For example, drop 'template_name', and instead use 'data'. 26 | 27 | Setting 'renderer' and 'media_type' will typically be deferred, 28 | For example being set automatically by the `APIView`. 29 | """ 30 | super().__init__(None, status=status) 31 | 32 | if isinstance(data, Serializer): 33 | msg = ( 34 | 'You passed a Serializer instance as data, but ' 35 | 'probably meant to pass serialized `.data` or ' 36 | '`.error`. representation.' 37 | ) 38 | raise AssertionError(msg) 39 | 40 | self.data = data 41 | self.template_name = template_name 42 | self.exception = exception 43 | self.content_type = content_type 44 | 45 | if headers: 46 | for name, value in headers.items(): 47 | self[name] = value 48 | 49 | @property 50 | def rendered_content(self): 51 | renderer = getattr(self, 'accepted_renderer', None) 52 | accepted_media_type = getattr(self, 'accepted_media_type', None) 53 | context = getattr(self, 'renderer_context', None) 54 | 55 | assert renderer, ".accepted_renderer not set on Response" 56 | assert accepted_media_type, ".accepted_media_type not set on Response" 57 | assert context is not None, ".renderer_context not set on Response" 58 | context['response'] = self 59 | 60 | media_type = renderer.media_type 61 | charset = renderer.charset 62 | content_type = self.content_type 63 | 64 | if content_type is None and charset is not None: 65 | content_type = "{}; charset={}".format(media_type, charset) 66 | elif content_type is None: 67 | content_type = media_type 68 | self['Content-Type'] = content_type 69 | 70 | ret = renderer.render(self.data, accepted_media_type, context) 71 | if isinstance(ret, str): 72 | assert charset, ( 73 | 'renderer returned unicode, and did not specify ' 74 | 'a charset value.' 75 | ) 76 | return ret.encode(charset) 77 | 78 | if not ret: 79 | del self['Content-Type'] 80 | 81 | return ret 82 | 83 | @property 84 | def status_text(self): 85 | """ 86 | Returns reason text corresponding to our HTTP response status code. 87 | Provided for convenience. 88 | """ 89 | return responses.get(self.status_code, '') 90 | 91 | def __getstate__(self): 92 | """ 93 | Remove attributes from the response that shouldn't be cached. 94 | """ 95 | state = super().__getstate__() 96 | for key in ( 97 | 'accepted_renderer', 'renderer_context', 'resolver_match', 98 | 'client', 'request', 'json', 'wsgi_request' 99 | ): 100 | if key in state: 101 | del state[key] 102 | state['_closable_objects'] = [] 103 | return state 104 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/reverse.py: -------------------------------------------------------------------------------- 1 | """ 2 | Provide urlresolver functions that return fully qualified URLs or view names 3 | """ 4 | from django.urls import NoReverseMatch 5 | from django.urls import reverse as django_reverse 6 | from django.utils.functional import lazy 7 | 8 | from rest_framework.settings import api_settings 9 | from rest_framework.utils.urls import replace_query_param 10 | 11 | 12 | def preserve_builtin_query_params(url, request=None): 13 | """ 14 | Given an incoming request, and an outgoing URL representation, 15 | append the value of any built-in query parameters. 16 | """ 17 | if request is None: 18 | return url 19 | 20 | overrides = [ 21 | api_settings.URL_FORMAT_OVERRIDE, 22 | ] 23 | 24 | for param in overrides: 25 | if param and (param in request.GET): 26 | value = request.GET[param] 27 | url = replace_query_param(url, param, value) 28 | 29 | return url 30 | 31 | 32 | def reverse(viewname, args=None, kwargs=None, request=None, format=None, **extra): 33 | """ 34 | If versioning is being used then we pass any `reverse` calls through 35 | to the versioning scheme instance, so that the resulting URL 36 | can be modified if needed. 37 | """ 38 | scheme = getattr(request, 'versioning_scheme', None) 39 | if scheme is not None: 40 | try: 41 | url = scheme.reverse(viewname, args, kwargs, request, format, **extra) 42 | except NoReverseMatch: 43 | # In case the versioning scheme reversal fails, fallback to the 44 | # default implementation 45 | url = _reverse(viewname, args, kwargs, request, format, **extra) 46 | else: 47 | url = _reverse(viewname, args, kwargs, request, format, **extra) 48 | 49 | return preserve_builtin_query_params(url, request) 50 | 51 | 52 | def _reverse(viewname, args=None, kwargs=None, request=None, format=None, **extra): 53 | """ 54 | Same as `django.urls.reverse`, but optionally takes a request 55 | and returns a fully qualified URL, using the request to get the base URL. 56 | """ 57 | if format is not None: 58 | kwargs = kwargs or {} 59 | kwargs['format'] = format 60 | url = django_reverse(viewname, args=args, kwargs=kwargs, **extra) 61 | if request: 62 | return request.build_absolute_uri(url) 63 | return url 64 | 65 | 66 | reverse_lazy = lazy(reverse, str) 67 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/schemas/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | rest_framework.schemas 3 | 4 | schemas: 5 | __init__.py 6 | generators.py # Top-down schema generation 7 | inspectors.py # Per-endpoint view introspection 8 | utils.py # Shared helper functions 9 | views.py # Houses `SchemaView`, `APIView` subclass. 10 | 11 | We expose a minimal "public" API directly from `schemas`. This covers the 12 | basic use-cases: 13 | 14 | from rest_framework.schemas import ( 15 | AutoSchema, 16 | ManualSchema, 17 | get_schema_view, 18 | SchemaGenerator, 19 | ) 20 | 21 | Other access should target the submodules directly 22 | """ 23 | from rest_framework.settings import api_settings 24 | 25 | from . import coreapi, openapi 26 | from .coreapi import AutoSchema, ManualSchema, SchemaGenerator # noqa 27 | from .inspectors import DefaultSchema # noqa 28 | 29 | 30 | def get_schema_view( 31 | title=None, url=None, description=None, urlconf=None, renderer_classes=None, 32 | public=False, patterns=None, generator_class=None, 33 | authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES, 34 | permission_classes=api_settings.DEFAULT_PERMISSION_CLASSES, 35 | version=None): 36 | """ 37 | Return a schema view. 38 | """ 39 | if generator_class is None: 40 | if coreapi.is_enabled(): 41 | generator_class = coreapi.SchemaGenerator 42 | else: 43 | generator_class = openapi.SchemaGenerator 44 | 45 | generator = generator_class( 46 | title=title, url=url, description=description, 47 | urlconf=urlconf, patterns=patterns, version=version 48 | ) 49 | 50 | # Avoid import cycle on APIView 51 | from .views import SchemaView 52 | return SchemaView.as_view( 53 | renderer_classes=renderer_classes, 54 | schema_generator=generator, 55 | public=public, 56 | authentication_classes=authentication_classes, 57 | permission_classes=permission_classes, 58 | ) 59 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/schemas/inspectors.py: -------------------------------------------------------------------------------- 1 | """ 2 | inspectors.py # Per-endpoint view introspection 3 | 4 | See schemas.__init__.py for package overview. 5 | """ 6 | import re 7 | from weakref import WeakKeyDictionary 8 | 9 | from django.utils.encoding import smart_str 10 | 11 | from rest_framework.settings import api_settings 12 | from rest_framework.utils import formatting 13 | 14 | 15 | class ViewInspector: 16 | """ 17 | Descriptor class on APIView. 18 | 19 | Provide subclass for per-view schema generation 20 | """ 21 | 22 | # Used in _get_description_section() 23 | header_regex = re.compile('^[a-zA-Z][0-9A-Za-z_]*:') 24 | 25 | def __init__(self): 26 | self.instance_schemas = WeakKeyDictionary() 27 | 28 | def __get__(self, instance, owner): 29 | """ 30 | Enables `ViewInspector` as a Python _Descriptor_. 31 | 32 | This is how `view.schema` knows about `view`. 33 | 34 | `__get__` is called when the descriptor is accessed on the owner. 35 | (That will be when view.schema is called in our case.) 36 | 37 | `owner` is always the owner class. (An APIView, or subclass for us.) 38 | `instance` is the view instance or `None` if accessed from the class, 39 | rather than an instance. 40 | 41 | See: https://docs.python.org/3/howto/descriptor.html for info on 42 | descriptor usage. 43 | """ 44 | if instance in self.instance_schemas: 45 | return self.instance_schemas[instance] 46 | 47 | self.view = instance 48 | return self 49 | 50 | def __set__(self, instance, other): 51 | self.instance_schemas[instance] = other 52 | if other is not None: 53 | other.view = instance 54 | 55 | @property 56 | def view(self): 57 | """View property.""" 58 | assert self._view is not None, ( 59 | "Schema generation REQUIRES a view instance. (Hint: you accessed " 60 | "`schema` from the view class rather than an instance.)" 61 | ) 62 | return self._view 63 | 64 | @view.setter 65 | def view(self, value): 66 | self._view = value 67 | 68 | @view.deleter 69 | def view(self): 70 | self._view = None 71 | 72 | def get_description(self, path, method): 73 | """ 74 | Determine a path description. 75 | 76 | This will be based on the method docstring if one exists, 77 | or else the class docstring. 78 | """ 79 | view = self.view 80 | 81 | method_name = getattr(view, 'action', method.lower()) 82 | method_docstring = getattr(view, method_name, None).__doc__ 83 | if method_docstring: 84 | # An explicit docstring on the method or action. 85 | return self._get_description_section(view, method.lower(), formatting.dedent(smart_str(method_docstring))) 86 | else: 87 | return self._get_description_section(view, getattr(view, 'action', method.lower()), 88 | view.get_view_description()) 89 | 90 | def _get_description_section(self, view, header, description): 91 | lines = [line for line in description.splitlines()] 92 | current_section = '' 93 | sections = {'': ''} 94 | 95 | for line in lines: 96 | if self.header_regex.match(line): 97 | current_section, separator, lead = line.partition(':') 98 | sections[current_section] = lead.strip() 99 | else: 100 | sections[current_section] += '\n' + line 101 | 102 | # TODO: SCHEMA_COERCE_METHOD_NAMES appears here and in `SchemaGenerator.get_keys` 103 | coerce_method_names = api_settings.SCHEMA_COERCE_METHOD_NAMES 104 | if header in sections: 105 | return sections[header].strip() 106 | if header in coerce_method_names: 107 | if coerce_method_names[header] in sections: 108 | return sections[coerce_method_names[header]].strip() 109 | return sections[''].strip() 110 | 111 | 112 | class DefaultSchema(ViewInspector): 113 | """Allows overriding AutoSchema using DEFAULT_SCHEMA_CLASS setting""" 114 | def __get__(self, instance, owner): 115 | result = super().__get__(instance, owner) 116 | if not isinstance(result, DefaultSchema): 117 | return result 118 | 119 | inspector_class = api_settings.DEFAULT_SCHEMA_CLASS 120 | assert issubclass(inspector_class, ViewInspector), ( 121 | "DEFAULT_SCHEMA_CLASS must be set to a ViewInspector (usually an AutoSchema) subclass" 122 | ) 123 | inspector = inspector_class() 124 | inspector.view = instance 125 | return inspector 126 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/schemas/utils.py: -------------------------------------------------------------------------------- 1 | """ 2 | utils.py # Shared helper functions 3 | 4 | See schemas.__init__.py for package overview. 5 | """ 6 | from django.db import models 7 | from django.utils.translation import gettext_lazy as _ 8 | 9 | from rest_framework.mixins import RetrieveModelMixin 10 | 11 | 12 | def is_list_view(path, method, view): 13 | """ 14 | Return True if the given path/method appears to represent a list view. 15 | """ 16 | if hasattr(view, 'action'): 17 | # Viewsets have an explicitly defined action, which we can inspect. 18 | return view.action == 'list' 19 | 20 | if method.lower() != 'get': 21 | return False 22 | if isinstance(view, RetrieveModelMixin): 23 | return False 24 | path_components = path.strip('/').split('/') 25 | if path_components and '{' in path_components[-1]: 26 | return False 27 | return True 28 | 29 | 30 | def get_pk_description(model, model_field): 31 | if isinstance(model_field, models.AutoField): 32 | value_type = _('unique integer value') 33 | elif isinstance(model_field, models.UUIDField): 34 | value_type = _('UUID string') 35 | else: 36 | value_type = _('unique value') 37 | 38 | return _('A {value_type} identifying this {name}.').format( 39 | value_type=value_type, 40 | name=model._meta.verbose_name, 41 | ) 42 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/schemas/views.py: -------------------------------------------------------------------------------- 1 | """ 2 | views.py # Houses `SchemaView`, `APIView` subclass. 3 | 4 | See schemas.__init__.py for package overview. 5 | """ 6 | from rest_framework import exceptions, renderers 7 | from rest_framework.response import Response 8 | from rest_framework.schemas import coreapi 9 | from rest_framework.settings import api_settings 10 | from rest_framework.views import APIView 11 | 12 | 13 | class SchemaView(APIView): 14 | _ignore_model_permissions = True 15 | schema = None # exclude from schema 16 | renderer_classes = None 17 | schema_generator = None 18 | public = False 19 | 20 | def __init__(self, *args, **kwargs): 21 | super().__init__(*args, **kwargs) 22 | if self.renderer_classes is None: 23 | if coreapi.is_enabled(): 24 | self.renderer_classes = [ 25 | renderers.CoreAPIOpenAPIRenderer, 26 | renderers.CoreJSONRenderer 27 | ] 28 | else: 29 | self.renderer_classes = [ 30 | renderers.OpenAPIRenderer, 31 | renderers.JSONOpenAPIRenderer, 32 | ] 33 | if renderers.BrowsableAPIRenderer in api_settings.DEFAULT_RENDERER_CLASSES: 34 | self.renderer_classes += [renderers.BrowsableAPIRenderer] 35 | 36 | def get(self, request, *args, **kwargs): 37 | schema = self.schema_generator.get_schema(request, self.public) 38 | if schema is None: 39 | raise exceptions.PermissionDenied() 40 | return Response(schema) 41 | 42 | def handle_exception(self, exc): 43 | # Schema renderers do not render exceptions, so re-perform content 44 | # negotiation with default renderers. 45 | self.renderer_classes = api_settings.DEFAULT_RENDERER_CLASSES 46 | neg = self.perform_content_negotiation(self.request, force=True) 47 | self.request.accepted_renderer, self.request.accepted_media_type = neg 48 | return super().handle_exception(exc) 49 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/css/bootstrap-tweaks.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This CSS file contains some tweaks specific to the included Bootstrap theme. 4 | It's separate from `style.css` so that it can be easily overridden by replacing 5 | a single block in the template. 6 | 7 | */ 8 | 9 | .form-actions { 10 | background: transparent; 11 | border-top-color: transparent; 12 | padding-top: 0; 13 | text-align: right; 14 | } 15 | 16 | #generic-content-form textarea { 17 | font-family:Consolas,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New, monospace; 18 | font-size: 80%; 19 | } 20 | 21 | .navbar-inverse .brand a { 22 | color: #999999; 23 | } 24 | .navbar-inverse .brand:hover a { 25 | color: white; 26 | text-decoration: none; 27 | } 28 | 29 | /* custom navigation styles */ 30 | .navbar { 31 | width: 100%; 32 | position: fixed; 33 | left: 0; 34 | top: 0; 35 | } 36 | 37 | .navbar { 38 | background: #2C2C2C; 39 | color: white; 40 | border: none; 41 | border-top: 5px solid #A30000; 42 | border-radius: 0px; 43 | } 44 | 45 | .navbar .nav li, .navbar .nav li a, .navbar .brand:hover { 46 | color: white; 47 | } 48 | 49 | .nav-list > .active > a, .nav-list > .active > a:hover { 50 | background: #2C2C2C; 51 | } 52 | 53 | .navbar .dropdown-menu li a, .navbar .dropdown-menu li { 54 | color: #A30000; 55 | } 56 | 57 | .navbar .dropdown-menu li a:hover { 58 | background: #EEEEEE; 59 | color: #C20000; 60 | } 61 | 62 | ul.breadcrumb { 63 | margin: 70px 0 0 0; 64 | } 65 | 66 | .breadcrumb li.active a { 67 | color: #777; 68 | } 69 | 70 | .pagination>.disabled>a, 71 | .pagination>.disabled>a:hover, 72 | .pagination>.disabled>a:focus { 73 | cursor: not-allowed; 74 | pointer-events: none; 75 | } 76 | 77 | .pager>.disabled>a, 78 | .pager>.disabled>a:hover, 79 | .pager>.disabled>a:focus { 80 | pointer-events: none; 81 | } 82 | 83 | .pager .next { 84 | margin-left: 10px; 85 | } 86 | 87 | /*=== dabapps bootstrap styles ====*/ 88 | 89 | html { 90 | width:100%; 91 | background: none; 92 | } 93 | 94 | /*body, .navbar .container-fluid { 95 | max-width: 1150px; 96 | margin: 0 auto; 97 | }*/ 98 | 99 | body { 100 | background: url("../img/grid.png") repeat-x; 101 | background-attachment: fixed; 102 | } 103 | 104 | #content { 105 | margin: 0; 106 | padding-bottom: 60px; 107 | } 108 | 109 | /* sticky footer and footer */ 110 | html, body { 111 | height: 100%; 112 | } 113 | 114 | .wrapper { 115 | position: relative; 116 | top: 0; 117 | left: 0; 118 | padding-top: 60px; 119 | margin: -60px 0; 120 | min-height: 100%; 121 | } 122 | 123 | .form-switcher { 124 | margin-bottom: 0; 125 | } 126 | 127 | .well { 128 | -webkit-box-shadow: none; 129 | -moz-box-shadow: none; 130 | box-shadow: none; 131 | } 132 | 133 | .well .form-actions { 134 | padding-bottom: 0; 135 | margin-bottom: 0; 136 | } 137 | 138 | .well form { 139 | margin-bottom: 0; 140 | } 141 | 142 | .nav-tabs { 143 | border: 0; 144 | } 145 | 146 | .nav-tabs > li { 147 | float: right; 148 | } 149 | 150 | .nav-tabs li a { 151 | margin-right: 0; 152 | } 153 | 154 | .nav-tabs > .active > a { 155 | background: #F5F5F5; 156 | } 157 | 158 | .nav-tabs > .active > a:hover { 159 | background: #F5F5F5; 160 | } 161 | 162 | .tabbable.first-tab-active .tab-content { 163 | border-top-right-radius: 0; 164 | } 165 | 166 | footer { 167 | position: absolute; 168 | bottom: 0; 169 | left: 0; 170 | clear: both; 171 | z-index: 10; 172 | height: 60px; 173 | width: 95%; 174 | margin: 0 2.5%; 175 | } 176 | 177 | footer p { 178 | text-align: center; 179 | color: gray; 180 | border-top: 1px solid #DDDDDD; 181 | padding-top: 10px; 182 | } 183 | 184 | footer a { 185 | color: gray !important; 186 | font-weight: bold; 187 | } 188 | 189 | footer a:hover { 190 | color: gray; 191 | } 192 | 193 | .page-header { 194 | border-bottom: none; 195 | padding-bottom: 0px; 196 | margin: 0; 197 | } 198 | 199 | /* custom general page styles */ 200 | .hero-unit h1, .hero-unit h2 { 201 | color: #A30000; 202 | } 203 | 204 | body a { 205 | color: #A30000; 206 | } 207 | 208 | body a:hover { 209 | color: #c20000; 210 | } 211 | 212 | .request-info { 213 | clear:both; 214 | } 215 | 216 | .horizontal-checkbox label { 217 | padding-top: 0; 218 | } 219 | 220 | .horizontal-checkbox label { 221 | padding-top: 0 !important; 222 | } 223 | 224 | .horizontal-checkbox input { 225 | float: left; 226 | width: 20px; 227 | margin-top: 3px; 228 | } 229 | 230 | .modal-footer form { 231 | margin-left: 5px; 232 | margin-right: 5px; 233 | } 234 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/css/default.css: -------------------------------------------------------------------------------- 1 | /* The navbar is fixed at >= 980px wide, so add padding to the body to prevent 2 | content running up underneath it. */ 3 | 4 | h1 { 5 | font-weight: 300; 6 | } 7 | 8 | h2, h3 { 9 | font-weight: 300; 10 | } 11 | 12 | .resource-description, .response-info { 13 | margin-bottom: 2em; 14 | } 15 | 16 | .version:before { 17 | content: "v"; 18 | opacity: 0.6; 19 | padding-right: 0.25em; 20 | } 21 | 22 | .version { 23 | font-size: 70%; 24 | } 25 | 26 | .format-option { 27 | font-family: Menlo, Consolas, "Andale Mono", "Lucida Console", monospace; 28 | } 29 | 30 | .button-form { 31 | float: right; 32 | margin-right: 1em; 33 | } 34 | 35 | td.nested { 36 | padding: 0 !important; 37 | } 38 | 39 | td.nested > table { 40 | margin: 0; 41 | } 42 | 43 | form select, form input, form textarea { 44 | width: 90%; 45 | } 46 | 47 | form select[multiple] { 48 | height: 150px; 49 | } 50 | 51 | /* To allow tooltips to work on disabled elements */ 52 | .disabled-tooltip-shield { 53 | position: absolute; 54 | top: 0; 55 | right: 0; 56 | bottom: 0; 57 | left: 0; 58 | } 59 | 60 | .errorlist { 61 | margin-top: 0.5em; 62 | } 63 | 64 | pre { 65 | overflow: auto; 66 | word-wrap: normal; 67 | white-space: pre; 68 | font-size: 12px; 69 | } 70 | 71 | .page-header { 72 | border-bottom: none; 73 | padding-bottom: 0px; 74 | } 75 | 76 | #filtersModal form input[type=submit] { 77 | width: auto; 78 | } 79 | 80 | #filtersModal .modal-body h2 { 81 | margin-top: 0 82 | } 83 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/css/prettify.css: -------------------------------------------------------------------------------- 1 | .com { color: #93a1a1; } 2 | .lit { color: #195f91; } 3 | .pun, .opn, .clo { color: #93a1a1; } 4 | .fun { color: #dc322f; } 5 | .str, .atv { color: #D14; } 6 | .kwd, .prettyprint .tag { color: #1e347b; } 7 | .typ, .atn, .dec, .var { color: teal; } 8 | .pln { color: #48484c; } 9 | 10 | .prettyprint { 11 | padding: 8px; 12 | background-color: #f7f7f9; 13 | border: 1px solid #e1e1e8; 14 | } 15 | .prettyprint.linenums { 16 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 17 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 18 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 19 | } 20 | 21 | /* Specify class=linenums on a pre to get line numbering */ 22 | ol.linenums { 23 | margin: 0 0 0 33px; /* IE indents via margin-left */ 24 | } 25 | ol.linenums li { 26 | padding-left: 12px; 27 | color: #bebec5; 28 | line-height: 20px; 29 | text-shadow: 0 1px 0 #fff; 30 | } -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/docs/css/highlight.css: -------------------------------------------------------------------------------- 1 | /* 2 | This is the GitHub theme for highlight.js 3 | 4 | github.com style (c) Vasily Polovnyov 5 | 6 | */ 7 | 8 | .hljs { 9 | display: block; 10 | overflow-x: auto; 11 | padding: 0.5em; 12 | color: #333; 13 | -webkit-text-size-adjust: none; 14 | } 15 | 16 | .hljs-comment, 17 | .diff .hljs-header, 18 | .hljs-javadoc { 19 | color: #998; 20 | font-style: italic; 21 | } 22 | 23 | .hljs-keyword, 24 | .css .rule .hljs-keyword, 25 | .hljs-winutils, 26 | .nginx .hljs-title, 27 | .hljs-subst, 28 | .hljs-request, 29 | .hljs-status { 30 | color: #333; 31 | font-weight: bold; 32 | } 33 | 34 | .hljs-number, 35 | .hljs-hexcolor, 36 | .ruby .hljs-constant { 37 | color: #008080; 38 | } 39 | 40 | .hljs-string, 41 | .hljs-tag .hljs-value, 42 | .hljs-phpdoc, 43 | .hljs-dartdoc, 44 | .tex .hljs-formula { 45 | color: #d14; 46 | } 47 | 48 | .hljs-title, 49 | .hljs-id, 50 | .scss .hljs-preprocessor { 51 | color: #900; 52 | font-weight: bold; 53 | } 54 | 55 | .hljs-list .hljs-keyword, 56 | .hljs-subst { 57 | font-weight: normal; 58 | } 59 | 60 | .hljs-class .hljs-title, 61 | .hljs-type, 62 | .vhdl .hljs-literal, 63 | .tex .hljs-command { 64 | color: #458; 65 | font-weight: bold; 66 | } 67 | 68 | .hljs-tag, 69 | .hljs-tag .hljs-title, 70 | .hljs-rule .hljs-property, 71 | .django .hljs-tag .hljs-keyword { 72 | color: #000080; 73 | font-weight: normal; 74 | } 75 | 76 | .hljs-attribute, 77 | .hljs-variable, 78 | .lisp .hljs-body, 79 | .hljs-name { 80 | color: #008080; 81 | } 82 | 83 | .hljs-regexp { 84 | color: #009926; 85 | } 86 | 87 | .hljs-symbol, 88 | .ruby .hljs-symbol .hljs-string, 89 | .lisp .hljs-keyword, 90 | .clojure .hljs-keyword, 91 | .scheme .hljs-keyword, 92 | .tex .hljs-special, 93 | .hljs-prompt { 94 | color: #990073; 95 | } 96 | 97 | .hljs-built_in { 98 | color: #0086b3; 99 | } 100 | 101 | .hljs-preprocessor, 102 | .hljs-pragma, 103 | .hljs-pi, 104 | .hljs-doctype, 105 | .hljs-shebang, 106 | .hljs-cdata { 107 | color: #999; 108 | font-weight: bold; 109 | } 110 | 111 | .hljs-deletion { 112 | background: #fdd; 113 | } 114 | 115 | .hljs-addition { 116 | background: #dfd; 117 | } 118 | 119 | .diff .hljs-change { 120 | background: #0086b3; 121 | } 122 | 123 | .hljs-chunk { 124 | color: #aaa; 125 | } 126 | -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/docs/css/jquery.json-view.min.css: -------------------------------------------------------------------------------- 1 | .json-view{position:relative} 2 | .json-view .collapser{width:20px;height:18px;display:block;position:absolute;left:-1.7em;top:-.2em;z-index:5;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAD1JREFUeNpiYGBgOADE%2F3Hgw0DM4IRHgSsDFOzFInmMAQnY49ONzZRjDFiADT7dMLALiE8y4AGW6LoBAgwAuIkf%2F%2FB7O9sAAAAASUVORK5CYII%3D);background-repeat:no-repeat;background-position:center center;opacity:.5;cursor:pointer} 3 | .json-view .collapsed{-ms-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-khtml-transform:rotate(-90deg);-webkit-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)} 4 | .json-view .bl{display:block;padding-left:20px;margin-left:-20px;position:relative} 5 | .json-view{font-family:monospace} 6 | .json-view ul{list-style-type:none;padding-left:2em;border-left:1px dotted;margin:.3em} 7 | .json-view ul li{position:relative} 8 | .json-view .comments,.json-view .dots{display:none;-moz-user-select:none;-ms-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none} 9 | .json-view .comments{padding-left:.8em;font-style:italic;color:#888} 10 | .json-view .bool,.json-view .null,.json-view .num,.json-view .undef{font-weight:700;color:#1A01CC} 11 | .json-view .str{color:#800} -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/docs/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/docs/img/favicon.ico -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/docs/img/grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/akshatsoni64/DjangoCRUDwithMySQL/edbdc05d029f8b44ed180b40faa59c690bfed7d2/venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/docs/img/grid.png -------------------------------------------------------------------------------- /venv/lib/python3.7/site-packages/rest_framework/static/rest_framework/docs/js/jquery.json-view.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jquery.json-view - jQuery collapsible JSON plugin 3 | * @version v1.0.0 4 | * @link http://github.com/bazh/jquery.json-view 5 | * @license MIT 6 | */ 7 | !function(e){"use strict";var n=function(n){var a=e("",{"class":"collapser",on:{click:function(){var n=e(this);n.toggleClass("collapsed");var a=n.parent().children(".block"),p=a.children("ul");n.hasClass("collapsed")?(p.hide(),a.children(".dots, .comments").show()):(p.show(),a.children(".dots, .comments").hide())}}});return n&&a.addClass("collapsed"),a},a=function(a,p){var t=e.extend({},{nl2br:!0},p),r=function(e){return e.toString()?e.toString().replace(/&/g,"&").replace(/"/g,""").replace(//g,">"):""},s=function(n,a){return e("",{"class":a,html:r(n)})},l=function(a,p){switch(e.type(a)){case"object":p||(p=0);var c=e("",{"class":"block"}),d=Object.keys(a).length;if(!d)return c.append(s("{","b")).append(" ").append(s("}","b"));c.append(s("{","b"));var i=e("