This is a RESTful API built with Django and Django REST Framework as part of the backend technical challenge for CodeLeap.
- Python 3.11+
- Django 5.0+
- Django REST Framework
- SQLite (used for development; easily replaceable)
- ✅ Create posts
- ✅ List all posts
- ✅ Update posts
- ✅ Delete posts
-
Clone the repository
git clone https://github.com/LeonardoLBraga/codeleap-backend-api cd codeleap-backend-api -
Create and activate a virtual environment
python -m venv venv source venv/bin/activate # Linux/macOS venv\Scripts\activate # Windows
-
Install dependencies
pip install -r requirements.txt
-
Apply database migrations
python manage.py migrate
-
Start the development server
python manage.py runserver
Visit: http://localhost:8000/careers/
{
"id": "number",
"username": "string",
"created_datetime": "datetime",
"title": "string",
"content": "string"
}| Method | Route | Description |
|---|---|---|
| GET | /careers/ |
List all posts |
| POST | /careers/ |
Create a new post |
| PATCH | /careers/<id>/ |
Update a post |
| DELETE | /careers/<id>/ |
Delete a post |
{
"username": "string",
"title": "string",
"content": "string"
}No body required.
{
"title": "string",
"content": "string"
}No body required.
To run the API unit tests, use:
python manage.py test postsThis will run automated tests that verify the creation, listing, updating and deletion of posts.
The API is live at:
🔗 https://codeleap-backend-api-oxdh.onrender.com/careers/
- All endpoints end with a trailing slash (
/), as required by Django REST Framework. - The SQLite database is used only for local/testing purposes.
- This API is fully ready to be integrated with any frontend framework (e.g., React).