This repository is a Software of Application with Python, Django, etc.
Using Django, djangorestframework,etc preferably.
Using SQLite3 preferably.
Using pipenv.
$ git clone https://github.com/DanielArturoAlejoAlvarez/django-rest-api.git
[NAME APP]
Follow the following steps and you're good to go! Important:
...
from django.db import models
class Language(models.Model):
name = models.CharField(max_length=100)
paradigm = models.CharField(max_length=128)
def __str__(self):
return self.name
...
...
from rest_framework import serializers
from .models import Language
class LanguageSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Language
fields = ('id','url','name','paradigm')
...
...
from django.shortcuts import render
from rest_framework import viewsets
from .models import Language
from .serializers import LanguageSerializer
class LanguageView(viewsets.ModelViewSet):
queryset = Language.objects.all()
serializer_class = LanguageSerializer
...
...
from django.urls import path,include
from . import views
from rest_framework import routers
router = routers.DefaultRouter()
router.register('languages', views.LanguageView)
urlpatterns = [
path('', include(router.urls))
]
...
Bug reports and pull requests are welcome on GitHub at https://github.com/DanielArturoAlejoAlvarez/django-rest-api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.