Skip to content

Environnement local et de staging #67

Merged
arnaudfnr merged 18 commits intomainfrom
feat/staging-env
Mar 8, 2026
Merged

Environnement local et de staging #67
arnaudfnr merged 18 commits intomainfrom
feat/staging-env

Conversation

@OlivierCoen
Copy link
Collaborator

Cette PR comprend la mise en place d'un env de staging afin de déployer l'application sur l'espace Coolify de D4G (il faut un compte pour y accéder, demander à Ronon si besoin).

Afin de pouvoir tester localement le déploiement de l'app, un env local a aussi été mis en place.

@OlivierCoen OlivierCoen force-pushed the feat/staging-env branch 4 times, most recently from f38b762 to 2fea980 Compare March 3, 2026 10:28

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-ot7b#&pes@%&0b2w(e@b278k2x2n4y$1@t4(!@(c&zthr3k)n('
SECRET_KEY = "django-insecure-ot7b#&pes@%&0b2w(e@b278k2x2n4y$1@t4(!@(c&zthr3k)n("
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we really use this key at the moment, but a good practice would be to generate a new one and put it in a .env file.

Copy link
Collaborator Author

@OlivierCoen OlivierCoen Mar 3, 2026

Choose a reason for hiding this comment

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

Totally agree with you :) if it's ok for you, I'll leave it for another PR, as it's more linked to credential handling and exceeds the scope of the current PR

'django.contrib.staticfiles',
'rest_framework',
'rest_framework_simplejwt',
"django.contrib.admin",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it possible to change your IDE settings so that ' are not replaced by " please? :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry about that, I did not see it changed the quotes... I set it back to normal :)

RUN pip install --no-cache-dir -r requirements.txt

RUN python manage.py migrate && \
python manage.py createsuperuser --noinput --username john --email john.doe@example.com
Copy link
Collaborator

Choose a reason for hiding this comment

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

The superuser credentials should not be exposed like this and put in a .env file as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it was only for testing. I changed that in the current version (at least for the staging environment)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it was only for testing. I changed that in the current version (at least for the staging environment).
Concerning the stating env, he django superuser credentials are stored in Coolify (you need an account to see them / modify them) and I wrote them in the Mattermost conversation.
Concerning the dev env, they are hardcoded in docker/compose.dev.yaml because I think we don't need security here, and it's more portable for everyone. What do you think?

@OlivierCoen OlivierCoen force-pushed the feat/staging-env branch 3 times, most recently from 4747011 to 021b1dd Compare March 3, 2026 18:34
@arnaudfnr arnaudfnr merged commit 7f0d489 into main Mar 8, 2026
2 checks passed
@arnaudfnr arnaudfnr deleted the feat/staging-env branch March 8, 2026 15:02
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.

2 participants