Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1d52620
rename branch to main
Faaab84 Jan 4, 2026
e68d8c8
envoi
Faaab84 Jan 10, 2026
d7e31da
envoi
Faaab84 Jan 10, 2026
52dc143
envoi
Faaab84 Jan 10, 2026
7b61387
envoi
Faaab84 Jan 11, 2026
130080c
envoi
Faaab84 Jan 16, 2026
0e1c336
envoi
Faaab84 Jan 16, 2026
3cd733d
envoi
Faaab84 Jan 16, 2026
1290247
envoi
Faaab84 Jan 16, 2026
cec6032
envoi
Faaab84 Jan 16, 2026
d501584
envoi sql
Faaab84 Jan 17, 2026
634f98c
modify yml
Faaab84 Jan 17, 2026
2684219
modify yml
Faaab84 Jan 17, 2026
27e18cf
modify yml
Faaab84 Jan 17, 2026
590e730
modify yml
Faaab84 Jan 17, 2026
09cc0ac
setting
Faaab84 Jan 17, 2026
defa7e7
setting
Faaab84 Jan 17, 2026
531cf4b
setting
Faaab84 Jan 17, 2026
4fb4008
setting
Faaab84 Jan 17, 2026
17c5b60
setting
Faaab84 Jan 17, 2026
e6f5743
setting
Faaab84 Jan 17, 2026
d97f8a8
setting reath the doc
Faaab84 Jan 17, 2026
d6eba71
setting reath the doc_2
Faaab84 Jan 17, 2026
7b5375c
setting reath the doc_2
Faaab84 Jan 17, 2026
20c3997
setting reath the doc_4
Faaab84 Jan 17, 2026
4a123dd
setting reath the doc_5
Faaab84 Jan 17, 2026
620ca77
setting reath the doc_5
Faaab84 Jan 17, 2026
99493ec
setting reath the doc_5
Faaab84 Jan 17, 2026
e34c2b0
clean_folder
Faaab84 Jan 17, 2026
3f9da7a
clean_folder
Faaab84 Jan 17, 2026
e3d6532
setting reath the doc_5
Faaab84 Jan 17, 2026
77d88c7
modification test oral
Faaab84 Jan 17, 2026
bc1ebf4
oral blanc
Faaab84 Jan 18, 2026
7e27599
envoi
Faaab84 Jan 18, 2026
cdbd642
envoi
Faaab84 Jan 18, 2026
97bd154
envoi
Faaab84 Jan 18, 2026
9d06a5d
envoi
Faaab84 Jan 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[flake8]
ignore = E501,E241,E111,E117,E402,F401,E303,E305,E722,E402

exclude =
.git,
__pycache__,
venv\,
.github\
.pytest_cache\
*.pyc,
.env\,
env\,
venv\,
.coverage,
templates\,
static\,

82 changes: 82 additions & 0 deletions .github/workflows/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: GitHub Actions Demo
run-name: ${{ github.actor }} CI for oc-lettings-site 🚀
on:
push:
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
DEBUG: "False"
ALLOWED_HOSTS: "127.0.0.1,localhost,0.0.0.0,oc-lettings-site-latest-05t2.onrender.com"
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Tests
run: |
pytest --cov --cov-fail-under=80

flake8:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Flake8
run: |
flake8 --count

build:
needs: [test, flake8]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.event_name == 'push'

steps:
- uses: actions/checkout@v4

- name: Log in to DockerHub
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin

- name: Build the Docker image
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
run: |
docker build . --file Dockerfile \
--build-arg SECRET_KEY="${SECRET_KEY}" \
--tag ${{ secrets.DOCKERHUB_USERNAME }}/oc-lettings-site:${{ github.sha }} \
--tag ${{ secrets.DOCKERHUB_USERNAME }}/oc-lettings-site:latest

- name: Push image to DockerHub
run: |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/oc-lettings-site:${{ github.sha }}
docker push ${{ secrets.DOCKERHUB_USERNAME }}/oc-lettings-site:latest

deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.event_name == 'push'

steps:
- name: Deploy to Render
env:
deploy_url: ${{ secrets.RENDER_DEPLOY_HOOK_URL }}
run: |
curl "$deploy_url"
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
**/__pycache__
*.pyc
venv
.coverage
venv/
.env
staticfiles/
reports/
.pytest_cache/
Dockerfile1
Dockerfile1
docker-compose.yml.old
compose.yml
22 changes: 22 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version, and other tools you might need
build:
os: ubuntu-24.04
tools:
python: "3.12"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally, but recommended,
# declare the Python requirements required to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: requirements.txt
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
ARG SECRET_KEY="temporary-insecure-key-for-local-build-only-do-not-use-in-production"
ENV SECRET_KEY=${SECRET_KEY}

COPY . .

RUN python manage.py makemigrations --noinput && \
python manage.py migrate --noinput

RUN python manage.py collectstatic --noinput

EXPOSE 8000

CMD ["gunicorn", "oc_lettings_site.wsgi:application", "--bind", "0.0.0.0:8000"]
25 changes: 25 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: "3.13"

services:
quality-check:
build: .
volumes:
- .:/app
working_dir: /app
entrypoint: ["/bin/sh", "-c"]
command: >
flake8 . --count --max-complexity=10 --max-line-length=88 --exclude=venv,migrations,__pycache__ &&
pytest --cov=. --cov-report=term-missing --cov-fail-under=80

web:
build: .
command: gunicorn oc_lettings_site.wsgi:application --bind 0.0.0.0:8000 --reload
ports:
- "8000:8000"
env_file:
- .env
volumes:
- .:/app
depends_on:
quality-check:
condition: service_completed_successfully
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/images/Pipeline_CICD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions docs/api_reference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Code Reference
=============

This section documents all classes, functions, and methods available in the OC Lettings Site application.

Lettings Application
--------------------

The lettings app manages rental properties and their addresses.

Models
~~~~~~

.. autoclass:: lettings.models.Address
:members:
:exclude-members: DoesNotExist, MultipleObjectsReturned, objects, id, pk, letting

.. autoclass:: lettings.models.Letting
:members:
:exclude-members: DoesNotExist, MultipleObjectsReturned, objects, id, pk, address_id

Views
~~~~~

.. automodule:: lettings.views
:members:

Profiles Application
--------------------

The profiles app manages user profiles with additional information.

Models
~~~~~~

.. autoclass:: profiles.models.Profile
:members:
:exclude-members: DoesNotExist, MultipleObjectsReturned, objects, id, pk, user_id

Views
~~~~~

.. automodule:: profiles.views
:members:

Main Site (oc_lettings_site)
---------

Views
~~~~~

.. automodule:: oc_lettings_site.views
:members:
Loading