django-admin2/docs/installation.rst

103 lines
2.3 KiB
ReStructuredText
Raw Normal View History

============
Installation
============
2013-07-06 07:58:47 +00:00
.. index:: installation
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
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"
Add djadmin2 urls to your URLconf:
.. 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)),
]
Development Installation
=========================
2013-07-06 10:23:36 +00:00
See :doc:`contributing`.
2013-09-18 09:53:32 +00:00
Migrating from 0.6.x
2013-09-18 09:53:32 +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
INSTALLED_APPS += ('djadmin2.themes.djadmin2theme_bootstrap3',)
ADMIN2_THEME_DIRECTORY = "djadmin2theme_bootstrap3"
REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 10
}
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)),
]
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"