Archives par étiquette : Python

Modular settings for Django

This is the first post in a series about useful methods to simplify the development and the installation of Django. In this specific post I’m proposing a way to organize the settings into a module.

I have been always bothered by the settings file because it is needed to change it everytime we go from development server to production server: one has mainly to change the database, the debug option and the static/media options. This prevents us to copy at one time all the files (or we have to change the settings file elsewhere, e.g. in and it is unnecessarily complicated; also versioning is harder because we do not want to let sensitive information (secret key, etc.) be on internet. So after some thoughts (and maybe some readings on the web I do not remember) I came to a solution to this problem. Continuer la lecture

Ninja-IDE, and ReST plugin v0.1

Ninja-IDE is a wonderful Python IDE: it includes most of the tools one needs in order to code and manage Python projects, and it is very fast (except for the directory tree construction). I like especially the higlighting of errors and PEP8, the project manager, and the auto-formatting (trailing spaces…).

Some functionalities are still missing or very painful to use:

  • the directory tree has no drag-and-drop possibilities, all the actions have to be launched by right-clicking (it is the worse point);
  • do not list all files in the project directories, just the ones whose extensions is defined in the settings (so it is not possible to edit text files without extension);
  • the plugin system has still some drawback and is not very flexible;
  • despite its capabilities for theming and changing the window interfaces, it is very difficult to manage the different styles and I have a lot of bugs with them;
  • I miss the code completion from Pydev: here it does not launch when writing but one has to use a shortcut.

The django plugin is very useful but one has to configure a virtual environment even if one does not use it.

Finally I have written a little plugin to help writing documents using ReST (reStructuredText) markup, (used by Sphinx documentation generator). The first version (0.1) adds a tab which display the title hierarchy. You can find it on the Ninja-IDE website or on Github.