https://github.com/memphis-tools/dummy_django_app_on_render
Dummy project for learning purposes. A dockerized Django blog application. Render will build the app, not run the Docker images.
https://github.com/memphis-tools/dummy_django_app_on_render
circle-ci django poetry poetry-python postgresql python3 render
Last synced: 4 months ago
JSON representation
Dummy project for learning purposes. A dockerized Django blog application. Render will build the app, not run the Docker images.
- Host: GitHub
- URL: https://github.com/memphis-tools/dummy_django_app_on_render
- Owner: memphis-tools
- License: mit
- Created: 2024-07-27T19:43:38.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-01-15T19:30:18.000Z (5 months ago)
- Last Synced: 2025-01-15T21:49:19.705Z (5 months ago)
- Topics: circle-ci, django, poetry, poetry-python, postgresql, python3, render
- Language: Python
- Homepage: https://dummy-django-app-on-render.onrender.com
- Size: 35.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README







[](https://coveralls.io/github/memphis-tools/dummy_django_app_on_render?branch=main)
[](https://dl.circleci.com/status-badge/redirect/gh/memphis-tools/dummy_django_app_on_render/tree/main)
# DUMMY APP FOR LEARNING PURPOSES
**This is dummy django blog application.**
In the cloud context, application is hosted on [Render](https://render.com/) as a Python app, so Docker, Gunicorn, Nginx are not used.
Locally you will run the application using Docker (with Gunicorn and Nginx).
The CI-CD chain consists in using [Circle-ci](https://circleci.com/).
A dummy Django application for learning purposes, to practise. Focus is set on the backend, do not pay attention to the frontend (HTML, CSS & Javascript).
Also more tests and logging will be added later on.
You can find this dummy blog app at https://dummy-django-app-on-render.onrender.com/
**Because of a free instances plan, Render will spin down with inactivity, which can delay requests by 50 seconds or more.**
## TECHNOLOGIES
---------------
Python 3.11 and laterSqlite3
Gunicorn
Nginx
Docker (docker-compose), DockerHub
Circle-CI
Coveralls
# HOW USE IT ?
git clone https://github.com/memphis-tools/dummy_django_app_on_render.gitcd dummy_django_app_on_render
poetry install
source $(poetry env info --path)/bin/activate
## EXECUTION PREQUISITES
For a local usage set an envrc file such like this:export SECRET_KEY="superSecretKey"
export ALLOWED_HOSTS="localhost,127.0.0.1"
export DEBUG=0
export TIME_ZONE="Europe/Paris"
export DOCKER_HUB_USER='yourDockerhubUsername'
export DOCKER_HUB_PASSWORD='yourDockerhubPassword'
export IS_TESTING=False
export AWS_ACCESS_KEY_ID="your_aws_access_key_id"
export AWS_SECRET_ACCESS_KEY="your_aws_secret_access_key"
export AWS_DEFAULT_REGION="your_aws_region"
export EMAIL_HOST="localhost"
export EMAIL_PORT=25
export EMAIL_USE_TLS=False
export EMAIL_HOST_USER="admin@django_app_on_render.dev"
export EMAIL_HOST_PASSWORD=""The Django settings.py will load the file (with load_dotenv).
## RUN IT
To avoid manual commands, use the dummy "docker-compose-deployment.sh".To build the images locally:
./docker-compose-deployment.sh build
To publish the built images on Dockerhub:
./docker-compose-deployment.sh publish
To run the local images and stop app:
./docker-compose-deployment.sh run_dev
./docker-compose-deployment.sh down_dev
To run the Dockerhub images and stop app:
./docker-compose-deployment.sh run_prod
./docker-compose-deployment.sh down_prod
Notice: the './docker-compose-deployment.sh cloud' command is only run by Render.
Once running locally, you can access the application at: http://localhost:5555/
## TO TEST IT
source .env
source .venv/bin/activate
coverage run -m pytest dummy_django_blog/
coverage report