2013-05-18 11:00:51 +00:00
|
|
|
Welcome to django-admin2's documentation!
|
|
|
|
|
=========================================
|
|
|
|
|
|
2013-05-19 08:15:50 +00:00
|
|
|
**django-admin2** aims to replace django's built-in admin that lives in
|
2013-05-18 11:05:19 +00:00
|
|
|
``django.contrib.admin``. Come and help us, have a look at the
|
|
|
|
|
:doc:`contributing` page and see our `GitHub`_ page.
|
|
|
|
|
|
2013-05-19 08:15:50 +00:00
|
|
|
This project is intentionally backwards-incompatible with ``django.contrib.admin``.
|
|
|
|
|
|
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
|
|
|
|
|
* Sphinx (for documentation)
|
|
|
|
|
|
2013-05-19 08:15:50 +00:00
|
|
|
|
2013-05-18 11:30:45 +00:00
|
|
|
Basic API
|
|
|
|
|
==============
|
|
|
|
|
|
|
|
|
|
Our goal is to make this API work:
|
|
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
2013-05-30 10:33:00 +00:00
|
|
|
# myapp/admin2.py
|
2013-05-18 16:09:59 +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-18 11:30:45 +00:00
|
|
|
|
2013-05-18 16:09:59 +00:00
|
|
|
import djadmin2
|
2013-05-30 10:33:00 +00:00
|
|
|
from djadmin2.admins import ModelAdmin2
|
2013-05-18 11:30:45 +00:00
|
|
|
|
|
|
|
|
|
2013-05-18 16:09:59 +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-18 11:30:45 +00:00
|
|
|
|
|
|
|
|
|
2013-05-30 10:33:00 +00:00
|
|
|
.. _GitHub: https://github.com/twoscoops/django-admin2
|
2013-05-18 11:05:19 +00:00
|
|
|
|
|
|
|
|
Content
|
|
|
|
|
-------
|
2013-05-18 11:00:51 +00:00
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
|
:maxdepth: 2
|
|
|
|
|
|
2013-05-18 11:05:19 +00:00
|
|
|
contributing
|
2013-05-18 11:53:16 +00:00
|
|
|
design
|
2013-05-20 08:33:31 +00:00
|
|
|
architecture
|
|
|
|
|
api
|
2013-05-19 12:51:43 +00:00
|
|
|
themes
|
2013-05-18 14:32:22 +00:00
|
|
|
meta
|
2013-05-22 15:37:02 +00:00
|
|
|
reference
|
|
|
|
|
tutorial
|
2013-05-18 11:00:51 +00:00
|
|
|
|
2013-05-19 08:17:45 +00:00
|
|
|
|
2013-05-18 11:00:51 +00:00
|
|
|
Indices and tables
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
* :ref:`genindex`
|
|
|
|
|
* :ref:`modindex`
|
|
|
|
|
* :ref:`search`
|