Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified BACK/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file modified BACK/__pycache__/settings.cpython-311.pyc
Binary file not shown.
Binary file modified BACK/__pycache__/urls.cpython-311.pyc
Binary file not shown.
Binary file modified BACK/__pycache__/wsgi.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file removed db.sqlite3
Binary file not shown.
Binary file modified joinFormapp/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file modified joinFormapp/__pycache__/admin.cpython-311.pyc
Binary file not shown.
Binary file modified joinFormapp/__pycache__/apps.cpython-311.pyc
Binary file not shown.
Binary file modified joinFormapp/__pycache__/forms.cpython-311.pyc
Binary file not shown.
Binary file modified joinFormapp/__pycache__/models.cpython-311.pyc
Binary file not shown.
Binary file modified joinFormapp/__pycache__/urls.cpython-311.pyc
Binary file not shown.
Binary file modified joinFormapp/__pycache__/views.cpython-311.pyc
Binary file not shown.
Binary file modified joinFormapp/migrations/__pycache__/0001_initial.cpython-311.pyc
Binary file not shown.
Binary file modified joinFormapp/migrations/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion joinFormapp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Applicant(models.Model):
phone_number = models.CharField(max_length=20)
introduction = models.TextField()
motivation = models.TextField()
activity_attachment = models.FileField(upload_to='activity_attachments/')
activity_attachment = models.FileField(upload_to='activity_attachments/', blank=True)
github_or_tistory = models.URLField(blank=True)

# 게시글의 제목을 name으로 설정
Expand Down
14 changes: 14 additions & 0 deletions joinFormapp/templates/joinFormapp/arready.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>

<h1>아직 조회 기간이 아닙니다.</h1>

</body>
</html>
25 changes: 13 additions & 12 deletions joinFormapp/views.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from django.shortcuts import render, redirect
from .forms import ApplicantForm
from .models import Applicant

from django.shortcuts import render, redirect
from .models import Applicant
from django.contrib import messages
from joinFormapp.models import Applicant
from pageapp.models import userList
from django.utils import timezone
from django.contrib import messages

def show_joinForm(request):
current_date = timezone.now().date()
# POST 요청일 때, 지원서 데이터를 저장합니다.
if request.method == 'POST':
# POST 요청일 때, 지원서 데이터를 저장합니다.
name = request.POST.get('name')
phone_number = request.POST.get('phone_number')
introduction = request.POST.get('introduction')
Expand All @@ -26,12 +25,14 @@ def show_joinForm(request):
github_or_tistory=github_or_tistory
)
applicant.save()


userList.objects.create(username=applicant.name, usernum=applicant.phone_number)
messages.success(request, '지원서가 성공적으로 제출되었습니다. 감사합니다!')

# 저장이 완료되면 어떤 페이지로 redirect할지 정의합니다.
return redirect('joinFormapp:show_joinForm')

else:
# GET 요청일 때, 지원서 입력 폼을 보여줍니다.
return render(request, 'joinFormapp/application_form.html')
if current_date.month != 1 or current_date.day != 12:
return render(request, 'joinFormapp/arready.html') # 조회 기간 아님
else:
# GET 요청일 때, 지원서 입력 폼을 보여줍니다.
return render(request, 'joinFormapp/application_form.html')
Binary file modified pageapp/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file modified pageapp/__pycache__/admin.cpython-311.pyc
Binary file not shown.
Binary file modified pageapp/__pycache__/apps.cpython-311.pyc
Binary file not shown.
Binary file modified pageapp/__pycache__/models.cpython-311.pyc
Binary file not shown.
Binary file modified pageapp/__pycache__/urls.cpython-311.pyc
Binary file not shown.
Binary file modified pageapp/__pycache__/views.cpython-311.pyc
Binary file not shown.
Binary file modified pageapp/migrations/__pycache__/0001_initial.cpython-311.pyc
Binary file not shown.
Binary file modified pageapp/migrations/__pycache__/__init__.cpython-311.pyc
Binary file not shown.