Skip to content

refactoring django-app, dockerize, ci/cd pipeline with circleci and render

License

Notifications You must be signed in to change notification settings

NidalChateur/OC_P13_LETTINGS

Repository files navigation

Python Django Poetry Black Flake8 Pylint codecov Codacy Badge CircleCI Documentation Status Docker

CI/CD Pipeline : OC LETTINGS SITE

icon

1. Read the docs

Documentation

2. Install and run with poetry

0. Informations

  • Locally, no environment variable is required.

  • oc_letting_site.settings.local.py is active to avoid Sentry logs and environment variables.

1. Install dependencies

  • python -m pip install pip==23.3.2
  • pip install poetry==1.7.1
  • poetry install

2. Run

  • poetry run python manage.py migrate
  • poetry run python manage.py runserver

3. Run the app with Docker Compose

1. Installer Docker

2. Open shell and check Docker Compose version

  • docker compose version

3. Run

  • docker compose up

4. Stop and clean system

  • docker compose down

CircleCI : pipeline config

Informations

  • oc_letting_site.settings.local.py is active to avoid Sentry logs.

  • Set these environment variables on the project settings :

    1. RENDER_DEPLOY_HOOK_URL (acquired from Render Web Service)
    2. DOCKERHUB_USERNAME (acquired from Docker hub)
    3. DOCKERHUB_PASSWORD (acquired from Docker hub)

Render : web service config

Informations

  • oc_letting_site.settings.production.py is active !

  • Set these environment variables on the Web Service :

    1. SECRET_KEY (generated on Render Web Service),
    2. PYTHON_VERSION=3.10.11
    3. DJANGO_SETTINGS_MODULE=oc_lettings_site.settings.production
    4. DATABASE_URL (acquired from Render PostgreSQL)
    5. SENTRY_DSN (acquired from Sentry)
    6. ADMIN_PASSWORD (chosen on Render Web Service)