Skip to content

Django application to edit files from the admin interface

Notifications You must be signed in to change notification settings

synw/django-dirtyedit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Dirty Edit

Build Status

A Django application to edit files from the admin interface. This make it possible for example to let graphic designers edit some css files in the admin interface.

Install

pip install django-dirtyedit

Add these to INSTALLED_APPS:

'dirtyedit',
'ckeditor',
'codemirror2',
'reversion',

Note: codemirror2 and reversion should be loaded after dirtyedit

Settings

Default values are:

  • DIRTYEDIT_EDIT_MODE = 'code' : uses codemirror. To use ckeditor set it to 'html'
  • DIRTYEDIT_CODEMIRROR_KEYMAP = 'default' : set it to what your like. Ex: 'vim', 'emacs'
  • DIRTYEDIT_AUTHORIZED_PATHS = ('media', 'static', 'templates') : writing in theses directories and their subdirectories is authorized.
  • DIRTYEDIT_EXCLUDED_PATHS = () : to explicitly exclude some paths. Ex: ('media/private')
  • DIRTYEDIT_CAN_CREATE_FILES = False : set it to True to allow file creation
  • DIRTYEDIT_USE_REVERSION = True : set it to False to disable reversion

Management command

A management command is available to populate the database from a directory: example:

python3 manage.py populate_editor templates

This will save instances from each of the files that is in the templates folder. Note: this is not recursive, only the files in the directory will be processed

Warning

Handle with care: its pretty easy to break things with this module! Only give access to it to trusted admin users.

Screenshots

Select files:

Dirty edit screenshot

Edit files (fullscreen edit is available):

Dirty edit screenshot

Todo

  • Handle file types to auto setup codemirror highlighting mode

About

Django application to edit files from the admin interface

Resources

Stars

Watchers

Forks

Packages

No packages published