class Post(models.Model):
owner = models.OneToOneField(User, verbose_name='Владелец', related_name='post')
@login_required
dev personal_page(request):
if request.method == 'GET':
post = request.user.post
form = WorkForm() if post else PostCreateForm()
return render(request, 'personal_page.hmtl', {'form': form })
elif request.method == 'POST':
post = Post.objects.get_or_create(owner=request.user)
...