You need to install node js before create next js project
start your terminal/command prompt and run
npx create-next-app@latest
after, you need enter project name
next-new-pro
cdnext-new-pro
npm run dev
open in your browser
localhost:3000
You need to install node js before create next js project
start your terminal/command prompt and run
npx create-next-app@latest
after, you need enter project name
next-new-pro
cdnext-new-pro
npm run dev
open in your browser
localhost:3000
sudo apt update
sudo apt install python3 python3-pip
python3 --version
github
https://github.com/manas-anarov/crud_viewset
settings.py
INSTALLED_APPS = [
'post',
'rest_framework',
]
crud_view/urls.py
post/urls.py
from rest_framework.routers import DefaultRouter
from .views import PostViewSet
router = DefaultRouter()
router.register('post', PostViewSet)
urlpatterns = router.urls
post/models.py
post/views.py
from rest_framework import viewsets
from .models import Post
from .serializers import PostSerializer
class PostViewSet(viewsets.ModelViewSet):
queryset = Post.objects.all()
serializer_class = PostSerializer
post/serializers.py
from rest_framework import serializers
from rest_framework.serializers import (
ModelSerializer,
)
from .models import (Post,)
class PostSerializer(ModelSerializer):
class Meta:
model = Post
fields = [
'title',
'text',
]
post/admin.py
from django.contrib import admin
from .models import (Post,)
admin.site.register(Post)