Simple blog application built using Django. It allows users to sign up, log in, create, edit, view, and delete articles. The platform supports tagging, publishing status, and searching for articles by title, content, or tags.
- User authentication (sign up, log in, log out)
- Create, read, update, and delete (CRUD) articles
- Article tags
- Article publishing (published/unpublished status)
- Author display on articles
- Responsive navigation with user greeting
- Search functionality to filter articles by title, content, or tags
- RESTful API for article access and management
- Python 3.13
- Django 5.2.1
- Django REST Framework
- HTML/CSS (Bootstrap for styling)
- SQLite
- Python 3.10+
- pip
- Virtual environment (recommended)
-
Clone the repository:
git clone https://github.com/0then0/BlogDjango cd BlogDjango -
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Create a superuser (admin):
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
Visit http://127.0.0.1:8000/ in your browser to access the application.
The project includes a basic RESTful API using Django REST Framework.
http://127.0.0.1:8000/api/
| Method | Endpoint | Description |
|---|---|---|
| GET | /articles/ |
Retrieve a list of articles |
| GET | /articles/<id>/ |
Retrieve a single article |
| POST | /articles/ |
Create a new article |
| PUT | /articles/<id>/ |
Update an existing article |
| DELETE | /articles/<id>/ |
Delete an article |
{
"title": "Example Article",
"content": "This is an example article body.",
"published": true,
"tags": "news, updates"
}Currently, the API is open or protected depending on how the project is configured. You can update permissions in views.py or add token-based authentication as needed.
- Only authenticated users can create and edit articles.
- Users can only edit/delete their own articles unless they are staff.
- Search functionality is case-insensitive and supports partial matches.