This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
SE8-Reader is a Django-based web scraper for downloading and managing comic content. It uses Celery for background task processing and provides a Django admin interface for content management.
# Install dependencies
pip install -r requirements.txt
# Run development server
python manage.py runserver
# Run migrations
python manage.py migrate
# Start Celery worker (required for background tasks)
celery -A SE8 worker --loglevel=info
# Start Celery beat scheduler (for periodic tasks)
celery -A SE8 beat --loglevel=info
# Run tests
python manage.py test
# Collect static files
python manage.py collectstatic --noinput
# Create superuser
python manage.py createsuperuser# Full stack with PostgreSQL and Redis
docker-compose up
# SQLite mode (simpler, for quick testing)
export USE_SQLITE=True && bash docker_image_rebuild.sh- SE8/ - Django project configuration (settings, celery, urls)
- apps/ - Single Django app containing all business logic
models.py- Data models: Book, Episode, Image, Tagtasks.py- Celery tasks for scraping and processingservices.py-ImageExtractorclass handles web scrapingadmin.py- Django admin configuration with custom actionstools.py- Image processing utilities (PDF conversion, image stitching)
find_bookstask crawls book listings from source sitefind_episodestask fetches episode list for each bookfind_imagestask downloads images for each episodeconvert_to_pdftask stitches images into PDF files
Key tasks in apps/tasks.py:
find_books()- Discover new books (runs daily at midnight)find_episodes(book_id)- Get episodes for a bookfind_images(episode_id)- Download episode imagesconvert_to_pdf(episode_id)- Generate PDF from imagesfix_images()- Repair missing images (runs daily at 1am)fix_pdf()- Generate missing PDFs (runs daily at 2am)
Environment variables (configured via .env):
USE_SQLITE- Use SQLite instead of PostgreSQLDB_*- PostgreSQL connection settingsREDIS_*- Redis connection settingsDEBUG- Enable Django debug mode
SQLite mode automatically switches Celery broker and cache to file-based backends.
- Async code uses
async_event_loop()context manager with Celery tasks ImageExtractoris a singleton for web scraping- Images stored as base64 in database TextField
- Tasks use
QueueOnceto prevent duplicate execution