Skip to content

Commit

Permalink
Merge pull request #449 from archesproject/master_arches_applications…
Browse files Browse the repository at this point in the history
…_update

Update arches applications example
  • Loading branch information
ekansa authored Jul 19, 2024
2 parents 19a097f + 3ac4a18 commit adca540
Showing 1 changed file with 21 additions and 29 deletions.
50 changes: 21 additions & 29 deletions docs/developing/extending/creating-apps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,65 +45,57 @@ Installing the **Arches Dashboard** App
---------------------------------------
You can add the dashboard to an Arches project in just a few easy steps.

1. Install if from this repo (or clone this repo and pip install it locally).

1. Install it from this repo (or clone this repo and pip install it locally):
.. code-block:: shell
pip install git+https://github.com/chiatt/dashboard.git
2. Add 'dashboard' as to the ARCHES_APPLICATIONS and INSTALLED_APPS settings in the demo project's settings.py file

2. Add 'dashboard' to the ``INSTALLED_APPS`` setting in the demo project's settings.py file, above your own project:
.. code-block:: python
ARCHES_APPLICATIONS = ("dashboard",) # be sure to add the trailing comma!
INSTALLED_APPS = (
# other applications already listed
"dashboard",
"demo",
)
3. Add routing to your project to handle the Arches application. This can be either subdomain routing or path-based routing.
- for subdomain routing:
- Update your hosts.py file in your project:
.. code-block:: python
- for subdomain routing:

- Update your hosts.py file in your project:

.. code-block:: python
host_patterns = patterns('',
host(re.sub(r'_', r'-', r'dashboard'), 'dashboard.urls', name='dashboard'),
host(re.sub(r'_', r'-', r'demo'), 'demo.urls', name='demo'),
)
host_patterns = patterns('',
host(re.sub(r'_', r'-', r'dashboard'), 'dashboard.urls', name='dashboard'),
host(re.sub(r'_', r'-', r'demo'), 'demo.urls', name='demo'),
)
- for path-based routing:
- Update your urls.py file in your project. You'll likely need to add the `re_path` import:
.. code-block:: python
- Update your urls.py file in your project. You'll likely need to add the `re_path` import:

.. code-block:: python
from django.urls import include, path, re_path
from django.urls import include, path, re_path
- and then the following path:
.. code-block:: python
and then the following path:

.. code-block:: python
re_path(r"^", include("dashboard.urls")),
re_path(r"^", include("dashboard.urls")),
4. From your project run migrate to add the model included in the app:

.. code-block:: shell
python manage.py migrate
5. Next be sure to rebuild your project's frontend to include the plugin:

.. code-block:: shell
npm run build_development
6. When you're done you should see the Dashboard plugin added to you main navigation bar:

6. When you're done you should see the Dashboard plugin added to your main navigation bar:
.. figure:: ../../images/dev/demo-arches-app-dashboard-screenshot.png
:width: 100%
:align: center
Expand Down

0 comments on commit adca540

Please sign in to comment.