A repository to migrate the pyOpenSci Jekyll site to Django with Wagtail CMS.
Before setting up the project locally, make sure you have the following installed:
- First, install uv - Install uv
- Then make sure you have Python 3.12+ installed. You can install it using uv:
$ uv python install 3.12
- Node.js - Download from nodejs.org (for TailwindCSS)
# Install all dependencies and create virtual environment
uv sync
# Install Node.js packages for TailwindCSS
npm install
If you are running a development server locally and you have set things up previously, you may want to delete your existing
database and start from scratch. To do this, delete the db.sqlite3
file in the project root:
rm db.sqlite3
# Build TailwindCSS stylesheets
npm run build-prod
# Run migrations using uv
uv run python manage.py migrate
If you want to try out the Django Admin dashboard or Wagtail dashboard, create a superuser (admin) account which can be used for Django Admin and Wagtail:
# Create superuser (optional - for admin access)
uv run python manage.py createsuperuser
To see how blog and events pages look with content, generate dummy blog posts and events:
# Generate default test data (25 blog posts, 20 events)
uv run python manage.py create_dummy_posts
# Or specify custom amounts
uv run python manage.py create_dummy_posts --blog-posts=30 --events=25
# Delete any existing dummy data
uv run python manage.py create_dummy_posts --delete
This command creates:
- Blog posts distributed across multiple years (for testing the drop down, year filters)
- Events with both past and upcoming dates
- Random tags, authors, and excerpts
- All posts are automatically published and visible
# Start Django development server
uv run python manage.py runserver
- Homepage (Django): http://127.0.0.1:8000
- Blog Index: http://127.0.0.1:8000/blog/
- Events Index: http://127.0.0.1:8000/events/
- Wagtail Admin: http://127.0.0.1:8000/cms/
- Django Admin: http://127.0.0.1:8000/admin/
# Run all tests
uv run python manage.py test
# Run tests with verbose output (shows each test name)
uv run python manage.py test -v 2
# Run tests with coverage
uv run coverage run --source='.' manage.py test
uv run coverage report
# Generate HTML coverage report
uv run coverage html
Thanks goes to these wonderful people (emoji key):
Philip Narteh 💻 👀 |
This project follows the all-contributors specification. Contributions of any kind welcome!