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(settings): enhance security and deployment settings #59

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

WilsonNet
Copy link
Collaborator

This PR introduces several changes to improve the security and
deployment settings of the application. The SECRET_KEY is now fetched
from environment variables, and the DEBUG setting is set to False by
default, but can be overridden by an environment variable.

Additionally, several security-related settings have been added, such as
SESSION_COOKIE_SECURE, CSRF_COOKIE_SECURE, SECURE_SSL_REDIRECT,
and SECURE_HSTS_SECONDS.

The README.md file has also been updated with instructions on how to
generate a DJANGO_SECRET_KEY and check if the application is ready for
deployment.


ENV_DEBUG = get_json_env_var("DEBUG", False)

if ENV_DEBUG is True or ENV_DEBUG == "True" or ENV_DEBUG == "true":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to create a isTruly function to reuse this logic when we need it.

Copy link
Collaborator

@lfjnascimento lfjnascimento left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

This commit introduces several changes to improve the security and
deployment settings of the application. The `SECRET_KEY` is now fetched
from environment variables, and the `DEBUG` setting is set to `False` by
default, but can be overridden by an environment variable.

Additionally, several security-related settings have been added, such as
`SESSION_COOKIE_SECURE`, `CSRF_COOKIE_SECURE`, `SECURE_SSL_REDIRECT`,
and `SECURE_HSTS_SECONDS`.

The README.md file has also been updated with instructions on how to
generate a `DJANGO_SECRET_KEY` and check if the application is ready for
deployment.
```
@WilsonNet WilsonNet merged commit 2c9bf67 into main Jul 29, 2024
4 checks passed
@WilsonNet WilsonNet linked an issue Jul 30, 2024 that may be closed by this pull request
@WilsonNet WilsonNet deleted the fix/debug-mode branch September 12, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

defaults: Disable debug mode
2 participants