My favorites | Sign in
Logo
             
Search
for
Updated Nov 13, 2009 by sehmaschine
Installation  

Installation

Before Installing Grappelli, please take a look at the known Django Issues.

  1. Download Grappelli
  2. Install Grappelli anywhere on your python-path.
    svn checkout http://django-grappelli.googlecode.com/svn/trunk/grappelli/ grappelli
  3. Add Grappelli to your INSTALLED APPS
  4. Open your projects settings-file (settings.py) and add Grappelli to your INSTALLED APPS.
    INSTALLED_APPS = (
        ...
        'grappelli',
    )
  5. Add context-processors
  6. Open your projects settings-file. For Grappelli, you need the request context processor. The authentication context processor is needed for the admin-interface anyway.
    TEMPLATE_CONTEXT_PROCESSORS = (
        "django.core.context_processors.auth",
        "django.core.context_processors.request",
    )
  7. Change urls.py
  8. Add Grappelli to your url-definitions.
    (r'^grappelli/', include('grappelli.urls')),
  9. Change grappelli/settings.py
  10. Take a look at the available grappelli-settings and change them (if needed).
  11. Sync your Database
  12. Run the Django 'syncdb' command to create the appropriate tables.
    python manage.py syncdb
    This will create the tables for Bookmarks, Help & Navigation.
  13. Optional: Load Fixtures
  14. It´s recommended to load some initial data.
    python manage.py loaddata grappelli_navigation.json --settings=settings
    python manage.py loaddata grappelli_help.json --settings=settings
    Note that the Admin-Links within the Fixtures begin with /admin/ ... if your Admin-Interface is accessible via a different URL, you have to change this (either change the json-files before loading or change the URLs afterwards).
  15. Copy/Symlink media
  16. Copy the folder /media/ to your admin media-directory. Alternatively, you might want to use a symlink.
    cp -R /path/to/grappelli/media /path/to/your/admin/media
    Note: If possible, avoid using /django/contrib/admin/media/ as your media directory (since it will break future django-updates).
    If your ADMIN_MEDIA_PREFIX is /media/admin/ (for example), you need a directory "admin" within your media-directory. Inside of /admin/, you need all Grappelli media files.
  17. Copy/Symlink Templates
  18. Copy the folder /template/ to your admin templates-directory. Alternatively, you might want to use a symlink. Note: Avoid using "/django/contrib/admin/templates/" since it will break future django-updates.
    cp -R /path/to/grappelli/templates /path/to/your/admin/templates
    In order to overwrite the original admin-templates you need to make sure that your TEMPLATE_LOADERS are looking at the Filesystem first:
    TEMPLATE_LOADERS = (
        'django.template.loaders.filesystem.load_template_source',
        'django.template.loaders.app_directories.load_template_source',
    )
    This step is necessary in order to overwrite Djangos Admin-Templates.

Comment by coltonprovias, Jan 04 (2 days ago)

Just a small recommendation to simplify the installation. Make sure grappelli comes before django.contrib.admin in the INSTALLED_APPS. This way, it will scan the grappelli templates first before it even hits the admin templates folder. There is no need to do step 9, except for making sure that the TEMPLATE_LOADERS variable is set correctly (default TEMPLATE_LOADERS works).


Sign in to add a comment
Hosted by Google Code