Skip to content

Commit

Permalink
Merge pull request #8 from Likelion-at-SMWU-10th/feat/#1-social-login
Browse files Browse the repository at this point in the history
[feat] 카카오 로그인
  • Loading branch information
happine2s authored Jul 21, 2022
2 parents cb7a30e + b39d98a commit c750491
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 6 deletions.
39 changes: 39 additions & 0 deletions rememB/balanceapp/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated by Django 4.0.6 on 2022-07-18 12:06

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
('mainapp', '0002_user_delete_blog'),
]

operations = [
migrations.CreateModel(
name='Answer',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('answer_content', models.CharField(max_length=200)),
],
),
migrations.CreateModel(
name='Question',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('question_content', models.CharField(max_length=200)),
],
),
migrations.CreateModel(
name='Balance',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('answer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='balanceapp.answer')),
('question', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='balanceapp.question')),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.user')),
],
),
]
28 changes: 28 additions & 0 deletions rememB/letterapp/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by Django 4.0.6 on 2022-07-18 12:06

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

initial = True

dependencies = [
('mainapp', '0002_user_delete_blog'),
]

operations = [
migrations.CreateModel(
name='Letter',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('letter_content', models.CharField(max_length=300)),
('img_no', models.IntegerField()),
('created_at', models.DateTimeField(auto_now=True)),
('position_x', models.IntegerField()),
('position_y', models.IntegerField()),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.user')),
],
),
]
Empty file added rememB/letterapp/serializers.py
Empty file.
27 changes: 27 additions & 0 deletions rememB/mainapp/migrations/0002_user_delete_blog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 4.0.6 on 2022-07-18 12:06

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('mainapp', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('uuid', models.CharField(max_length=100)),
('name', models.CharField(max_length=100)),
('birthyear', models.CharField(max_length=100)),
('birthday', models.CharField(max_length=100)),
('email', models.CharField(max_length=100)),
],
),
migrations.DeleteModel(
name='Blog',
),
]
3 changes: 0 additions & 3 deletions rememB/mainapp/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from django.db import models
<<<<<<< HEAD
=======

class User(models.Model):
uuid = models.CharField(max_length=100)
Expand All @@ -9,4 +7,3 @@ class User(models.Model):
birthday = models.CharField(max_length=100)
email = models.CharField(max_length=100)

>>>>>>> develop
9 changes: 6 additions & 3 deletions rememB/rememB/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@
#provider
'allauth.socialaccount.providers.google',
'allauth.socialaccount.providers.naver',
'allauth.socialaccount.providers.kakao',

#restframework
'rest_famework',
'rest_framework',
]

MIDDLEWARE = [
Expand Down Expand Up @@ -143,5 +144,7 @@
'allauth.account.auth_backends.AuthenticationBackend'
)

SITE_ID=1
LOGIN_REDIRECT_URL='/'
SITE_ID = 1
LOGIN_REDIRECT_URL = '/' #로그인 후 리디렉션할 페이지
ACCOUNT_LOGOUT_REDIRECT_URL ='/' #로그아웃 후 리디렉션 할 페이지
ACCOUNT_LOGOUT_ON_GET = True #로그아웃 버튼 클릭 시 자동 로그아웃
2 changes: 2 additions & 0 deletions rememB/userapp/templates/userapp/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@
<a href="{% provider_login_url 'google' %}">구글 로그인</a>
<br>
<a href="{% provider_login_url 'naver' %}">네이버 로그인</a>
<br>
<a href="{% provider_login_url 'kakao' %}">카카오 로그인</a>

{% endif %}

0 comments on commit c750491

Please sign in to comment.