Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
818b131
init: 후원사 django app 생성
golony6449 Feb 1, 2023
a99e206
ci: run `isort` when `pull_request` event triggered
pers0n4 Feb 2, 2023
e0cf830
Merge pull request #9 from golony6449/feature/register-app-sponsor
oleveloper Feb 3, 2023
8106e26
fix: 누락된 의존성 추가
golony6449 Feb 3, 2023
276540c
fix: 잘못된 summernote 설정 추가
golony6449 Feb 3, 2023
549a1d2
lint: 코드 포멧 수정
golony6449 Feb 3, 2023
af94930
Merge pull request #10 from pers0n4/ci/isort
golony6449 Feb 3, 2023
3e32827
lint: isort
golony6449 Feb 3, 2023
5d51435
Merge pull request #11 from golony6449/feature/register-app-sponsor
golony6449 Feb 3, 2023
d9fb543
docs: readme 작성
golony6449 Feb 3, 2023
5284de2
Merge pull request #12 from golony6449/document/readme
golony6449 Feb 5, 2023
19a6340
update: 환경별 ALLOW_HOSTS 지정
golony6449 Feb 5, 2023
ed351ba
update: 웹 트리거 추가
golony6449 Feb 5, 2023
c931ed4
Merge pull request #13 from golony6449/feature/add-allow-hosts
golony6449 Feb 5, 2023
60d1038
Feature: Add sponser viewset
oleveloper Feb 5, 2023
5f8a639
update: baseViewSet 변경
golony6449 Feb 6, 2023
a4a6bb9
update: 권한 관련 설정 추가
golony6449 Feb 6, 2023
8dcde8f
update: 허용 메서드 지정
golony6449 Feb 6, 2023
c01feb4
black
golony6449 Feb 6, 2023
e60e8a8
Merge pull request #14 from oleveloper/feature/sponsor
oleveloper Feb 8, 2023
69ece23
update: sponsor migrations 생성
golony6449 Feb 9, 2023
6871b4d
Merge branch 'devdev' into feature/sponsor
golony6449 Feb 9, 2023
6f80b0e
update: sponsor migrations 생성
golony6449 Feb 9, 2023
6c31ab3
update: sponsor migrations 생성
golony6449 Feb 9, 2023
b3f27c6
Merge pull request #15 from golony6449/feature/sponsor
golony6449 Feb 9, 2023
4ecc6e2
fix: migrations은 black 검증에서 제외
golony6449 Feb 9, 2023
4f70b59
Merge pull request #16 from golony6449/feature/sponsor
golony6449 Feb 9, 2023
3c71bf1
update README.md
darjeeling Feb 9, 2023
dbe8820
update: 모델 전체를 조회하는 경우의 불필요 필드 삭제
golony6449 Feb 11, 2023
f657854
Merge pull request #17 from darjeeling/update_readme
oleveloper Feb 11, 2023
32afbbe
Merge pull request #18 from golony6449/feature/sponsor
golony6449 Feb 11, 2023
1eb4d2c
Feature: Add SponsorLevelViewSet
oleveloper Feb 11, 2023
4ec93c5
Feature: Add feature to view remaining accounts
oleveloper Feb 11, 2023
4cca276
update: 후원사 모집에 필요한 필드 추가
golony6449 Feb 11, 2023
b0b3114
update: 후원사 모집에 불필요한 필드 비활성화
golony6449 Feb 11, 2023
6980d3c
lint
golony6449 Feb 11, 2023
4fc33f3
Fix: Apply staticmethod to get_remaining method
oleveloper Feb 12, 2023
0f9d63c
Fix: Apply typing
oleveloper Feb 12, 2023
e3461da
Style: Apply isort to viewsets
oleveloper Feb 12, 2023
058df8f
lint 수정 (black)
golony6449 Feb 12, 2023
52edb2b
Merge pull request #19 from oleveloper/feature/sponsor
golony6449 Feb 12, 2023
3fcef3a
Merge pull request #20 from golony6449/golony/feature/sponsor
golony6449 Feb 12, 2023
83d6713
init localtesting with `pytest-django`
darjeeling Feb 15, 2023
092955b
fix requirements-dev.txt install requirements.txt
darjeeling Feb 17, 2023
3a1e185
following github public gitignore for python
darjeeling Feb 17, 2023
69160a1
Merge pull request #23 from darjeeling/update_gitignore
oleveloper Feb 17, 2023
72c0160
Merge pull request #22 from darjeeling/add_testing_spondor_model
darjeeling Feb 17, 2023
29e0cb3
lint 수정 (black)
golony6449 Feb 22, 2023
bdb3ab6
Merge branch 'devdev' into feature/golony/add-dep
golony6449 Feb 22, 2023
7668889
.gitignore 수정
golony6449 Feb 22, 2023
591c87a
constance 관리대상에 SLACK_SECRET 추가
golony6449 Feb 22, 2023
64f6ba0
lint
golony6449 Feb 22, 2023
699374c
update: add-on 등록
golony6449 Feb 22, 2023
eb08c61
update: constance의 backend로 DB 지정
golony6449 Feb 22, 2023
4818b42
update: .gitignore 마지막 빈 줄 추가
golony6449 Feb 23, 2023
deb35d5
Merge remote-tracking branch 'upstream/devdev' into feature/register-…
golony6449 Feb 23, 2023
25dd14a
Merge pull request #25 from golony6449/feature/register-app-sponsor
golony6449 Feb 23, 2023
f4d14f0
lint
golony6449 Feb 24, 2023
4097c23
Merge branch 'devdev' into feature/golony/add-dep
golony6449 Feb 24, 2023
e5fdf73
Merge pull request #24 from golony6449/feature/golony/add-dep
golony6449 Feb 24, 2023
2ee8ceb
update: 구좌수 검증 추가
golony6449 Feb 24, 2023
5a571a8
lint
golony6449 Feb 24, 2023
3ffb90e
update: swagger (drf-spectacular) 추가
golony6449 Feb 24, 2023
45535b0
update: 활성화 된 settings 값을 사용하도록 수정
golony6449 Feb 24, 2023
0f503f5
isort
golony6449 Feb 24, 2023
716eef7
update: 각 기능의 Open 여부를 조회하는 status API 추가
golony6449 Feb 24, 2023
c3c8c81
lint: black
golony6449 Feb 24, 2023
136f577
Merge pull request #26 from golony6449/golony/feature/sponsor
golony6449 Feb 25, 2023
a948eac
Merge pull request #27 from golony6449/feature/golony/swagger
golony6449 Feb 25, 2023
965c87a
Merge branch 'devdev' into feature/golony/status
golony6449 Feb 25, 2023
a7ebab6
Merge pull request #28 from golony6449/feature/golony/status
golony6449 Feb 25, 2023
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 .github/workflows/deploy_on_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Deploy Django with zappa on DEV stage
on:
push:
branches: [devdev]
workflow_dispatch:

