ModelForm

    [pinterest clone (23)] profileapp create view

    views.py 1 createview 만들기 class ProfileCreateView(CreateView): model = Profile context_object_name = 'target_profile' form_class = ProfileCreationForm success_url = reverse_lazy('accountapp:hello_world') template_name = 'profileapp/create.html' 2 profileapp/templates/profileapp/createview 만들기 {% extends 'base.html'%} {% load bootstrap4 %} {% block content %} Profile Create {% csrf_token %} {% bo..

    [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..