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

adds subdomain routing documentation #425

Merged
merged 2 commits into from
Jun 5, 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
32 changes: 20 additions & 12 deletions docs/developing/extending/creating-apps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,32 @@ You can add the dashboard to an Arches project in just a few easy steps.
.. code-block:: python

ARCHES_APPLICATIONS = ("dashboard",) # be sure to add the trailing comma!
INSTALLED_APPS = [
...
"demo",
"dashboard",
]


3. Update your urls.py file in your project. You'll likely need to add the `re_path` import:
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

.. code-block:: python
host_patterns = patterns('',
host(r'dashboard', 'dashboard.urls', name='dashboard'),
host(r'demo', 'demo.urls', name='demo'),
)


from django.urls import include, path, re_path
- for path-based routing:
- Update your urls.py file in your project. You'll likely need to add the `re_path` import:

and then the following path:
.. code-block:: python

.. code-block:: python
from django.urls import include, path, re_path

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:
Expand All @@ -88,7 +96,7 @@ You can add the dashboard to an Arches project in just a few easy steps.

.. code-block:: shell

yarn build_development
npm run build_development
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah! I saw this on the forum!



6. When you're done you should see the Dashboard plugin added to you main navigation bar:
Expand Down