-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pyproject.toml and run black on backend folder
- Loading branch information
FPiety0521
authored and
FPiety0521
committed
Feb 3, 2020
1 parent
0e6736d
commit 3b62a83
Showing
20 changed files
with
275 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
[[source]] | ||
name = "pypi" | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
|
||
[dev-packages] | ||
|
||
[packages] | ||
amqp = "==2.5.2" | ||
backcall = "==0.1.0" | ||
billiard = "==3.6.2.0" | ||
brotlipy = "==0.7.0" | ||
celery = {extras = ["redis"],version = "==4.4.0"} | ||
certifi = "==2019.11.28" | ||
cffi = "==1.13.2" | ||
decorator = "==4.4.1" | ||
defusedxml = "==0.6.0" | ||
diff-match-patch = "==20181111" | ||
dj-database-url = "==0.5.0" | ||
django-import-export = "==2.0.1" | ||
django-js-reverse = "==0.9.1" | ||
django-log-request-id = "==1.4.1" | ||
django-model-utils = "==4.0.0" | ||
django-webpack-loader = "==0.6.0" | ||
django = "==2.2.9" | ||
et-xmlfile = "==1.0.1" | ||
gunicorn = "==20.0.4" | ||
ipython-genutils = "==0.2.0" | ||
ipython = "==7.12.0" | ||
jdcal = "==1.4.1" | ||
jedi = "==0.16.0" | ||
kombu = "==4.6.7" | ||
markuppy = "==1.14" | ||
odfpy = "==1.4.1" | ||
openpyxl = "==3.0.3" | ||
parso = "==0.6.0" | ||
pexpect = "==4.8.0" | ||
pickleshare = "==0.7.5" | ||
prompt-toolkit = "==3.0.3" | ||
psutil = "==5.6.7" | ||
psycopg2 = "==2.8.4" | ||
ptyprocess = "==0.6.0" | ||
pycparser = "==2.19" | ||
pygments = "==2.5.2" | ||
python-decouple = "==3.3" | ||
pytz = "==2019.3" | ||
pyyaml = "==5.3" | ||
redis = "==3.4.1" | ||
sentry-sdk = "==0.14.1" | ||
six = "==1.14.0" | ||
sqlparse = "==0.3.0" | ||
tablib = "==0.14.0" | ||
traitlets = "==4.3.3" | ||
urllib3 = "==1.25.8" | ||
vine = "==1.3.0" | ||
wcwidth = "==0.1.8" | ||
whitenoise = "==5.0.1" | ||
xlrd = "==1.2.0" | ||
xlwt = "==1.3.0" | ||
|
||
[requires] | ||
python_version = "3.8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,10 +5,9 @@ | |
|
||
|
||
class TestCaseUtils(TestCase): | ||
|
||
def setUp(self): | ||
self._user_password = '123456' | ||
self.user = mommy.prepare('users.User', email='[email protected]') | ||
self._user_password = "123456" | ||
self.user = mommy.prepare("users.User", email="[email protected]") | ||
self.user.set_password(self._user_password) | ||
self.user.save() | ||
|
||
|
@@ -53,14 +52,12 @@ def assertResponse404(self, response): | |
|
||
|
||
class TestGetRequiresAuthenticatedUser: | ||
|
||
def test_get_requires_authenticated_user(self): | ||
response = self.client.get(self.view_url) | ||
self.assertResponse403(response) | ||
|
||
|
||
class TestAuthGetRequestSuccess: | ||
|
||
def test_auth_get_success(self): | ||
response = self.auth_client.get(self.view_url) | ||
self.assertResponse200(response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
|
||
|
||
class ExampleappConfig(AppConfig): | ||
name = 'exampleapp' | ||
name = "exampleapp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,108 +17,94 @@ def base_dir_join(*args): | |
|
||
DEBUG = True | ||
|
||
ADMINS = ( | ||
('Admin', '[email protected]'), | ||
) | ||
ADMINS = (("Admin", "[email protected]"),) | ||
|
||
AUTH_USER_MODEL = 'users.User' | ||
AUTH_USER_MODEL = "users.User" | ||
|
||
ALLOWED_HOSTS = [] | ||
|
||
INSTALLED_APPS = [ | ||
'django.contrib.admin', | ||
'django.contrib.auth', | ||
'django.contrib.contenttypes', | ||
'django.contrib.sessions', | ||
'django.contrib.messages', | ||
'django.contrib.staticfiles', | ||
|
||
'django_js_reverse', | ||
'webpack_loader', | ||
'import_export', | ||
|
||
'common', | ||
'users', | ||
"django.contrib.admin", | ||
"django.contrib.auth", | ||
"django.contrib.contenttypes", | ||
"django.contrib.sessions", | ||
"django.contrib.messages", | ||
"django.contrib.staticfiles", | ||
"django_js_reverse", | ||
"webpack_loader", | ||
"import_export", | ||
"common", | ||
"users", | ||
] | ||
|
||
MIDDLEWARE = [ | ||
'django.middleware.security.SecurityMiddleware', | ||
'whitenoise.middleware.WhiteNoiseMiddleware', | ||
'django.contrib.sessions.middleware.SessionMiddleware', | ||
'django.middleware.common.CommonMiddleware', | ||
'django.middleware.csrf.CsrfViewMiddleware', | ||
'django.contrib.auth.middleware.AuthenticationMiddleware', | ||
'django.contrib.messages.middleware.MessageMiddleware', | ||
'django.middleware.clickjacking.XFrameOptionsMiddleware', | ||
"django.middleware.security.SecurityMiddleware", | ||
"whitenoise.middleware.WhiteNoiseMiddleware", | ||
"django.contrib.sessions.middleware.SessionMiddleware", | ||
"django.middleware.common.CommonMiddleware", | ||
"django.middleware.csrf.CsrfViewMiddleware", | ||
"django.contrib.auth.middleware.AuthenticationMiddleware", | ||
"django.contrib.messages.middleware.MessageMiddleware", | ||
"django.middleware.clickjacking.XFrameOptionsMiddleware", | ||
] | ||
|
||
ROOT_URLCONF = '{{project_name}}.urls' | ||
ROOT_URLCONF = "{{project_name}}.urls" | ||
|
||
TEMPLATES = [ | ||
{ | ||
'BACKEND': 'django.template.backends.django.DjangoTemplates', | ||
'DIRS': [base_dir_join('templates')], | ||
'APP_DIRS': True, | ||
'OPTIONS': { | ||
'context_processors': [ | ||
'django.template.context_processors.debug', | ||
'django.template.context_processors.request', | ||
'django.contrib.auth.context_processors.auth', | ||
'django.contrib.messages.context_processors.messages', | ||
'common.context_processors.sentry_dsn', | ||
'common.context_processors.commit_sha', | ||
"BACKEND": "django.template.backends.django.DjangoTemplates", | ||
"DIRS": [base_dir_join("templates")], | ||
"APP_DIRS": True, | ||
"OPTIONS": { | ||
"context_processors": [ | ||
"django.template.context_processors.debug", | ||
"django.template.context_processors.request", | ||
"django.contrib.auth.context_processors.auth", | ||
"django.contrib.messages.context_processors.messages", | ||
"common.context_processors.sentry_dsn", | ||
"common.context_processors.commit_sha", | ||
], | ||
}, | ||
}, | ||
] | ||
|
||
WSGI_APPLICATION = '{{project_name}}.wsgi.application' | ||
WSGI_APPLICATION = "{{project_name}}.wsgi.application" | ||
|
||
AUTH_PASSWORD_VALIDATORS = [ | ||
{ | ||
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', | ||
}, | ||
{ | ||
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', | ||
}, | ||
{ | ||
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', | ||
}, | ||
{ | ||
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', | ||
}, | ||
{"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",}, | ||
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",}, | ||
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",}, | ||
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",}, | ||
] | ||
|
||
LANGUAGE_CODE = 'en-us' | ||
LANGUAGE_CODE = "en-us" | ||
|
||
TIME_ZONE = 'UTC' | ||
TIME_ZONE = "UTC" | ||
|
||
USE_I18N = True | ||
|
||
USE_L10N = True | ||
|
||
USE_TZ = True | ||
|
||
STATICFILES_DIRS = ( | ||
base_dir_join('../frontend'), | ||
) | ||
STATICFILES_DIRS = (base_dir_join("../frontend"),) | ||
|
||
# Webpack | ||
WEBPACK_LOADER = { | ||
'DEFAULT': { | ||
'CACHE': False, # on DEBUG should be False | ||
'STATS_FILE': base_dir_join('../webpack-stats.json'), | ||
'POLL_INTERVAL': 0.1, | ||
'IGNORE': ['.+\.hot-update.js', '.+\.map'] | ||
"DEFAULT": { | ||
"CACHE": False, # on DEBUG should be False | ||
"STATS_FILE": base_dir_join("../webpack-stats.json"), | ||
"POLL_INTERVAL": 0.1, | ||
"IGNORE": [".+\.hot-update.js", ".+\.map"], | ||
} | ||
} | ||
|
||
# Celery | ||
CELERY_ACCEPT_CONTENT = ['json'] | ||
CELERY_TASK_SERIALIZER = 'json' | ||
CELERY_RESULT_SERIALIZER = 'json' | ||
CELERY_ACCEPT_CONTENT = ["json"] | ||
CELERY_TASK_SERIALIZER = "json" | ||
CELERY_RESULT_SERIALIZER = "json" | ||
CELERY_ACKS_LATE = True | ||
|
||
# Sentry | ||
SENTRY_DSN = config('SENTRY_DSN', default='') | ||
COMMIT_SHA = config('HEROKU_SLUG_COMMIT', default='') | ||
SENTRY_DSN = config("SENTRY_DSN", default="") | ||
COMMIT_SHA = config("HEROKU_SLUG_COMMIT", default="") |
Oops, something went wrong.