This is the repository for the headless CMS used for managing content in the Hackspace website. The CMS uses Django CMS with media uploads provided by the Pillow library.
See the guides for an overview and video tutorials.
To run this code locally it is assumed you have installed:
- git
- pyenv (to allow selection of virtual python environments)
- pip
git clone https://github.com/bristolhackspace/website-django-cms.git
cd website-django-cmsEnsure you are in the project root and create a virtual environment.
Select a Python 3.11 version, first check what versions are installed:
pyenv versions
system
3.10.13
* 3.11.8 (set by /Users/username/.pyenv/version)
3.12.2Install a Python 3.11 version if one is not listed:
pyenv local 3.11.8
python --versioncreate the virtual environment:
python -m venv .venv
# Activate it (macOS/Linux)
source .venv/bin/activate
# or on Windows PowerShell
# .venv\Scripts\Activate.ps1
# Update pip
pip install --upgrade pipFrom the project root:
pip install -r requirements.txt# On macOS/Linux (bash/zsh)
export DJANGO_SECRET_KEY="mysupersecretkeyremainsjustthat"
# On Windows PowerShell
# $env:DJANGO_SECRET_KEY = "mysupersecretkeyremainsjustthat"Ensure you are in the root of the project (the same folder as manage.py) and your virtual environment is activated.
First apply database migrations (Django CMS needs these on first run):
python manage.py migrateThen start the development server:
python manage.py runserverWith the server running, open a browser and navigate to:
http://127.0.0.1:8000/To access the Django CMS admin panel:
http://127.0.0.1:8000/admin/If this is the first time running the CMS, you may need to create a super user:
python manage.py createsuperuserFollow the prompts to create an admin login.
To see how to use the CMS to add a new blog article view the video Hackspace CMS Overview (Tip: watch at 1.5 speed!)