django-admin2/README.rst

195 lines
4.9 KiB
ReStructuredText
Raw Normal View History

2013-05-14 12:12:32 +00:00
===============
django-admin2
===============
.. image:: https://travis-ci.org/pydanny/django-admin2.png
:alt: Build Status
:target: https://travis-ci.org/pydanny/django-admin2
2013-05-19 13:36:16 +00:00
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.
2013-05-18 06:44:31 +00:00
2013-07-05 14:48:46 +00:00
Features
=============
2013-07-05 14:48:35 +00:00
* Rewrite of the Django Admin backend
* Drop-in themes
* Built-in RESTful API
Screenshots
===========
.. image:: screenshots/Site_administration.png
:width: 722px
:alt: Site administration
:align: center
:target: screenshots/Site_administration.png
2013-07-05 14:48:35 +00:00
.. image:: screenshots/Select_user.png
:width: 722px
:alt: Select user
:align: center
:target: screenshots/Select_user.png
2013-05-18 06:44:31 +00:00
2013-05-19 08:17:45 +00:00
Requirements
=============
* Django 1.5+
2013-05-31 08:21:02 +00:00
* Python 2.7+ or Python 3.3+
2013-06-18 11:46:17 +00:00
* django-braces_
* django-extra-views_
* django-floppyforms_
* django-rest-framework_
* 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
.. _Sphinx: http://sphinx-doc.org/
2013-05-18 06:44:31 +00:00
2013-07-05 20:59:46 +00:00
Installation
============
2013-07-05 20:59:46 +00:00
Use pip to install from PyPI:
.. code-block:: python
pip install django-admin2
2013-07-06 00:06:07 +00:00
Add djadmin2 and rest_framework to your settings file:
2013-07-05 20:59:46 +00:00
.. code-block:: python
INSTALLED_APPS = (
...
'djadmin2',
2013-07-06 00:06:07 +00:00
'rest_framework', # for the browsable API templates
2013-07-05 20:59:46 +00:00
...
)
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)),
)
2013-07-05 14:53:04 +00:00
How to write django-admin2 modules
=====================================
2013-05-14 12:12:32 +00:00
.. code-block:: python
2013-05-14 12:12:32 +00:00
# myapp/admin2.py
# Import your custom models
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from django.contrib.auth.models import User
2013-05-14 12:12:32 +00:00
2013-06-30 09:38:39 +00:00
from .models import Post, Comment
import djadmin2
2013-05-14 12:12:32 +00:00
class UserAdmin2(djadmin2.ModelAdmin2):
2013-07-05 14:48:35 +00:00
# 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)
2013-05-17 10:38:39 +00:00
2013-07-05 14:48:35 +00:00
Drop-In Themes
===============
The default theme is whatever bootstrap is most current. Specifically:
.. code-block:: python
2013-07-05 14:53:04 +00:00
# settings.py
2013-05-18 10:57:01 +00:00
ADMIN2_THEME_DIRECTORY = "admin2/bootstrap/"
2013-07-05 14:53:04 +00:00
If you create a new theme, you define it thus:
.. code-block:: python
2013-07-05 14:53:04 +00:00
# settings.py
2013-05-18 10:57:01 +00:00
ADMIN2_THEME_DIRECTORY = "admin2/foundation/"
2013-07-05 14:48:35 +00:00
2013-06-24 04:36:19 +00:00
2013-05-31 08:21:02 +00:00
History
=========
2013-06-30 09:38:39 +00:00
0.4.0 (2013-06-30)
* Implemented both Function- and Class-based Action views
* Implemented ModelAdmin2.list_display
* Implemented ModelAdmin2.fieldsets
* Dropdown widget now displays the selected choice
* Added support for callables in ModelAdmin2.list_display
* Added screenshots to README
* Added second example project
* Fixed breadcrumbs
* Default theme: Proper closing of template and media blocks
* Default theme: Standardized indentation in default theme templates
* Default theme: Pointed to CDN for JQuery
* Default theme: Added basic style for login form
* Default theme: Internationalized all text strings
2013-05-31 08:21:02 +00:00
0.3.0 (2013-05-31)
* HTML5 forms via floppyforms.
* Many API improvements.
* Added Breadcrumbs.
* Added Login, Logout, ChangePassword views.
* Added Actions.
* Added support for inlines.
* Added view based permission controls
* Implement delete confirmations for child models.
* Testrunner now can run on a specific test set or module.
* Internal code refactoring to follow standards.
* Moved to git-flow for accepting pull requests.
* Model create/update pages now have save options.
* Added i18n to all templates, much of internal code.
* All print statements replaced with proper logging.
* Design goals specified in the documentation.
0.2.0 (2013-05-19)
* Birth! (Working Prototype)
* Easy-to-extend API that follows similar patterns to django.contrib.admin.
* Built-in RESTFUL API powered by django-rest-framework.
* Default theme built on Twitter Bootstrap.
* Easy to implement theme system.
* Basic permission controls.
* Testrunner
* Documentation
0.1.1 (2013-05-17)
* Code adoption from django-mongonaut.
* Preperation for Django Circus sprints.
0.1 (2013-05-13)
2013-05-17 22:17:56 +00:00
2013-05-31 08:21:02 +00:00
* Discussion with Russell Keith-Magee.
2013-06-24 04:36:19 +00:00
* Inception.