Skip to content

Commit

Permalink
[Docs] finalize geonode-project debug setup and startup section
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed Jun 28, 2019
1 parent 84591ff commit cbe5405
Show file tree
Hide file tree
Showing 9 changed files with 156 additions and 30 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions docs/admin/admin_panel/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -985,5 +985,86 @@ Through this interface you will be able to selectively decide members which can
Menus, Items and Placeholders
=============================

GeoNode provides some integrated functionalities allowing you to quickly and easily customize the top-bar menu (see the example below).

.. figure:: img/admin-panel-menus-0000.png
:align: center

*GeoNode Top-Bar Menu customization*

With minor changes of the ``basic.html`` template, potentially, it could be possible to use the same approach for a more complex customization.
Let's start with the simple one.

By default GeoNode provides a custom ``placeholder`` already defined into the ``basic.html`` template, called ``TOPBAR_MENU``

.. code-block:: python
...
<ul class="nav navbar-nav navbar-right">
{% block my_extra_right_tab %}
{% render_nav_menu 'TOPBAR_MENU' %}
{% endblock my_extra_right_tab %}
<li>
<div class="search">
<form id="search" action="{% url "search" %}" >
<span class="fa fa-search"></span>
{% if HAYSTACK_SEARCH %}
<input id="search_input" type="text" placeholder="{% trans 'Search' %}" name="q">
{% else %}
<input id="search_input" type="text" placeholder="{% trans 'Search' %}" name="title__icontains">
{% endif %}
</form>
</div>
</li>
...
From the :guilabel:`Admin > Base` panel, it is possible to access to the ``Menu``, ``Menu Items`` and ``Menu Placeholder`` options.

.. figure:: img/admin-panel-menus-0001.png
:align: center

*Menu, Menu Items and Menu Placeholder options on the Admin panel*

The hierarchical structure of a custom ``Menu`` is the following one:

1. ``Menu Placeholder``; first of all you need to define a *placeholder* both into the :guilabel:`Admin > Base` panel and the ``basic.html`` template, using the same **keyword**.
By default GeoNode provides an already defined one called ``TOPBAR_MENU``

.. figure:: img/admin-panel-menus-0002.png
:align: center

*The default ``TOPBAR_MENU`` Menu Placeholder on the Admin panel*

2. ``Menu``; second thing to do is to create a new *menu* associated to the corresponding *placeholder*.
This is still possible from the :guilabel:`Admin > Base` panel

.. figure:: img/admin-panel-menus-0003.png
:align: center

*Create a new Menu from the Admin panel*

You will need to provide:

* A ``Title``, representing the name of the ``Menu`` visible by the users

.. warning:: By using this approach, internationalization won't be supported. For the time being GeoNode does not support this for menus created from the :guilabel:`Admin > Base` panel.

* A ``Menu Placeholder`` from the existing ones.

* A ``Order`` in the case you'll create more menus associated to the same placeholder.

3. ``Menu Item``; finally you will need to create voices belonging to the *menu*. For the time being, GeoNode allows you to create only ``href`` links.

.. figure:: img/admin-panel-menus-0004.png
:align: center

*Create a new Menu Item from the Admin panel*

.. note:: The ``Menu`` will be visbile

OAuth2 Access Tokens
====================
8 changes: 8 additions & 0 deletions docs/basic/settings/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1589,6 +1589,14 @@ THESAURI
A list of Keywords thesauri settings:
For example `THESAURI = [{'name':'inspire_themes', 'required':True, 'filter':True}, {'name':'inspire_concepts', 'filter':True}, ]`

TOPICCATEGORY_MANDATORY
-----------------------

| Default: ``False``
| Env: ``TOPICCATEGORY_MANDATORY``
If this option is enabled, Topic Categories will become strictly Mandatory on Metadata Wizard

TWITTER_CARD
------------

Expand Down
2 changes: 2 additions & 0 deletions docs/install/core/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ Sign-in with::
user: admin
password: admin

.. _configure_dbs_core:

Postgis database Setup
^^^^^^^^^^^^^^^^^^^^^^

