PyCharm 3.4.0 Web Help

Some features described here are available in Professional edition only.

In this section:

Prerequisites

Before referring to static contents, make sure that the following prerequisites are met:

  • 'django.contrib.staticfiles', is added to INSTALLED_APPS in the settings.py file of your application.
  • The directory with the static contents (for example, images), named static, resides under the application root.

Note that you can configure the directory for the static content in the settings.py file, by changing the STATICFILES_DIRS field.

To refer to static contents, follow these general steps
  1. In the pre-configured directory for templates, create a template file (Alt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertCtrl+N or Alt+InsertAlt+InsertAlt+InsertCommand N or Control EnterControl N or Control EnterCommand N or Control Enter - HTML/XHTML file).
  2. After the template tag STATIC_URL, start typing, and then use Ctrl+SpaceCtrl+SpaceCtrl+SpaceCtrl+SpaceAlt+SlashCtrl+SpaceCtrl+Space or Ctrl+Back SlashCtrl+SpaceControl SpaceControl SpaceControl Space. Inspection that detects unresolved references to the static contents is also available.

    py_static_contents

See Also

External Links:

Web Resources: