roninforge/roninforge-django/django-settings
Claude Code and agent skill by roninforge/roninforge-django
- community
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-settingsSKILL.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.pywith development and production config mixed - Secrets are hardcoded in settings
- The project needs environment-specific configuration
Instructions
- Read the current
settings.pycompletely.
- 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
- 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) ``
- base.py should contain:
- All
INSTALLED_APPS,MIDDLEWARE,TEMPLATES,ROOT_URLCONF AUTH_USER_MODELif customDEFAULT_AUTO_FIELDUSE_TZ = True(Django 5.0+ default)SECRET_KEY = os.environ['DJANGO_SECRET_KEY']- Shared
REST_FRAMEWORKconfig if using DRF
- 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' ```
- 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 ```
- Update
manage.pyandwsgi.py/asgi.pyto use the correct settings module:
``python os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.development') ``
- Generate a
.env.examplefile 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
- SKILL.md in the repositoryCheckingskills/django-settings/SKILL.md
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
[](https://verified-skill.com/skills/roninforge/roninforge-django/django-settings)