.
├── README.md
├── config
│ ├── asgi.py
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── manage.py
├── my_settings.py
├── requirements.txt
└── survey
├── admin.py
├── apps.py
├── forms.py
├── models.py
├── templates
│ ├── _base.html
│ ├── auth
│ │ ├── login.html
│ │ └── signup.html
│ ├── home.html
│ └── survey
│ ├── choices.html
│ ├── create.html
│ ├── detail.html
│ ├── edit.html
│ ├── list.html
│ ├── question.html
│ ├── search.html
│ ├── start.html
│ ├── submit.html
│ └── thanks.html
├── tests.py
├── urls.py
└── views
├── auth.py
├── home.py
└── survey.py
6 directories, 31 files
새로운 설문지 추가
기존 설문지 수정
관리자 페이지
설문지 목록 페이지
설문지 상세 페이지
사용자 페이지
Method | Description | Request URL |
---|---|---|
GET | 모든 설문지 리스트 | surveys |
GET | 특정 설문지 조회 | surveys/{survey_pk} |
POST | 설문지 생성 | surveys |
POST | 설문지 질문 생성 | surveys/{survey_pk}/question |
DELETE | 설문지 질문 삭제 | surveys/{survey_pk}/question/{question_pk}/delete |
POST | 설문지 항목 생성 | surveys/{survey_pk}/question/{question_pk}/choice |
GET | 특정 설문지 시작 | surveys/{survey_pk}/start |
POST | 특정 설문지 응답 제출 | surveys/{survey_pk}/sumbit/{sub_pk} |
POST | 설문지 수정 | surveys/{survey_pk}/edit |
DELETE | 설문지 삭제 | surveys/{survey_pk}/delete |
GET | 설문지 제목 검색 | surveys/search/?q={query} |
GET | 설문지 다운로드 | surveys/{survey_pk}/download |
% cd ~/Documents
% git clone https://github.com/tasddc1226/open-gallery-2022.git
% cd open-gallery-2022
% ls
# 예시 화면
README.md __pycache__ config manage.py my_settings.py requirements.txt survey venv
% python --version
# 예시화면
Python 3.8.10
% python -m venv venv
% source venv/bin/activate
% pip install --upgrade pip
% pip install -r requirements.txt
# my_settings.py
DATABASES = {
'default' : {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'open',
'USER': 'root',
'PASSWORD': 'mysecretpassword',
'HOST': 'localhost',
'PORT': '3306',
'OPTIONS': {'charset': 'utf8mb4'}
}
}
SECRET_KEY = 'thisismysecretkey'
DEBUG = True
% brew install mysql
% brew services start mysql
% mysqladmin -u root password 'mysecretpassword'
% mysql -u root -p
% mysecretpassword
mysql> create database open character set utf8mb4 collate utf8mb4_general_ci;
% python manage.py migrate
% python manage.py runserver