django-admin2/README.rst

94 lines
2.6 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:35:33 +00:00
**Warning:** This project is currently in an **alpha** state and currently not meant for real projects.
2013-05-14 12:12:32 +00:00
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
Contributing
=============
Yes please! Please read our formal contributing document at: https://django-admin2.readthedocs.org/en/latest/contributing.html
2013-05-19 13:35:33 +00:00
Features (current)
====================
2013-05-18 06:44:31 +00:00
2013-05-19 13:35:33 +00:00
* Easy-to-extend API that follows similar patterns to ``django.contrib.admin``.
* Built-in RESTFUL API powered by ``django-rest-framework``.
2013-05-19 15:23:58 +00:00
* Default theme built on Twitter Bootstrap that is just starting to act like the current Django admin.
2013-05-19 13:35:33 +00:00
* Easy to implement theme system.
* Basic permission controls.
Features (Planned)
====================
* Much improved documentation including tutorials and reference guides.
* Extending existing views
* Interacting with the basic Admin2 object.
2013-05-19 15:23:58 +00:00
* Improved permission controls
2013-05-18 06:44:31 +00:00
2013-05-19 08:17:45 +00:00
Requirements
=============
* Django 1.5+
* Python 2.7+ (Python 3.3+ support is pending)
* django-braces
* django-rest-framework
2013-05-19 13:35:33 +00:00
* django-floppyforms
2013-05-19 08:17:45 +00:00
* Sphinx (for documentation)
2013-05-18 06:44:31 +00:00
2013-05-14 12:12:32 +00:00
Basic Pattern
==============
Our goal is to make this API work:
.. code-block:: python
2013-05-14 12:12:32 +00:00
# Import your custom models
from .models import Post, Comment
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from django.contrib.auth.models import User
2013-05-14 12:12:32 +00:00
import djadmin2
from djadmin2.models import ModelAdmin2
2013-05-14 12:12:32 +00:00
class UserAdmin2(ModelAdmin2):
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
Themes
========
The default theme is whatever bootstrap is most current. Specifically:
.. code-block:: python
2013-05-18 10:57:01 +00:00
ADMIN2_THEME_DIRECTORY = "admin2/bootstrap/"
If you create a new theme, please define it thus:
.. code-block:: python
2013-05-18 10:57:01 +00:00
ADMIN2_THEME_DIRECTORY = "admin2/foundation/"
REST API
==========
2013-05-17 22:17:56 +00:00
We plan to expose a REST API using Django Rest Framework. From this, you can define new themes powered by the client framework of your choice.