Giter VIP home page Giter VIP logo

django-mode's Introduction

Django mode for Emacs

How to install

  1. Install yasnippet
  2. Add something like this to your Emacs config:
(require 'django-html-mode)
(require 'django-mode)
(yas/load-directory "path-to/django-mode/snippets")
(add-to-list 'auto-mode-alist '("\\.djhtml$" . django-html-mode))

Jumping

Move your cursor to a line that contains the thing you want to go and press C-x j. Django-mode supports jumping to:

  • templates, eg. render_to_response('some.html') will open some.html. (it supports @render_to from annoying, classic render_to_response and the new 1.3 TemplateResponse)
  • views (from urls.py), urls.py and views.py must be in the same directory (no global urls.py for all apps, it's a bad practice after all!)
  • models, from Model.objects.* or Model(*), no support for get_object_or_404(Model* yet

Inserting translation marks

Select a string you want to translate and press C-t. This works in both Python and templates.

Running management commands

Check out the Django menu :) BTW, default keybindings:

  • C-c t runs tests
  • C-c s runs syncdb
  • C-c a creates an app (asking for a name first)
  • C-c m asks you for a command to run

django-mode's People

Contributors

johnpaulett avatar nivl avatar rincewind avatar valpackett avatar

Watchers

Brett Hutley avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.