Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update arches applications example #449

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whitespace changes are to avoid the extra level of nesting that was appearing:

Screenshot 2024-07-19 at 3 28 52 PM

Now:
Screenshot 2024-07-19 at 3 29 17 PM

I think the added bolding is a bug fixed in more recent versions of Sphinx. Don't know what version we're using to build the live site.

.. 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:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standardized the indentation

- 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