This is my very personal Django project where I want to put all of my ideas to make my life easier.
I'm always open to remarks and suggestions in order to progress in Python and Django !
Benbb96/benbb96-website is built on the following main stack:
Python – Languages
Django – Frameworks (Full Stack)
Redis – In-Memory Databases
Bootstrap – Front-End Frameworks
JavaScript – Languages
Pandas – Data Science Tools
Pillow – Image Processing and Management
GitHub Actions – Continuous Integration
Full tech stack here
To install and use my website, follow these steps:
git clone https://github.com/Benbb96/benbb96-website.git
cd benbb96
Create a file here which will store all secrets settings : secrets.json.
You can configure it like this :
{
"SECRET_KEY": "[YOUR SECRET_KEY]",
"GOOGLE_API_KEY": "[YOUR GOOGLE_API_KEY]",
"GOOGLE_ANALYTICS_KEY": "[YOUR GOOGLE_ANALYTICS_KEY]",
"EMAIL_HOST_USER": "[YOUR EMAIL_HOST_USER]",
"EMAIL_HOST_PASSWORD": "[YOUR EMAIL_HOST_PASSWORD]"
}
In development, uploaded images are stored locally (
FileSystemStorage/MEDIA_ROOT), so no extra configuration is needed.
Uploaded images (avatars, project/game pictures, reviews, tasks, kendamas…) are served from a
Google Cloud Storage bucket via django-storages.
The GCS backend is enabled only in production (config/settings/prod.py → STORAGES).
To enable it, add the service account credentials to secrets.json under GCS_CREDENTIALS
(the full JSON key downloaded from Google Cloud → IAM → Service Accounts, with at least the Storage Object Admin role on the bucket):
{
...
"GCS_CREDENTIALS": { ...service account JSON... }
}
The bucket name and options live in config/settings/prod.py
(GS_BUCKET_NAME, GS_LOCATION = 'media', GS_DEFAULT_ACL = 'publicRead'), next to the STORAGES
setting that enables the GCS backend. Bucket objects must be publicly readable (grant allUsers the
Storage Object Viewer role on the bucket).
Images are optimized on upload (resized to 1280 px max + WebP) by base.image_utils. Two
management commands help maintain the bucket:
optimize_existing_photos (batch resize/WebP of existing images) and clean_orphan_media
(remove files no longer referenced in the database — dry-run by default, --apply to delete).
Then, you should create a virtual environement, load the migration to build the database (db.sqlite3), create a superuser to be able to access the administration module, and finally run the server :
python -m venv venv
source venv/bin/activate
pip install -r requirements/dev.txt
python manage.py migrate
python manage.py createsuperuser
python manage.py collectstatic --noinput
python manage.py runserver
You can then create projects in 127.0.0.1:8000/admin/base/projet/ that will be displayed on the homepage.
If you want to contact me you can reach me at benbb96@gmail.com.
This project uses the following license: MIT License.