How gruizv/djangoblogsite works
Project Type & Purpose
• The project is a full-stack web application built with Django. It provides a blogging platform that handles both user management (registration, login, profile management) and post management (creating, editing, deleting, and listing blog posts).
• It uses Django’s Model-View-Template (MVT) architectural pattern with additional integrations such as AWS S3 for media storage and Bootstrap for responsive design.
File Structure
• The top-level directory contains key files (like manage.py, requirements.txt) and a project folder “django_blogsite_dir”. Inside that, you have two primary Django apps: “blog” and “users”.
• The “blog” app includes essential components: models, views, templates, static assets, and migrations – indicating its responsibility for managing blog posts and rendering blog pages.
• The “users” app contains models, views, forms, and templates to support user authentication, profile management, and the integration with Django’s auth system.
• Configuration files (settings.py, urls.py) and WSGI/ASGI files define project-level settings and routing.
Main Components
a. Frontend (Client Side):
• Browser/User Interface: Represents user interactions with the website. It consumes HTML/CSS (Bootstrap-based styling) rendered by Django templates.
b. Django Web Server / Application Layer:
• Django Framework: The core engine that handles routing, views, and template rendering.
• Blog App: Manages blog posts, template rendering (home, post detail, post form, etc.), and static files.
• Users App: Handles user registration, login, profile management, and related views.
c. Database:
• SQLite (used in development) – where all user and blog post information is stored.
d. External Services:
• AWS S3: For storing and retrieving media files (such as profile pictures) using django-storages and boto3.
• (Optional) Django Admin Panel: A separate administrative interface provided by Django for managing data.
Relationships & Interactions
• The client (browser) sends HTTP requests to the Django web server via URLs defined in project-level and app-level urls.py.
• The Django server processes these through views that interact with the models (data layer), and finally render templates back to the client.
• User authentication flows manage session state, while media file uploads trigger integrations with AWS S3.
• Both blog and users apps are interconnected through shared functionality (e.g., each post is linked to a user), and they utilize Django’s built-in routing and middleware.
Architectural Patterns & Design Principles
• Django’s MVT pattern: Each app’s structure naturally divides the system into models (data schema), views (business logic), and templates (presentation).
• The system uses a modular approach with each dedicated app (blog, users), promoting separation of concerns.
• Integration with external services (AWS S3) demonstrates dependency injection and separation of file storage responsibilities from the application core.
• Use of responsive design principles through Bootstrap enhances the frontend user experience.