2013-07-06 07:55:29 +00:00
|
|
|
============
|
|
|
|
|
Installation
|
|
|
|
|
============
|
|
|
|
|
|
2013-07-06 07:58:47 +00:00
|
|
|
.. index:: installation
|
|
|
|
|
|
2013-07-06 07:55:29 +00:00
|
|
|
Adding django-admin2 to your project
|
|
|
|
|
====================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
2016-05-26 09:34:21 +00:00
|
|
|
INSTALLED_APPS = (
|
|
|
|
|
...
|
|
|
|
|
'djadmin2',
|
|
|
|
|
'djadmin2.themes.djadmin2theme_bootstrap3', # for the default theme
|
|
|
|
|
'rest_framework', # for the browsable API templates
|
|
|
|
|
...
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
REST_FRAMEWORK = {
|
|
|
|
|
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
|
|
|
|
|
'PAGE_SIZE': 10
|
|
|
|
|
}
|
|
|
|
|
ADMIN2_THEME_DIRECTORY = "djadmin2theme_bootstrap3"
|
2013-07-06 07:55:29 +00:00
|
|
|
|
|
|
|
|
Add djadmin2 urls to your URLconf:
|
|
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
2016-05-28 00:15:22 +00:00
|
|
|
# urls.py
|
|
|
|
|
from django.conf.urls import include
|
2013-07-06 07:55:29 +00:00
|
|
|
|
2016-05-28 00:15:22 +00:00
|
|
|
from djadmin2.site import djadmin2_site
|
2013-07-06 07:55:29 +00:00
|
|
|
|
2016-05-28 00:15:22 +00:00
|
|
|
djadmin2_site.autodiscover()
|
|
|
|
|
|
|
|
|
|
urlpatterns = [
|
2013-07-06 07:55:29 +00:00
|
|
|
...
|
2016-06-06 09:52:27 +00:00
|
|
|
url(r'^admin2/', include(djadmin2_site.urls)),
|
2016-05-28 00:15:22 +00:00
|
|
|
]
|
2013-07-06 07:55:29 +00:00
|
|
|
|
|
|
|
|
Development Installation
|
|
|
|
|
=========================
|
|
|
|
|
|
2013-07-06 10:23:36 +00:00
|
|
|
See :doc:`contributing`.
|
2013-09-18 09:53:32 +00:00
|
|
|
|
2016-05-27 09:32:20 +00:00
|
|
|
Migrating from 0.6.x
|
2013-09-18 09:53:32 +00:00
|
|
|
====================
|
|
|
|
|
|
2016-05-27 09:32:20 +00:00
|
|
|
- The default theme has been updated to bootstrap3, be sure to replace your reference to the new one.
|
|
|
|
|
- Django rest framework also include multiple pagination system, the only one supported now is the PageNumberPagination.
|
|
|
|
|
|
|
|
|
|
Therefore, your `settings` need to include this:
|
2013-09-18 09:53:32 +00:00
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
|
|
# In settings.py
|
2016-05-26 09:34:21 +00:00
|
|
|
INSTALLED_APPS += ('djadmin2.themes.djadmin2theme_bootstrap3',)
|
2016-05-27 09:32:20 +00:00
|
|
|
ADMIN2_THEME_DIRECTORY = "djadmin2theme_bootstrap3"
|
|
|
|
|
|
2016-05-26 09:34:21 +00:00
|
|
|
REST_FRAMEWORK = {
|
|
|
|
|
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
|
|
|
|
|
'PAGE_SIZE': 10
|
|
|
|
|
}
|
2016-05-27 09:32:20 +00:00
|
|
|
|
|
|
|
|
|
2016-05-28 00:15:22 +00:00
|
|
|
The default admin2 site has move into djadmin2.site make sure your use the news djadmin2_site in your urls.py:
|
|
|
|
|
|
|
|
|
|
.. code-block:: python
|
|
|
|
|
|
|
|
|
|
# urls.py
|
|
|
|
|
from django.conf.urls import include
|
|
|
|
|
|
|
|
|
|
from djadmin2.site import djadmin2_site
|
|
|
|
|
|
|
|
|
|
djadmin2_site.autodiscover()
|
|
|
|
|
|
|
|
|
|
urlpatterns = [
|
|
|
|
|
...
|
2016-06-06 09:52:27 +00:00
|
|
|
url(r'^admin2/', include(djadmin2_site.urls)),
|
2016-05-28 00:15:22 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
2016-05-27 09:32:20 +00:00
|
|
|
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"
|