Digital Magazine Archive is a generic, Django-based web application template for creating digital magazine archives. This platform transforms physical issues into a browsable, searchable digital library, allowing readers to explore magazine content from anywhere in the world. Each issue is catalogued and presented in a reader-friendly interface that leverages modern web technologies for accessibility and performance. This template can be customized for any magazine publication or digital archive project.
https://magazine-zone-bd.onrender.com
Browse the complete archive of magazine issues organized chronologically. Each issue entry displays a high-quality cover image, publication date, and title. Users can access issues marked as "Free" without any barriers, while premium issues require a one-time purchase through the integrated payment gateway. The PDF reader offers a clean, distraction-free reading experience with page navigation controls. Users can create accounts to track their purchased issues in a personal library, manage their profile, and reset passwords via email. The responsive design ensures seamless access across desktop, tablet, and mobile devices.
Administrators have full control over the archive through a modern, jazzmin-styled Django admin panel. The admin interface allows creating, editing, and deleting magazine issues with cover image uploads and PDF file management. Purchase records are tracked with detailed information including payment status, transaction IDs, timestamps, and user associations. The admin can manage user accounts, view purchase history, and monitor transaction statuses. The SSLCommerz payment integration provides automated handling of successful, failed, and cancelled payment callbacks with hash validation for security.
The platform features a highly secure, anti-piracy PDF reading experience built entirely in-house:
- High-DPI Rendering: Utilizes client-side Canvas rendering via
PDF.jswith 2.5x supersampling to ensure crisp and clear display of complex Bengali typography. - Byte-XOR Masking (Anti-Piracy): Protects premium content from automated downloaders (like IDM). The backend streams XOR-masked byte arrays which the JavaScript client securely fetches, reverses into an ArrayBuffer, and feeds directly into the PDF engine.
- Endpoint Sealing: API endpoints strictly reject direct browser access or unauthorized requests. Hits without the specific client headers return a
403 Forbidden, while anonymous attempts trigger a302 Redirectto the login portal. - Content Protection: The reader interface strictly disables context menus (right-click), text selection, and drag-and-drop functionalities to prevent casual content theft.
- Backend Framework: Django 5.2
- Admin Interface: Django Jazzmin
- Database: PostgreSQL (hosted on Supabase)
- Cloud Storage: Supabase S3-compatible storage (using a secure dual-bucket architecture for media files)
- Deployment: Render (provides automatic HTTPS and continuous deployment from GitHub)
- Frontend Styling: Tailwind CSS (custom dark red and black color scheme)
- Static Files Management: WhiteNoise (serves static files in production with gzip and brotli compression)
- Payment Integration: SSLCommerz (configured with sandbox mode for development and live mode for production)
A brief overview of the core directory structure:
apps/: Contains all Django applications (e.g., magazines, users, payments).core/: The main Django project configuration directory (settings, urls, wsgi).theme/: Tailwind CSS configuration and compiled assets.templates/: Global HTML templates and base layouts.static/: Static files (images, JS, raw CSS) served by WhiteNoise.screenshots/: Images used for this documentation.build.sh: Deployment script for Render.
The storage architecture employs a secure dual-bucket system on Supabase S3. Cover images reside in a public bucket with unrestricted read access, allowing browsers to cache and serve them efficiently without authentication overhead. PDF files are stored in a private bucket that requires signed URLs for access. Django-storages generates time-limited, cryptographically signed URLs for PDF downloads, ensuring that only authorized users who have purchased an issue can access its content. These signed URLs expire after a configurable period (default 3600 seconds), preventing unauthorized sharing. The system uses path-style addressing to communicate with Supabase's S3-compatible endpoint and generates public URLs in the native Supabase format for optimal browser compatibility. This architecture balances performance with security, providing fast cover image loading while protecting premium content.
Python 3.11 or higher, Node.js and npm for Tailwind CSS compilation, and Git for version control.
Clone the project from GitHub and navigate into the directory:
git clone https://github.com/mdsajib1473/digital-magazine-archive.git
cd digital-magazine-archiveCreate and activate a Python virtual environment:
On Windows:
python -m venv venv
venv\Scripts\activateOn macOS/Linux:
python3 -m venv venv
source venv/bin/activateInstall all required Python packages from requirements.txt:
pip install -r requirements.txtCreate a .env file in the project root and add the following configuration:
DEBUG=True
SECRET_KEY=your-secret-key-here
ALLOWED_HOSTS=127.0.0.1,localhost
# Database (local SQLite for development)
# DATABASE_URL=postgres://user:password@host:5432/dbname
# Supabase Storage (set USE_SUPABASE_STORAGE=True to enable cloud storage)
USE_SUPABASE_STORAGE=False
SUPABASE_S3_ENDPOINT_URL=https://your-project-ref.storage.supabase.co/storage/v1/s3
SUPABASE_S3_REGION=ap-southeast-1
SUPABASE_S3_ACCESS_KEY_ID=your-access-key
SUPABASE_S3_SECRET_ACCESS_KEY=your-secret-key
SUPABASE_PUBLIC_BUCKET=magazine-archive
SUPABASE_PRIVATE_BUCKET=magazine-archive-pdfs
SUPABASE_SIGNED_URL_EXPIRE=3600
# SSLCommerz Payment Gateway
SSLCOMMERZ_STORE_ID=your-store-id
SSLCOMMERZ_STORE_PASSWORD=your-store-password
SSLCOMMERZ_IS_SANDBOX=True
For local development, you can skip the Supabase and SSLCommerz variables initially. The application will fall back to local SQLite database and file system storage.
Apply the database migrations to create the necessary tables:
python manage.py migrateCreate an admin account to access the Django admin panel:
python manage.py createsuperuserFollow the prompts to set a username, email, and password.
Compile the Tailwind CSS for development:
python manage.py tailwind buildRun the Django development server:
python manage.py runserverThe application will be available at http://127.0.0.1:8000. Access the admin panel at http://127.0.0.1:8000/admin using the superuser credentials created in Step 6.
If you have a data dump file, you can load it into the database:
python manage.py loaddata dump.jsonThis will populate the database with existing issues, users, and purchase records.
The source code is publicly available at github.com/mdsajib1473/AI-Symtom-Journal-Specification under the MIT License.



