on_delete

    on_delete=SET_NULL 설정시 ERROR 발생

    from django.contrib.auth.models import User from django.db import models # Create your models here. class Article(models.Model): writer = models.ForeignKey(User, on_delete=models.SET_NULL, related_name='arrticle') title = models.CharField(max_length=200, null=True) image = models.ImageField(upload_to='article/', null=False) content = models.TextField(null=True) created_at = models.DateField(auto..

    [pinterest clone (22)] ModelForm

    Profileapp을 만들기 시작한다. Account와 Profile을 1:1 로 매칭. 1개의 account는 1개의 profile을 가진다. 구성: Profile Image Profile Nickname Profile Message Delete View는 만들지 않을것이고, Detail View도 profile을 따로 보여주는 페이지를 안만들거니까 구현하지 않는다. 1 python manage.py startapp profileapp 2 settings.py에 추가 INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.c..