This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+frameworks/django
syl20bnr 584392bd92 [core] Fix layer dependencies based on layer variables
There was a edge case with the declaration of the `lsp` layer in `layers.el`
files.
The `hy` layer depends on the `python` layer which in turn depends on the `lsp`
layer if and only if the `python-backend` layer variable is set to `lsp`.
When the `hy` layer was declared first then it declares the `python` layer
without its layer variables, thus the `lsp` layer was not declared because the
`python-backend` variable was not set.

The fix is to gather all the layer dependencies and resolve them only after all
the used layers have been declared.

* new function `configuration-layer/declare-layer-dependencies`
* replace all calls to `configuration-layer/declare-layer` by the new function
  except for distribution layers (we declare layer dependencies right away in
  distribution layers)
2019-09-30 02:00:48 -04:00
..
img Use + instead of ! for layer categories 2015-09-11 00:13:51 -04:00
layers.el [core] Fix layer dependencies based on layer variables 2019-09-30 02:00:48 -04:00
packages.el Unify packages list parentheses style 2018-11-21 21:35:38 +00:00
README.org documentation formatting: Sun May 26 20:58:52 UTC 2019 2019-05-27 01:23:35 +03:00

Django layer

/TakeV/spacemacs/media/commit/f3f2db831530f03e8cd3cd75fb9bc59febfd201b/layers/+frameworks/django/img/django.png

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 binding Description
SPC m j m Start a pony-mode managment session

Fabric

Key binding Description
SPC m j a f Run a fabric command
SPC m j a d Deploy project with fab deploy

Files

Key binding Description
SPC m j f s Open the settings.py for this project
SPC m j f c Interactively display a setting value in the minibuffer
SPC m j f t Jump to template at point
SPC m j f r Jump to the view file that the URL resolves to (experimental)

Interactive

Key binding Description
SPC m j i d Run interpreter for this project's default database as an inferior process
SPC m j i s Open 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 binding Description
SPC m j r d Stop the dev server
SPC m j r o Open a tab at the dev server
SPC m j r r Restart the dev server (works better with django_extras/werkzeug)
SPC m j r u Start or open the dev server
SPC m j r t Open a second server with a "throwaway" host/port

South/Syncdb

Key binding Description
SPC m j s c Convert an existing app to south
SPC m j s h Create migration for modification
SPC m j s i Run the initial south migration for an app
SPC m j s m Migrate an app
SPC m j s s Run syncdb on the current project

Test

Key binding Description
SPC m j t d Move down the traceback one level
SPC m j t e Go to the file and line of the last stack trace in a test buffer
SPC m j t o Open the file in a traceback at the line specified
SPC m j t t Run the test(s) given by command
SPC m j t u Move up the traceback one level