A production-style demo showing clean Django/DRF patterns, OpenAPI docs, and a simple Tailwind dashboard.
Live version: https://joshuaeastman.dev/bookmarks/v1/bookmarks/
This is a demo application not designed for deployment.
- Admin: http://localhost:8000/admin/
- Docs (Swagger UI): http://localhost:8000/bookmarks/docs/
- Demo Dashboard: http://localhost:8000/bookmarks/demo/
- Health: http://localhost:8000/bookmarks/v1/health/
- Bookmarks List (JSON): http://localhost:8000/bookmarks/v1/bookmarks/
- Submit Bookmark (POST): http://localhost:8000/bookmarks/v1/bookmarks/submit/
Paths may differ slightly if you’ve customized URLs; these are the defaults in this repo.
- Python ≥ 3.13
- Node.js & npm (for Tailwind build via
django-tailwind) - (Recommended) virtual environment
git clone git@github.com:JoshuaEastman/BookmarksAPI.git
cd BookmarksAPIWindows (PowerShell):
python -m venv .venv
.\.venv\Scripts\Activate.ps1macOS/Linux (bash):
python -m venv .venv
source .venv/bin/activatepip install -r requirements.txtpython manage.py migratepython manage.py tailwind install
python manage.py tailwind buildFor live dev watching, use:
python manage.py tailwind start(Ctrl+C to stop)
python manage.py createsuperuserpython manage.py runserverOpen http://localhost:8000/ and use the Quick Links above.
Visit /admin/ and create a few Tags and Bookmarks. The API and demo dashboard will display whatever you add.
Returns a paginated list of approved bookmarks. Supports filtering and search.
Query parameters:
?tag=python→ filter by tag slug?search=django→ search title/description?ordering=created_ator?ordering=-created_at
Example response
{
"count": 5,
"next": null,
"previous": null,
"results": [
{
"id": 8,
"title": "Tailwind CSS Documentation",
"url": "https://tailwindcss.com/docs/installation/using-vite",
"description": "Documentation for Tailwind CSS",
"tags": [
"css",
"documentation",
"styling",
"tailwind"
],
"created_at": "2025-09-13T14:54:57.988437Z"
}
]
}Retrieve details of a single bookmark.
Example Response
{
"id": 8,
"title": "Tailwind CSS Documentation",
"url": "https://tailwindcss.com/docs/installation/using-vite",
"description": "Documentation for Tailwind CSS",
"tags": [
"css",
"documentation",
"styling",
"tailwind"
],
"created_at": "2025-09-13T14:54:57.988437Z"
}Submit a new bookmark anonymously. Submissions are moderated (is_approved=false by default).
Response (201 Created):
{
"id": 1,
"title": "Google",
"url": "https://google.com",
"description": "Google",
"tags": [],
"pending_tags": [
"google"
],
"is_approved": false,
"created_at": "2025-09-16T22:12:17.397178Z"
}Unknown tags are returned in
pending_tags. A honeypot fieldwebsitewill cause rejection if set.
Simple health/uptime check.
OpenAPI 3.1.1 docs (Swagger UI).
A small Tailwind dashboard with quick links to endpoints.
This project uses pytest + pytest-django.
pip install pytest pytest-django
pytest -qIf needed, the repo includes a pytest.ini pointing to the Django settings module. Run tests from the project root (same folder as manage.py).
- This repo uses django-tailwind; Node/npm must be available.
- Build once with
python manage.py tailwind build, or run the watcher withpython manage.py tailwind startduring development.
- Defaults to SQLite for local dev. For production, configure
DATABASE_URLandALLOWED_HOSTS. - If you deploy with WhiteNoise, run
python manage.py collectstaticand ensureSTATIC_ROOTis set.
MIT (see LICENSE).