Expand Down
93 changes: 64 additions & 29 deletions docs/install/project/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,48 +97,34 @@ See also the `README <https://github.com/GeoNode/geonode-project/blob/master/REA

First of all we need to prepare a new Python Virtual Environment

Check that the file ``virtualenvwrapper.sh`` exists in the ``$HOME/.local/bin/`` (``$HOME`` is the current user home directory and in our case should be ``/home/geonode``) and then add this line to your file ``~/.bashrc``

.. code-block:: shell
vim ~/.bashrc
Prepare the environment

.. code-block:: shell
# virtualenv
source $HOME/.local/bin/virtualenvwrapper.sh
sudo mkdir -p /opt/geonode_custom/
sudo usermod -a -G www-data geonode
sudo chown -Rf geonode:www-data /opt/geonode_custom/
sudo chmod -Rf 775 /opt/geonode_custom/
Then run the ``.bashrc`` from shell
Clone the source code

.. code-block:: shell
source ~/.bashrc
#create a new virtualenv called geonode
mkvirtualenv --no-site-packages geonode
At this point, your command prompt shows a ``(geonode)`` prefix, this indicates that your virtualenv is active.

.. note:: The next time you need to access the Virtual Environment just run

.. code-block:: shell
cd /opt/geonode_custom/
git clone https://github.com/GeoNode/geonode-project.git
workon geonode
Make an instance out of the ``Django Template``

.. note:: We will call our instance ``my_geonode``. You can change the name at your convenience.

.. code-block:: shell
# Let's create the GeoNode core base folder and clone it
sudo mkdir -p /opt/geonode/
sudo usermod -a -G www-data geonode
sudo chown -Rf geonode:www-data /opt/geonode/
sudo chmod -Rf 775 /opt/geonode/
# Clone the GeoNode source code on /opt/geonode
cd /opt
git clone https://github.com/GeoNode/geonode.git geonode
mkvirtualenv my_geonode
pip install Django==1.11.21
django-admin startproject --template=./geonode-project -e py,rst,json,yml,ini,env,sample -n Dockerfile my_geonode
# Install the Python packages
cd /opt/geonode
cd /opt/geonode_custom/my_geonode
pip install -r requirements.txt --upgrade --no-cache --no-cache-dir
pip install -e . --upgrade --no-cache --no-cache-dir
Expand All @@ -147,10 +133,59 @@ At this point, your command prompt shows a ``(geonode)`` prefix, this indicates
PYGDAL_VERSION="$(pip install pygdal==$GDAL_VERSION 2>&1 | grep -oP '(?<=: )(.*)(?=\))' | grep -oh $GDAL_VERSION\.[0-9])"; \
pip install pygdal==$PYGDAL_VERSION
Run GeoNode Project for the first time in DEBUG Mode
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. warning::

Be sure you have successfully completed all the steps of the section :ref:`install_dep_proj`.

This command will run both GeoNode and GeoServer locally after having prepared the SQLite database. The server will start in ``DEBUG`` (or ``DEVELOPMENT``) mode, and it will start the following services:

#. GeoNode on ``http://localhost:8000/``
#. GeoServer on ``http://localhost:8080/geoserver/``

This modality is beneficial to debug issues and/or develop new features, but it cannot be used on a production system.

.. code-block:: shell
# Prepare the GeoNode SQLite database (the first time only)
paver setup
paver sync
.. note::

In case you want to start again from a clean situation, just run

.. code:: shell
paver reset_hard
.. warning:: This will blow up completely your ``local_settings``, delete the SQLlite database and remove the GeoServer data dir.

.. code-block:: shell
# Run the server in DEBUG mode
paver start
Once the server has finished the initialization and prints on the console the sentence ``GeoNode is now available.``, you can open a browser and go to::

http://localhost:8000/

Sign-in with::

user: admin
password: admin


From now on, everything already said for GeoNode Core (plese refer to the section :ref:`configure_dbs_core` and following), applies to a
GeoNode Project.

**Be careful** to use the **new** paths and names everywhere:

* Everytime you'll find the keyword ``goenode``, you'll need to use your geonode custom name instead (in this example ``my_geonode``).

TODO
* Everytime you'll find paths pointing to ``/opt/geonode/``, you'll need to update them to point to your custom project instead (in this example ``/opt/geonode_custom/my_geonode``).

Docker
======
Expand Down
2 changes: 1 addition & 1 deletion geonode/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
{% endif %}
</form>
</div>
</li>
</li>
{% if not user.is_authenticated and ACCOUNT_OPEN_SIGNUP %}
<li><a href="{% url "account_signup" %}">{% trans "Register" %}</a></li>
{% endif %}
Expand Down

0 comments on commit cbe5405

Please sign in to comment.