Skip to content

Latest commit

 

History

735 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

benbb96

Deploy to PythonAnywhere GitHub repo size GitHub contributors issues GitHub stars GitHub forks Twitter Follow

This is my very personal Django project where I want to put all of my ideas to make my life easier.

Why is it public ?

I'm always open to remarks and suggestions in order to progress in Python and Django !

Tech Stack

Benbb96/benbb96-website is built on the following main stack:

Backend

Data & storage

Front-end (no build step, no front-end framework)

  • JavaScript JavaScript – Vanilla JS (fetch helper, no jQuery)
  • Home-grown CSS design system (custom properties, flexbox/grid, :has(), <dialog>) — no CSS framework
  • Tom Select – Enhanced select widgets (vanilla, no jQuery)
  • Chart.js – Charts (tracker, kendama)
  • FontAwesome 6 – Icons

Tooling

  • uv – Dependency & virtualenv management (pyproject.toml + uv.lock)
  • Ruff – Linter + formatter (lint & format)
  • pre-commit – Git hooks (ruff + hygiene)
  • djLint – Django template linter (uv run djlint . --lint)
  • GitHub Actions GitHub Actions – CI/CD (deploy to PythonAnywhere via uv)

Full tech stack here

Installing benbb96

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.

Media storage (Google Cloud Storage)

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.pySTORAGES).

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. The clean_orphan_media management command helps maintain the bucket: it removes files no longer referenced in the database (dry-run by default, --apply to delete).

Dependencies are managed with uv (single source of truth: pyproject.toml + uv.lock; Python version in .python-version). Install uv, then let it build the virtual environment (.venv), load the migrations to build the database (db.sqlite3), create a superuser to access the administration module, and finally run the server:

# install uv (once): https://docs.astral.sh/uv/getting-started/installation/
uv sync                       # creates .venv from uv.lock (prod + dev deps)
uv run manage.py migrate
uv run manage.py createsuperuser
uv run manage.py collectstatic --noinput
uv run manage.py runserver

uv sync installs the dev group too (django-debug-toolbar, coverage, ruff, pre-commit, pyright, djlint); add --no-dev for a production-only environment. uv run <cmd> runs a command inside the environment without activating it. To add or bump a dependency, edit pyproject.toml then run uv lock (and commit the updated uv.lock).

You can then create projects in 127.0.0.1:8000/admin/base/projet/ that will be displayed on the homepage.

Contact

If you want to contact me you can reach me at benbb96@gmail.com.

License

This project uses the following license: MIT License.

About

My personal Django application for all the things I need!

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Used by

Contributors

Languages