Skip to content

Latest commit

 

History

History
97 lines (77 loc) · 4.52 KB

README.org

File metadata and controls

97 lines (77 loc) · 4.52 KB

Django layer

img/django.png

Table of Contents

Description

This layer adds support for the Python web framework Django to Spacemacs.

Features:

  • Test execution directly from emacs
  • Starting/stopping of the Django test server
  • Starting of an interactive Python shell in the current project for debugging
  • Fixed commands to open various Django specific settings files
  • Automatic deployment with Fabric directly from emacs
  • Control of South database migration tool

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add django to the existing dotspacemacs-configuration-layers list in this file.

Key bindings

Django related key bindings uses pony-mode and are behind the prefix SPC m j in Python-mode. Various configuration options for pony-mode are documented at deadpansincerity.com.

General Managment

Key bindingDescription
SPC m j mStart a pony-mode managment session

Fabric

Key bindingDescription
SPC m j a fRun a fabric command
SPC m j a dDeploy project with fab deploy

Files

Key bindingDescription
SPC m j f sOpen the settings.py for this project
SPC m j f cInteractively display a setting value in the minibuffer
SPC m j f tJump to template at point
SPC m j f rJump to the view file that the URL resolves to (experimental)

Interactive

Key bindingDescription
SPC m j i dRun interpreter for this project’s default database as an inferior process
SPC m j i sOpen a Python shell with the current pony project’s context loaded.
If the project has the django_extras package installed, then use the
excellent shell_plus command. Otherwise, fall back to manage.py shell

Server

Key bindingDescription
SPC m j r dStop the dev server
SPC m j r oOpen a tab at the dev server
SPC m j r rRestart the dev server (works better with django_extras/werkzeug)
SPC m j r uStart or open the dev server
SPC m j r tOpen a second server with a “throwaway” host/port

South/Syncdb

Key bindingDescription
SPC m j s cConvert an existing app to south
SPC m j s hCreate migration for modification
SPC m j s iRun the initial south migration for an app
SPC m j s mMigrate an app
SPC m j s sRun syncdb on the current project

Test

Key bindingDescription
SPC m j t dMove down the traceback one level
SPC m j t eGo to the file and line of the last stack trace in a test buffer
SPC m j t oOpen the file in a traceback at the line specified
SPC m j t tRun the test(s) given by command
SPC m j t uMove up the traceback one level