Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] 카카오 로그인 #8

Merged
merged 1 commit into from
Jul 21, 2022
Merged
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
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 %}