Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

@윤영운 @김기백 @이채영 퍼퓸팀 4번 이슈 진행합니다. #11

Open
wants to merge 2 commits into
base: hackerton
Choose a base branch
from
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ http://52.79.152.220:8000/
2. $ python manage.py makemigrations
3. $ python manage.py migrates
```
issue관련해서 질문이 있는경우 바로 말씀해주세요!
- css설정 때문에 화면 창을 줄이면 레이아웃이 망가질 수 있습니다ㅠ 창 크기를 최대로 해서 사용해주세요
- issue관련해서 질문이 있는경우 바로 말씀해주세요!
2 changes: 1 addition & 1 deletion users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class User(AbstractUser):
username = None

name = models.CharField(default="name", max_length=64)
email = models.CharField(default="email", max_length=64)
email = models.CharField(default="email", max_length=64, unique=True)
password = models.CharField(default="password", max_length=64)
birth = models.CharField(default="birth", max_length=8)

Expand Down
7 changes: 5 additions & 2 deletions users/templates/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ <h6 id="sub">Leave perfume where you're staying</h6>
<div class="input-element">
<div>
<!--이름 입력창-->
<label style="color:#934BF1; font-weight:700;">EMAIL</label><br>
<label style="color:#934BF1; font-weight:700;">EMAIL</label>
<label style="color:#FF0000; font-weight:700;"> {{emailerror}}</label>
<br>
<input type="email" name="email" placeholder="이메일을 입력하세요. ex) 의현님짱@likelion.org" id="email" required>
</div>
<div>
Expand All @@ -32,7 +34,8 @@ <h6 id="sub">Leave perfume where you're staying</h6>
</div>
<div>
<!--PASSWORD입력창-->
<label style="color:#934BF1; font-weight:700;">PASSWORD</label><br>
<label style="color:#934BF1; font-weight:700;">PASSWORD</label>
<label style="color:#FF0000; font-weight:700;"> {{pwerror}}</label><br>
<input type="password" name="password" placeholder="비밀번호를 입력하세요." id="password" required>
</div>
<div>
Expand Down
22 changes: 13 additions & 9 deletions users/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.shortcuts import render, redirect
from django.shortcuts import get_object_or_404, render, redirect
from django.contrib.auth import authenticate, logout
from .models import User , Blog
from django.contrib import auth
Expand All @@ -18,15 +18,19 @@ def signup(request):
re_password = request.POST.get('re_password', False)
birth = request.POST.get('birth', False)
if password != re_password :
return render(request, 'signup.html' , {'error' : 'password incorrect!'})
return render(request, 'signup.html' , {'pwerror' : 'password incorrect!'})
else:
user = User.objects.create_user(email, password)
user.birth = birth
user.re_password = re_password
user.name = name
user.save()

return redirect('/')
try:
is_valid = User.objects.get(email=email)
except:
user = User.objects.create_user(email, password)
user.birth = birth
user.re_password = re_password
user.name = name
user.save()
return redirect('/')

return render(request, 'signup.html', {'emailerror':'중복된 아이디입니다'})

return render(request, 'signup.html')

Expand Down