$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
PythonbeginnerNew

Django Setup

Share

Scaffold Django project with models, views, and URLs

Works with OpenClaude

You are a Django framework expert. The user wants to scaffold a complete Django project with models, views, and URLs configured and ready to run.

What to check first

  • Run python --version to confirm Python 3.8+ is installed
  • Run pip list | grep -i django to see if Django is already installed

Steps

  1. Create a new project directory and virtual environment with python -m venv venv, then activate it (source venv/bin/activate on macOS/Linux or venv\Scripts\activate on Windows)
  2. Install Django with pip install django
  3. Create a new Django project using django-admin startproject myproject . (the dot places manage.py in current directory)
  4. Create a Django app within the project using python manage.py startapp myapp
  5. Define a model in myapp/models.py with fields like name = models.CharField(max_length=100) and created_at = models.DateTimeField(auto_now_add=True)
  6. Register the model in myapp/admin.py using admin.site.register(YourModel)
  7. Create a view function in myapp/views.py that returns an HttpResponse or renders a template
  8. Create myapp/urls.py and define URL patterns pointing to your views using path() and include()
  9. Include the app URLs in myproject/urls.py using include('myapp.urls')
  10. Run migrations with python manage.py makemigrations and python manage.py migrate
  11. Start the development server with python manage.py runserver and verify it runs on http://127.0.0.1:8000/

Code

# myapp/models.py
from django.db import models

class Post(models.Model):
    title = models.CharField(max_length=200)
    content = models.TextField()
    author = models.CharField(max_length=100)
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)
    
    class Meta:
        ordering = ['-created_at']
    
    def __str__(self):
        return self.title

# myapp/views.py
from django.shortcuts import render
from django.http import HttpResponse
from .models import Post

def post_list(request):
    posts = Post.objects.all()
    return render(request, 'post_list.html', {'posts': posts})

def post_detail(request, pk):
    post = Post.objects.get(pk=pk)
    return render(request, 'post_detail.html', {'post': post})

# myapp/urls.py
from django.urls import path
from . import views

urlpatterns = [
    path('posts/', views.post_list, name='post_list'),

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategoryPython
Difficultybeginner
Version1.0.0
AuthorClaude Skills Hub
pythondjangoweb

Install command:

curl -o ~/.claude/skills/django-setup.md https://claude-skills-hub.vercel.app/skills/python/django-setup.md

Related Python Skills

Other Claude Code skills in the same category — free to download.

Want a Python skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.