From a93aabc835da64dbbf74652c1cd42564f91e0a50 Mon Sep 17 00:00:00 2001 From: genieu99 Date: Thu, 13 Jul 2023 18:16:30 +0900 Subject: [PATCH] =?UTF-8?q?[Feat]=20=EC=B9=B4=EC=B9=B4=EC=98=A4=20?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EA=B5=AC=ED=98=84(#6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 241 bytes .../accounts/__pycache__/apps.cpython-310.pyc | Bin 0 -> 524 bytes prProject/accounts/urls.py | 5 + prProject/accounts/views.py | 46 +++- .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 244 bytes .../__pycache__/apps.cpython-310.pyc | Bin 0 -> 533 bytes prProject/prProject/.gitignore | 229 ++++++++++++++++++ prProject/prProject/settings.py | 23 +- 8 files changed, 300 insertions(+), 3 deletions(-) create mode 100644 prProject/accounts/__pycache__/__init__.cpython-310.pyc create mode 100644 prProject/accounts/__pycache__/apps.cpython-310.pyc create mode 100644 prProject/playlistApp/__pycache__/__init__.cpython-310.pyc create mode 100644 prProject/playlistApp/__pycache__/apps.cpython-310.pyc create mode 100644 prProject/prProject/.gitignore diff --git a/prProject/accounts/__pycache__/__init__.cpython-310.pyc b/prProject/accounts/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a779bc1fb9c0b96a39c0229e22e3b59ab7bbc2a8 GIT binary patch literal 241 zcmd1j<>g`kf=iX_Q$X}%5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;%ERAXh)MIJKx) zzp^wdGf&?oKe;qFHLs*t|6xn>!`77#+x9$c>3-O{@L@~q!`7`p(YA-JOCPrFdf3wQ zuyqkkdaJ_2mQJuLpeRsnA4m~M2TuujZ1HCj!lo!t`^eny14QP9V1Y14(V*{{N8E{q z4B9efJeJ8+PCjLPCzEFxCo-8qbt02jIr)(By-Z$~@T@B1+l&QO;65sndI8jTv$@@D z)lXT#!Yl68cUq<&oCSQqoX}j3W!kg`kf=iX_Q$X}%5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;%D$AXh)MIJKx) zzp^wdGf&?oKe;qFHLs*t|6xn>!`77#+x9$c>3-O{@L@~q!`7`p(YA-JOCPrFdf3wQ zuyqkkdaJ_2mQJuLpeRsnA4m~M2TiHjFp*l`CJHCJ9xdUt1mz8zHkhEd(DmaD=Oc8WrL!miC zr3$F1=~mA+$F{{ob0u@LLr11N^fY>@IUZ#;*AA^=Cknk2i`g_S`O6MCxLePs1wvfY zVT7bbLZBhCWn3oYIx_7gvQ62*jO>t@AVUV3jw-Pk3glEW_xlKue!*G5^>H+^T>aSV zM-FpCu8Vjgl9`x(iug_>&mvAlGKcC^B(GxnA>weeGpB%!6zGI8fkH@@x18xB^mf0cW*tT}eyJNl9*y b13W|iU$lry0HlTe#b^%Xr*J7)MpfkxMQ@}i literal 0 HcmV?d00001 diff --git a/prProject/prProject/.gitignore b/prProject/prProject/.gitignore new file mode 100644 index 0000000..6fa6719 --- /dev/null +++ b/prProject/prProject/.gitignore @@ -0,0 +1,229 @@ +### Kakao login ### +secrets.json + +# Created by https://www.toptal.com/developers/gitignore/api/macos,django,visualstudiocode +# Edit at https://www.toptal.com/developers/gitignore?templates=macos,django,visualstudiocode + +### Django ### +*.log +*.pot +*.pyc +__pycache__/ +local_settings.py +db.sqlite3 +db.sqlite3-journal +media + +# If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/ +# in your Git repository. Update and uncomment the following line accordingly. +# /staticfiles/ + +### Django.Python Stack ### +# Byte-compiled / optimized / DLL files +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo + +# Django stuff: + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# End of https://www.toptal.com/developers/gitignore/api/macos,django,visualstudiocode \ No newline at end of file diff --git a/prProject/prProject/settings.py b/prProject/prProject/settings.py index fae1149..4b0dea3 100644 --- a/prProject/prProject/settings.py +++ b/prProject/prProject/settings.py @@ -12,15 +12,23 @@ from pathlib import Path +import os +import json + # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent +# 카카오 로그인 +secret_file = os.path.join(BASE_DIR, "prProject/secrets.json") +secrets = None +with open(secret_file) as f: + secrets = json.loads(f.read()) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'django-insecure-5ldzoyxslwf9^l_-)2oi8rt-q31zil2p_$hcpwinx#j-1k75oc' +SECRET_KEY = secrets['SECRET_KEY'] # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True @@ -38,9 +46,20 @@ 'django.contrib.messages', 'django.contrib.staticfiles', 'accounts', - 'playlistApp' + 'playlistApp', + + # 카카오 로그인 + 'django.contrib.sites', + 'rest_framework', ] +# 카카오 로그인 +SOCIAL_OUTH_CONFIG = { + 'KAKAO_REST_API_KEY': secrets['KAKAO_REST_API_KEY'], + 'KAKAO_REDIRECT_URI': secrets['KAKAO_REDIRECT_URI'], + 'KAKAO_SECRET_KEY': secrets['KAKAO_SECRET_KEY'], +} + MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',