Skip to content

Commit

Permalink
fix(flake8/build): fixed flake8 linting build problem in code
Browse files Browse the repository at this point in the history
  • Loading branch information
rex9840 committed Oct 23, 2024
1 parent e227bac commit 7856a5e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
37 changes: 24 additions & 13 deletions core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,12 @@
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = (
"django-insecure-6myuk3r00t60w08gf6!+j(r@s(=y%of)cj6v9^3qi-shk%88#+"
)
SECRET_KEY = os.getenv("DJANGO_SECRET_KEY")

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = os.getenv("DJANGO_DEBUG", "FALSE") == "TRUE"

ALLOWED_HOSTS = os.getenv("DJANGO_ALLOWED_HOSTS", "127.0.0.1,localhost").split(
","
)
ALLOWED_HOSTS = os.getenv("DJANGO_ALLOWED_HOSTS", "127.0.0.1").split(",")


# Application definition
Expand Down Expand Up @@ -134,16 +130,27 @@

AUTH_PASSWORD_VALIDATORS = [
{
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
"NAME": (
"django.contrib.auth.password_validation."
"UserAttributeSimilarityValidator"
),
},
{
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
"NAME": (
"django.contrib.auth.password_validation." "MinimumLengthValidator"
),
},
{
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
"NAME": (
"django.contrib.auth.password_validation."
"CommonPasswordValidator"
),
},
{
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
"NAME": (
"django.contrib.auth.password_validation."
"NumericPasswordValidator"
),
},
]

Expand Down Expand Up @@ -199,18 +206,22 @@
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
MEDIA_ROOT = os.path.join(BASE_DIR, "media")

# Sentry Integration. Refer doc for more details: https://docs.sentry.io/platforms/python/integrations/django/
# Sentry Integration. Refer doc for more details:
# https://docs.sentry.io/platforms/python/integrations/django/

SENTRY_DSN = os.environ.get("SENTRY_DSN", "")
if SENTRY_DSN:
sentry_sdk.init(
dsn=SENTRY_DSN,
integrations=[DjangoIntegration()],
# Set traces_sample_rate to 1.0 to capture 100% of transactions for tracing.
# Set traces_sample_rate to 1.0
# to capture 100% of transactions for tracing.
traces_sample_rate=os.get("SENTRY_TRACE_RATE", 1.0),
# User data (such as current user id, email address, username)
# will be attached to error events.
send_default_pii=os.environ.get("SENTRY_SEND_PII", False),
# Set profiles_sample_rate to 1.0 to profile 100% of sampled transactions.
# Set profiles_sample_rate
# to 1.0 to profile 100% of sampled transactions.
profiles_sample_rate=os.environ.get("SENTRY_PROFILE_RATE", 1.0),
)

Expand Down
3 changes: 2 additions & 1 deletion env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

# for django server
DJANGO_SECRET_KEY="qwrewe3r234234=-=-+234wwrerererer"
# for application
CACHE_HOST="redis://localhost:6379/0"
CELERY_BROKER_URL="redis://redis:6379/1"
Expand Down

0 comments on commit 7856a5e

Please sign in to comment.