Python Django-the Practical Guide |top| -

python manage.py makemigrations python manage.py migrate

# Create Post.objects.create(title="Hello", content="World") posts = Post.objects.all() post = Post.objects.get(id=1) Update post.title = "New Title" post.save() Delete post.delete() 6. Django Admin Interface Create a superuser:

class PostCreateView(CreateView): model = Post fields = ['title', 'content'] success_url = '/'

© ООО "ИБИК"
Использование материалов проекта разрешается только при указании ссылки на ресурс.