roninforge/roninforge-django/django-settings

Claude Code and agent skill by roninforge/roninforge-django

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Split a monolithic Django settings.py into base/development/production configuration with environment variable extraction. Fixes hardcoded secrets and ensures production-safe defaults.

Install

npx vskill@latest install roninforge/roninforge-django/django-settings

SKILL.md

The same SKILL.md was published earlier as roninforge/roninforge-django/django-settings.

Split Django Settings

When to Use

Use this skill when:

  • A project has a single settings.py with development and production config mixed
  • Secrets are hardcoded in settings
  • The project needs environment-specific configuration

Instructions

  1. Read the current settings.py completely.
  1. Identify values that should vary by environment:
  • SECRET_KEY (must come from environment)
  • DEBUG (True in dev, False in prod)
  • ALLOWED_HOSTS (empty in dev, domain list in prod)
  • DATABASES (SQLite in dev, PostgreSQL in prod, or same with different credentials)
  • Email backend and credentials
  • Cache backend
  • STATIC_ROOT, MEDIA_ROOT
  • Third-party API keys
  • SECURE_SSL_REDIRECT, CSRF_COOKIE_SECURE, SESSION_COOKIE_SECURE
  1. Create the following structure:

`` config/ settings/ __init__.py # Imports from DJANGO_SETTINGS_MODULE base.py # Shared settings (INSTALLED_APPS, MIDDLEWARE, TEMPLATES, etc.) development.py # Dev overrides (DEBUG=True, SQLite, console email) production.py # Prod settings (DEBUG=False, PostgreSQL, real email, security) ``

  1. base.py should contain:
  • All INSTALLED_APPS, MIDDLEWARE, TEMPLATES, ROOT_URLCONF
  • AUTH_USER_MODEL if custom
  • DEFAULT_AUTO_FIELD
  • USE_TZ = True (Django 5.0+ default)
  • SECRET_KEY = os.environ['DJANGO_SECRET_KEY']
  • Shared REST_FRAMEWORK config if using DRF
  1. development.py should contain:

```python from .base import *

DEBUG = True ALLOWED_HOSTS = ['localhost', '127.0.0.1']

DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', } }

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' ```

  1. production.py should contain:

```python from .base import *

DEBUG = False ALLOWED_HOSTS = os.environ['DJANGO_ALLOWED_HOSTS'].split(',')

DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': os.environ['DB_NAME'], 'USER': os.environ['DB_USER'], 'PASSWORD': os.environ['DB_PASSWORD'], 'HOST': os.environ.get('DB_HOST', 'localhost'), 'PORT': os.environ.get('DB_PORT', '5432'), } }

# Security SECURE_SSL_REDIRECT = True SECURE_HSTS_SECONDS = 31536000 SECURE_HSTS_INCLUDE_SUBDOMAINS = True SECURE_HSTS_PRELOAD = True SESSION_COOKIE_SECURE = True CSRF_COOKIE_SECURE = True ```

  1. Update manage.py and wsgi.py/asgi.py to use the correct settings module:

``python os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.development') ``

  1. Generate a .env.example file documenting all required environment variables.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/roninforge/roninforge-django/django-settings/badge)](https://verified-skill.com/skills/roninforge/roninforge-django/django-settings)

Something wrong with this skill or its page? Tell us.