Snippets, syntax highlighting, and color theme for Shanks Django framework.
- 🚀 Code snippets for common Shanks patterns
- 🎨 Syntax highlighting for Shanks & SORM keywords
- 🌈 Custom dark theme optimized for Shanks
- 📝 IntelliSense support
- ⚡ Quick scaffolding
The extension provides enhanced syntax highlighting for:
- Shanks imports:
from shanks import App,from SORM import table - Decorators:
@app.get(),@app.post(),@SwaggerUI.doc() - Classes:
App,Response,CORS,SwaggerUI,Model,User - SORM fields:
CharField,TextField,ForeignKey, etc. - SORM functions:
table(),model(),authenticate() - Query methods:
.find_many(),.create(),.update_self() - Response methods:
.json(),.status_code(),.cookie() - Constants:
CASCADE,SET_NULL,PROTECT
The extension includes "Shanks Dark" theme with red accents:
- Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
- Type "Color Theme"
- Select "Shanks Dark"
Features:
- Dark background (#0d0d0d)
- Red highlights for Shanks/SORM keywords
- Orange for methods and functions
- Optimized for Python with Shanks
sorm-table- Create model with JSON-like syntaxsorm-model- Create SORM modelsorm-user- Use SORM User model
shanks-app- Create a new Shanks appshanks-get- Create a GET routeshanks-post- Create a POST routeshanks-put- Create a PUT routeshanks-delete- Create a DELETE route
shanks-middleware- Create middlewareshanks-auth- Create auth middleware
shanks-cors- Enable CORSshanks-swagger- Enable Swagger UIshanks-doc- Add Swagger documentation
shanks-response- Return Response objectshanks-cookie- Return Response with cookieshanks-redirect- Redirect response
shanks-mongodb- Setup MongoDB connectionshanks-redis- Setup Redis connectionshanks-postgres- Setup PostgreSQL database
shanks-full- Create full API with CORS and Swagger
- Install the extension
- Open a Python file
- Type a snippet prefix (e.g.,
shanks-app) - Press
Tabto expand
Type shanks-app and press Tab:
from shanks import App
app = App()
@app.get('api/hello')
def hello(req):
return {'message': 'Hello World!'}
urlpatterns = app.get_urls()Type shanks-post and press Tab:
@app.post('api/users')
def create_user(req):
data = req.body
return {'created': True}Type shanks-cors and press Tab:
from shanks import CORS
CORS.enable(app,
origins=['http://localhost:3000'],
credentials=True
)- VSCode 1.80.0 or higher
- Python extension for VSCode
- Download the latest
.vsixfile from Releases - Open VSCode
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Click "..." menu → Install from VSIX
- Select the downloaded file
Or via command line:
code --install-extension shanks-django-0.1.0.vsix- Open VSCode
- Go to Extensions (Ctrl+Shift+X)
- Search for "Shanks Django"
- Click Install
- Download the
.vsixfile - Open VSCode
- Go to Extensions
- Click "..." menu
- Select "Install from VSIX..."
- Choose the downloaded file
Contributions are welcome! Please visit GitHub.
cd vscode-extension
npm install -g @vscode/vsce
vsce packageThis will generate shanks-django-x.x.x.vsix file.
The extension is automatically built and released via GitHub Actions:
- Automatic Release: Push a tag starting with
v(e.g.,v0.1.0) - Manual Build: Go to Actions → "Build VSCode Extension (Manual)" → Run workflow
The VSIX file will be available in:
- Release assets (for tagged releases)
- Workflow artifacts (for manual builds)
MIT