Extendable, adaptable rewrite of django.contrib.admin
Find a file
Germano Gabbianelli 606db2fe7a Added tests for pull-request #386
1. Custom views should be prepended to the 'views' list, otherwise they
   could be shadowed by views of the superclass.
2. Custom views should not be added to the superclass 'views' list.
   Instead a new list should be created and assigned to the class.
2013-12-05 12:48:55 +01:00
.tx Fixed bug in .tx/config 2013-07-09 11:43:44 +02:00
djadmin2 Added tests for pull-request #386 2013-12-05 12:48:55 +01:00
docs Remove deprecated setup_environ call from the docs configuration script. That made the documentation building fail for Django 1.6. Part of a Fix for #387. 2013-11-28 13:12:50 +01:00
example Make sure that the urls.py is loaded before the tests are run. Django 1.6 doesn't guarantee this anymore. Part of a Fix for #387. 2013-11-28 12:03:08 +01:00
example2 Move default theme to it's own app. This way we are following the same pattern that other themes will have to use fix #333 2013-07-18 17:55:08 +02:00
screenshots #205; Added change user screenshot 2013-06-23 21:36:19 -07:00
.coveragerc Excluding tests from coverage 2013-07-16 23:45:15 +02:00
.gitignore Fix missing enctype="multipart/form-data" when needed 2013-09-11 22:20:38 +08:00
.travis.yml It should fix #285 2013-07-16 20:50:44 +02:00
AUTHORS.rst Add @yarbelk to authors and update the history file 2013-09-11 22:13:00 +02:00
CONTRIBUTING.rst Adding a contributing document 2013-06-24 16:05:44 +02:00
fabfile.py PEP8 2013-07-09 13:52:07 +02:00
HISTORY.rst Add empty form fix to history. 2013-11-05 22:16:19 -08:00
LICENSE boilerplate 2013-05-14 14:24:31 +02:00
MANIFEST.in Fix setup.py issue 2013-07-14 15:29:20 +02:00
README.rst Adding migration 2013-09-18 11:53:32 +02:00
requirements.txt It should fix #325 2013-07-16 20:36:03 +02:00
runtests.py Fix missing enctype="multipart/form-data" when needed 2013-09-11 22:20:38 +08:00
setup.py finish of final README update 2013-07-14 11:54:57 +02:00

===============
django-admin2
===============

.. image:: https://travis-ci.org/pydanny/django-admin2.png
   :alt: Build Status
   :target: https://travis-ci.org/pydanny/django-admin2
.. image:: https://coveralls.io/repos/pydanny/django-admin2/badge.png?branch=develop
   :alt: Coverage Status
   :target: https://coveralls.io/r/pydanny/django-admin2
.. image:: https://pypip.in/v/django-admin2/badge.png
   :target: https://crate.io/packages/django-admin2/
.. image:: https://pypip.in/d/django-admin2/badge.png
   :target: https://crate.io/packages/django-admin2/

One of the most useful parts of ``django.contrib.admin`` is the ability to
configure various views that touch and alter data. django-admin2 is a complete
rewrite of that library using modern Class-Based Views and enjoying a design
focused on extendibility and adaptability. By starting over, we can avoid the
legacy code and make it easier to write extensions and themes.

Full Documentation at: http://django-admin2.rtfd.org/

Features
=============

* Rewrite of the Django Admin backend
* Drop-in themes
* Built-in RESTful API

Screenshots
===========

.. image:: https://github.com/pydanny/django-admin2/raw/develop/screenshots/Site_administration.png
    :width: 722px
    :alt: Site administration
    :align: center
    :target: https://github.com/pydanny/django-admin2/raw/develop/screenshots/Site_administration.png

.. image:: https://github.com/pydanny/django-admin2/raw/develop/screenshots/Select_user.png
    :width: 722px
    :alt: Select user
    :align: center
    :target: https://github.com/pydanny/django-admin2/raw/develop/screenshots/Select_user.png

Requirements
=============

* Django 1.5+
* Python 2.7+ or Python 3.3+
* django-braces_
* django-extra-views_
* django-floppyforms_
* django-rest-framework_
* django-filter_
* Sphinx_ (for documentation)

.. _django-braces: https://github.com/brack3t/django-braces
.. _django-extra-views: https://github.com/AndrewIngram/django-extra-views
.. _django-floppyforms: https://github.com/brutasse/django-floppyforms
.. _django-rest-framework: https://github.com/tomchristie/django-rest-framework
.. _django-filter: https://github.com/alex/django-filter
.. _Sphinx: http://sphinx-doc.org/



Installation
============

Use pip to install from PyPI:

.. code-block:: python

   pip install django-admin2

Add djadmin2 and rest_framework to your settings file:

.. code-block:: python

    INSTALLED_APPS = (
        ...
        'djadmin2',
        'rest_framework', # for the browsable API templates
        'floppyforms', # For HTML5 form fields
        'crispy_forms', # Required for the default theme's layout
        ...
    )
    
Add the default theme in your settings file:

.. code-block:: python

    # In settings.py
    INSTALLED_APPS += ('djadmin2.themes.djadmin2theme_default',)
    ADMIN2_THEME_DIRECTORY = "djadmin2theme_default/"

Add djadmin2 urls to your URLconf:

.. code-block:: python

   # urls.py
   from django.conf.urls import patterns, include

   import djadmin2

   djadmin2.default.autodiscover()


   urlpatterns = patterns(
      ...
      url(r'^admin2/', include(djadmin2.default.urls)),
   )


How to write django-admin2 modules
=====================================

.. code-block:: python

  # myapp/admin2.py
  # Import your custom models
  from django.contrib.auth.forms import UserCreationForm, UserChangeForm
  from django.contrib.auth.models import User

  from .models import Post, Comment

  import djadmin2


  class UserAdmin2(djadmin2.ModelAdmin2):
      # Replicates the traditional admin for django.contrib.auth.models.User
      create_form_class = UserCreationForm
      update_form_class = UserChangeForm


  #  Register each model with the admin
  djadmin2.default.register(Post)
  djadmin2.default.register(Comment)
  djadmin2.default.register(User, UserAdmin2)

Migrating from 0.5.x
====================

Themes are now defined explicitly, including the default theme. Therefore, your `settings` need to include this:

.. code-block:: python

    # In settings.py
    INSTALLED_APPS += ('djadmin2.themes.djadmin2theme_default',)
    ADMIN2_THEME_DIRECTORY = "djadmin2theme_default/"


Drop-In Themes
===============

The default theme is whatever bootstrap is most current. Specifically:

.. code-block:: python

    # In settings.py
    INSTALLED_APPS += ('djadmin2.themes.djadmin2theme_default',)
    ADMIN2_THEME_DIRECTORY = "djadmin2theme_default/"

If you create a new theme, you define it thus:

.. code-block:: python

    # In settings.py
    # Mythical theme! This does not exit... YET!
    INSTALLED_APPS += ('djadmin2theme_foundation',)
    ADMIN2_THEME_DIRECTORY = "djadmin2theme_foundation/"


Support this project!
======================

You can hire the lead maintainer to perform dedicated work on this package. Please email pydanny@cartwheelweb.com.