Skip to content

bristolhackspace/website-django-cms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bristol Hackspace Website CMS

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.

Prerequisites

To run this code locally it is assumed you have installed:

  • git
  • pyenv (to allow selection of virtual python environments)
  • pip

Running Locally

Clone the repo

git clone https://github.com/bristolhackspace/website-django-cms.git

cd website-django-cms

Set virtual environment

Ensure 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.2

Install a Python 3.11 version if one is not listed:

pyenv local 3.11.8
python --version

create 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 pip

Install the project

From the project root:

pip install -r requirements.txt

Configure CMS environment variables

# On macOS/Linux (bash/zsh)
export DJANGO_SECRET_KEY="mysupersecretkeyremainsjustthat"

# On Windows PowerShell
# $env:DJANGO_SECRET_KEY = "mysupersecretkeyremainsjustthat"

Run the development server

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 migrate

Then start the development server:

python manage.py runserver

With 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 createsuperuser

Follow the prompts to create an admin login.

Guides

CMS overview and adding a blog

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!)

About

CMS for Hackspace website delivered using Django Framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •