Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
howtos:geany_and_django [2012/06/12 18:19] – add some hints about using Geany for Django enricohowtos:geany_and_django [2013/10/19 14:30] – Fix typo enrico
Line 29: Line 29:
 can be found in detail in the [[http://www.geany.org/manual/current/index.html#configuration-files can be found in detail in the [[http://www.geany.org/manual/current/index.html#configuration-files
 |Geany manual, section Configuration Files]]. |Geany manual, section Configuration Files]].
 +
 +==== Fine-tune styling ====
 +
 +You can adjust the styling to some extend using the following settings which should be placed in the [styling] section of filetypes.html:
 +
 +  * html_asp
 +  * python_identifier
 +  * python_default
 +
 +
 +Explanation:
 +
 +<code html>{% load pages_tags i18n %}</code>
 +
 +''{%'' and ''%}'' will be styled with //html_asp//, ''load'', ''pages_tags'' and ''i18n''
 +will be styled with //python_identifier// and the spaces between with
 +//python_default//.
 +
 +For more information about configuring styles, please check the manual [[http://www.geany.org/manual/current/index.html#filetype-configuration|Geany manual, section Filetype configuration]].
  
  
Line 78: Line 97:
 |Geany manual, section Snippets]]. |Geany manual, section Snippets]].
  
 +===== Tags =====
 +Tags for django (version 1.4.1) can be found [[http://wiki.geany.org/_media/tags/django1.4.1.py.tags|here]]. For information on using tag files, see the [[http://www.geany.org/manual/current/index.html#tags|Tags section]] of the [[http://www.geany.org/manual/current/index.html|Geany User Manual]].
 +
 +===== Live Preview in Geany =====
 +
 +Using the great //Web helper// plugin (from the [[http://plugins.geany.org|Geany-Plugins]] package)
 +you can view and test your site directly in Geany without switching to an external browser.
 +
 +Simply enable the //Web helper// plugin in Geany's plugin manager dialog, open it preferences dialog
 +and enable the option "Browser auto reload" (to automatically reload the page when you save a file in Geany).
 +
 +Then you will get a new tab "Web preview" in the left message window (or whereever you configured the plugin
 +to show up) and you can enter any weg page address, e.g. those of your currently edited Django project.
 +Below is a screenshot demonstrating the plugin: the opened web page on the left, the template code on the right
 +and in the terminal window at the bottom, Django's runserver command is running:
 +
 +{{ :howtos:geany_webhelper_django.png?550 |}}
 +
 +This way you can edit your Django and template code in Geany as usual and have it automatically shown
 +as web page in the //Web helper// plugin without the need of switching to an external browser, and
 +the Django debug server can also be ran in Geany, using the embedded terminal.
 +
 +
 +===== Twig/Symfony2 Support =====
  
-{{tag>howto python django snippets}}+If you want to add detection/highlighting of [[http://en.wikipedia.org/wiki/Twig_%28template_engine%29|Twig/Symfony2]] files (based on Django's templates) when opening in Geany, add ''*.html.twig'' to the ''HTML'' key in the ''filetype_extensions.conf'' file. For more information on ''filetype_extensions.conf'', see the [[http://www.geany.org/manual/dev/index.html#filetype-extensions|Filetype extensions section]] of the [[http://www.geany.org/manual/current/index.html|Geany User Manual]].
  
 +{{tag>howto python django twig symfony2 snippets}}
Print/export