jobs:
build:
Expand All @@ -16,7 +17,7 @@ jobs:
- uses: actions/checkout@v2
- uses: psf/black@stable
with:
options: "--check --verbose"
options: "--check --verbose --exclude migrations"

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/deploy_on_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Deploy Django with zappa on PRODUCTION stage
on:
push:
branches: [main]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -14,7 +16,7 @@ jobs:
- uses: actions/checkout@v2
- uses: psf/black@stable
with:
options: "--check --verbose"
options: "--check --verbose --exclude migrations"

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand Down
33 changes: 31 additions & 2 deletions .github/workflows/pull-request-merge-precondition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Pull Request Merge Precondition
on:
pull_request:

permissions:
contents: read
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -11,7 +15,32 @@ jobs:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
persist-credentials: true # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo

- uses: psf/black@stable
with:
options: "--check --verbose"
options: "--check --verbose --exclude migrations"

- uses: isort/isort-action@master
with:
configuration: "--check-only --diff --profile black"
requirementsFiles: "requirements.txt"

- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install pytest-cov

- name: run pytest
run: |
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=pyconkr ./ | tee pytest-coverage.txt

#- name: Pytest coverage comment
# uses: MishaKav/pytest-coverage-comment@main
# with:
# pytest-coverage-path: ./pytest-coverage.txt
# junitxml-path: ./pytest.xml
162 changes: 160 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,160 @@
/.idea
/db.sqlite3
# Byte-compiled / optimized / DLL files
__pycache__/
*.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
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# 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/
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# pyconkr-api-v2

파이콘 한국 행사를 위한 API 서비스입니다. (2023 ~ )

## PR 이전에
* 컨벤션 유지를 위해 `black`과 `isort`를 적용하고 있습니다.

## 개발 환경
* mysql-client 설치
* mac
* brew install mysql-client
* pip install -r requirements.txt

## how to run localtesting ( sqlite3 based )
```
# to setup pytest and requirements
pip install -r requirements-dev.txt
# run test
pytest
```
10 changes: 10 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import pytest


# TODO
# https://djangostars.com/blog/django-pytest-testing/#header17
@pytest.fixture
def api_client():
from rest_framework.test import APIClient

return APIClient()
Empty file modified manage.py
100644 → 100755
Empty file.
6 changes: 6 additions & 0 deletions pyconkr/settings-dev.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import os

from pyconkr.settings import *

DEBUG = True

ALLOWED_HOSTS += [
"api-dev.pycon.kr",
]

# RDS
DATABASES = {
"default": {
Expand All @@ -16,6 +21,7 @@
}

# django-storages: S3
del MEDIA_ROOT
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
STATICFILES_STORAGE = "storages.backends.s3boto3.S3StaticStorage"
AWS_S3_ACCESS_KEY_ID = os.getenv("AWS_S3_ACCESS_KEY_ID")
Expand Down
21 changes: 21 additions & 0 deletions pyconkr/settings-localtest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import os

from pyconkr.settings import *

DEBUG = True

ALLOWED_HOSTS += [
"*",
]


# RDS
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}}

# django-storages: TODO fix to in memory?
del MEDIA_ROOT
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
STATICFILES_STORAGE = "storages.backends.s3boto3.S3StaticStorage"
AWS_S3_ACCESS_KEY_ID = os.getenv("AWS_S3_ACCESS_KEY_ID")
AWS_S3_SECRET_ACCESS_KEY = os.getenv("AWS_S3_SECRET_ACCESS_KEY")
AWS_STORAGE_BUCKET_NAME = "pyconkr-api-v2-static-dev"
6 changes: 6 additions & 0 deletions pyconkr/settings-prod.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import os

from pyconkr.settings import *

DEBUG = False

ALLOWED_HOSTS += [
"api.pycon.kr",
]

# RDS
DATABASES = {
"default": {
Expand All @@ -16,6 +21,7 @@
}

# django-storages: S3
del MEDIA_ROOT
DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"
STATICFILES_STORAGE = "storages.backends.s3boto3.S3StaticStorage"
AWS_S3_ACCESS_KEY_ID = os.getenv("AWS_S3_ACCESS_KEY_ID")
Expand Down
Loading