@@ -46,14 +46,7 @@ This will output all GDAPS log messages to the console.
Frontend support
----------------
If you want to add frontend support to your project, you need to do as follows:
.. code-block:: bash
pip install gdaps-frontend
Add ``gdaps.frontend`` (before ``gdaps``), and ``webpack_loader`` to Django.
If you want to add frontend support to your project, you need to add ``gdaps.frontend`` (before ``gdaps``!), and ``webpack_loader`` to Django.
Frontend engines are packed in plugin eggs. You can easily install them using pip, e.g.
...
...
@@ -78,28 +71,38 @@ Available plugins ATM:
There are some keys in this section to configure:
mandatory parameters
^^^^^^^^^^^^^^^^^^^^
PROJECT_NAME *
A (machine) name for your project. Django itself does not provide such a name. It ill be used in various places, e.g. when creating frontends for plugins. Must be a valid python identifier.
``PROJECT_NAME``
^^^^^^^^^^^^^^^^
A (machine) name for your project. Django itself does not provide such a name. It ill be used in various places, e.g. when creating frontends for plugins. Must be a valid python identifier.
``FRONTEND_DIR``
^^^^^^^^^^^^^^^^
This is the directory for the frontend, relative to DJANGO_ROOT.
Default: ``frontend``
optional parameters
``FRONTEND_ENGINE``
^^^^^^^^^^^^^^^^^^^
The engine which is used for setting up a frontend. ATM it can only be "vue". In future, maybe other engines are supported (Angular, React, etc.). PRs welcome.
FRONTEND_DIR
This is the directory for the frontend, relative to DJANGO_ROOT.
Default is "frontend".
``FRONTEND_PKG_MANAGER``
^^^^^^^^^^^^^^^^^^^^^^^^
This is the package manager used to init/install packages. It depends on your frontend which are available.
FRONTEND_ENGINE
The engine which is used for setting up a frontend. ATM it can only be "vue". In future, maybe other engines are supported (Angular, React, etc.). PRs welcome.
``PROJECT_TITLE``
^^^^^^^^^^^^^^^^^
A title for your project. If left empty, PROJECT_NAME is taken (without hyphens/underlines and capitalized).
FRONTEND_PKG_MANAGER
This is the package manager used to init/install packages. It depends on your frontend which are available.
Default: ``PROJECT_NAME``, without underlines and capitalized.
``ADMIN``
^^^^^^^^^
True if your app should add the GDAPS specific parts to the Django admin panel. You can e.g. see the installed plugins there.
PROJECT_TITLE
A title for your project. If left empty, PROJECT_NAME is taken (without hyphens/underlines and capitalized).
Default: ``True``
URL handling
------------
...and finally add the URL path for redirecting all to the frontend engine:
.. code-block:: python
...
...
@@ -111,11 +114,12 @@ PROJECT_TITLE
# ... add your fixed URL patterns here, like "admin/", etc.
]
Final step
----------
Now you can initialize the frontend with
.. code-block:: bash
./manage.py initfrontend
This creates a basic boilerplate (previously created with 'vue create' and calls *yarn install* to
install the needed javascript packages.
This creates a basic boilerplate frontend, depending on which engine is installed.