update docs

This commit is contained in:
Artur Barseghyan 2018-08-07 22:39:50 +02:00
parent bd2b5224ea
commit 79427f5377
2 changed files with 64 additions and 25 deletions

View file

@ -271,22 +271,39 @@ Or latest stable version from BitBucket:
# ...
)
(3) Make appropriate changes to the ``TEMPLATES`` of the your projects'
Django settings.
(3) Make appropriate changes to the ``TEMPLATE_CONTEXT_PROCESSORS`` of the your
projects' Django settings.
And the following to the context processors.
And ``fobi.context_processors.theme`` and
``fobi.context_processors.dynamic_values``. See the following example.
.. code-block:: python
TEMPLATE_CONTEXT_PROCESSORS = (
# ...
"fobi.context_processors.theme",
# ...
)
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [(os.path.join('path', 'to', 'your', 'templates'))],
'OPTIONS': {
'context_processors': [
"django.template.context_processors.debug",
'django.template.context_processors.request',
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"fobi.context_processors.theme", # Important!
"fobi.context_processors.dynamic_values", # Optional
],
'loaders': [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'admin_tools.template_loaders.Loader',
],
'debug': DEBUG_TEMPLATE,
}
},
]
Make sure that ``django.core.context_processors.request`` is in
``TEMPLATE_CONTEXT_PROCESSORS`` too.
``context_processors`` too.
(4) Configure URLs
@ -2000,11 +2017,19 @@ passed as a context variable.
.. code-block:: python
TEMPLATE_CONTEXT_PROCESSORS = (
# ...
"fobi.context_processors.dynamic_values",
# ...
)
TEMPLATES = [
{
# ...
'OPTIONS': {
# ...
'context_processors': [
# ...
"fobi.context_processors.theme", # Important!
"fobi.context_processors.dynamic_values", # Optional
]
},
},
]
.. code-block:: python

View file

@ -161,18 +161,33 @@ Putting all together, you would have something like this.
TEMPLATE_CONTEXT_PROCESSORS
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Add ``django.core.context_processors.request`` and
``fobi.context_processors.theme`` to ``TEMPLATE_CONTEXT_PROCESSORS`` of
``fobi.context_processors.theme`` to ``TEMPLATES`` of
your ``settings`` module.
.. code-block:: python
TEMPLATE_CONTEXT_PROCESSORS = (
# ...
"django.core.context_processors.request",
"fobi.context_processors.theme", # Obligatory
"fobi.context_processors.dynamic_values", # Optional
# ...
)
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [(os.path.join('path', 'to', 'your', 'templates'))],
'OPTIONS': {
'context_processors': [
"django.template.context_processors.debug",
'django.template.context_processors.request',
"django.contrib.auth.context_processors.auth",
"django.contrib.messages.context_processors.messages",
"fobi.context_processors.theme", # Important!
"fobi.context_processors.dynamic_values", # Optional
],
'loaders': [
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
'admin_tools.template_loaders.Loader',
],
'debug': DEBUG_TEMPLATE,
}
},
]
urlpatterns
^^^^^^^^^^^
@ -198,12 +213,11 @@ Add the following line to ``urlpatterns`` of your ``urls`` module.
Update the database
^^^^^^^^^^^^^^^^^^^
1. First you should be syncing/migrating the database. Depending on your
1. First you should migrate the database. Depending on your
Django version and migration app, this step may vary. Typically as follows:
.. code-block:: sh
./manage.py syncdb
./manage.py migrate --fake-initial
2. Sync installed ``fobi`` plugins. Go to terminal and type the following