Django + Templates ~8 Hours Intermediate

What You Are Building

Build a workspace-based internal knowledge base where admins can create articles and members can search/read approved content.

This project teaches

  • Django models
  • Forms
  • Services
  • Views
  • Templates
  • Search
  • Categories
  • Permissions
  • Rich content
  • Slug routing
Flow Design

Example Flow

flowchart TD
    Login[User logs in]
    Workspace[Selects workspace]
    KB[Opens Knowledge Base]

    Login --> Workspace --> KB

    KB --> Owner[Owner Flow]
    KB --> Admin[Admin Flow]
    KB --> Member[Member Flow]

    Owner --> OwnerOverview[View knowledge across owned workspaces]
    OwnerOverview --> OwnerFilter[Search / filter / paginate articles]
    OwnerFilter --> OwnerManage[Create category, edit article, publish, archive]
    OwnerManage --> OwnerAudit[Review article visibility and content quality]

    Admin --> AdminHome[View workspace knowledge base]
    AdminHome --> AdminCategory[Create or manage categories]
    AdminCategory --> AdminDraft[Write or edit draft article]
    AdminDraft --> AdminPublish[Publish article for workspace members]
    AdminPublish -. cannot manage another workspace .-> AdminBlocked[Blocked by workspace permission rules]

    Member --> MemberHome[View published knowledge base]
    MemberHome --> MemberSearch[Search topics, categories, or article content]
    MemberSearch --> MemberRead[Open published article detail]
    MemberRead -. drafts and admin edit controls are hidden .-> MemberBlocked[Restricted actions denied]

Required Pages

Knowledge Base Home

Should show:

  • Search bar for article title/content.
  • Category cards or list.
  • Recently published articles.
  • Popular article tracking is out of scope for the base project.
  • Workspace-safe empty state when no article exists yet.
  • Pagination or “load more” if article volume grows.

Category Page

Should show:

  • Category title, article count, and filtered article list.
  • Search inside the category.
  • Sort by recent first by default, with optional alphabetical sort only if time remains after the base project is complete.
  • Pagination for long article lists.
  • Clear no-result state for empty categories or filtered searches.

Article Detail Page

Should show:

  • Title, rich content, category, author, and last updated date.
  • Related articles are optional only after the base project is complete and are not required for delivery.
  • Drafts fully blocked from member view.

Admin Article Form

Fields:

  • Title, slug, category, content, status, and visibility fixed to the current workspace.
  • Slug preview and uniqueness validation.
  • Rich content editor or structured content area.
  • Save draft and publish actions are required.
  • Preview mode before publish is a nice-to-have only after the base project is complete.

Data Model

Recommended models:

ModelPurpose
KnowledgeCategoryGroups articles.
KnowledgeArticleMain article content.
ArticleViewOptional article analytics.

Recommended KnowledgeArticle fields:

FieldPurpose
workspaceWorkspace relation.
categoryCategory relation.
titleArticle title.
slugURL-safe slug.
contentRich article content.
statusDraft or published.
created_byAuthor.
updated_atLast update time.

Slug Routing

Recommended route style:

/kb/<category_slug>/<article_slug>/

Slug rules:

  • Slug should be unique per workspace.
  • Slug should not expose database ID where avoidable.
  • Slug should update carefully to avoid broken links.

Permission Rules

ActorAllowed
OwnerManage all knowledge base content.
AdminCreate/edit articles in assigned workspace.
MemberRead published articles in own workspace.
Non-memberNo access.

Search Expectations

Search should work by:

  • Article title
  • Article content
  • Category

Use Django ORM search for the base project. PostgreSQL full-text search is a later enhancement, not part of the required delivery.

Acceptance Checklist

  • Admin can create category.
  • Admin can create article.
  • Draft articles are hidden from members.
  • Published articles are visible to workspace members.
  • Member cannot see articles from another workspace.
  • Search works.
  • Category filtering works.
  • Slug routing works.
  • Empty state appears when no article exists.
  • Business logic is handled in service layer.