Skip to content

Latest commit

 

History

History

django

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Django layer

img/django.png

Table of Contents

Description

This layer adds support for the Python Django framework via pony-mode.

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.

Configuration options for pony-mode are documented at deadpansincerity.com

Manage Django with SPC m j m.

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