### Example Project Setup and Superuser Creation Source: https://yassi.github.io/dj-control-room/development Commands to configure the example Django project within the control room, including applying database migrations and creating an administrator user. ```bash cd example_project python manage.py migrate python manage.py createsuperuser ``` -------------------------------- ### Start Docker Services Source: https://yassi.github.io/dj-control-room/development_q= Uses the Makefile to start all necessary services for the Docker development environment. This command is part of the recommended Docker setup. ```bash make docker_up ``` -------------------------------- ### Install Django Control Room with Panels (Bash) Source: https://yassi.github.io/dj-control-room/index Installs the dj-control-room package along with all available panels using pip. This is the recommended way to get started if you want to use all official panels. ```bash pip install dj-control-room[all] ``` -------------------------------- ### Local Development Environment Setup Source: https://yassi.github.io/dj-control-room/development Steps to set up a local Python development environment, including creating a virtual environment, activating it, and installing project dependencies using 'make install' or pip. ```bash # Create virtual environment python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate # Install package and dependencies make install # or pip install -e . pip install -r requirements.txt ``` -------------------------------- ### Docker Development Environment Setup Source: https://yassi.github.io/dj-control-room/development Commands to manage the Docker-based development environment. 'docker_up' starts all necessary services, and 'docker_shell' provides access to the container's environment. ```bash make docker_up make docker_shell ``` -------------------------------- ### Install Django Control Room with Specific Panels via Pip Source: https://yassi.github.io/dj-control-room/installation_q= Installs Django Control Room along with specified optional panel extras. This allows for a customized installation based on required functionalities. Multiple panels can be installed by comma-separating their names. ```bash # Single panel pip install dj-control-room[redis] # Multiple panels pip install dj-control-room[redis,cache,urls] ``` -------------------------------- ### Install Project Dependencies Source: https://yassi.github.io/dj-control-room/development_q= Installs the project's Python packages and their dependencies using the Makefile. Alternatively, it can be installed in editable mode using pip. ```bash make install # or pip install -e . pip install -r requirements.txt ``` -------------------------------- ### Makefile Commands Summary Source: https://yassi.github.io/dj-control-room/development A list of available commands in the project's Makefile, providing shortcuts for common development tasks such as installation, testing, and Docker management. ```makefile make install make test_local make test_docker make docker_up make docker_down make docker_shell ``` -------------------------------- ### Install Django Control Room Core via Pip Source: https://yassi.github.io/dj-control-room/installation_q= Installs the core Django Control Room package without any additional panels. This is the most basic installation method. ```bash pip install dj-control-room ``` -------------------------------- ### Configure URLs in Django Project Source: https://yassi.github.io/dj-control-room/installation_q= Includes the necessary URLs for Django Control Room and its installed panels in your project's main urls.py file. Each panel is mounted with an explicit path under `/admin/`. ```python # urls.py from django.contrib import admin from django.urls import path, include urlpatterns = [ # Panel URLs - include each panel you installed path('admin/dj-redis-panel/', include('dj_redis_panel.urls')), path('admin/dj-cache-panel/', include('dj_cache_panel.urls')), path('admin/dj-urls-panel/', include('dj_urls_panel.urls')), path('admin/dj-celery-panel/', include('dj_celery_panel.urls')), path('admin/dj-signals-panel/', include('dj_signals_panel.urls')), # Control Room dashboard path('admin/dj-control-room/', include('dj_control_room.urls')), # Django admin path('admin/', admin.site.urls), ] ``` -------------------------------- ### Configuring DJ Control Room Panels (Python) Source: https://yassi.github.io/dj-control-room/configuration Shows how to configure specific panels for DJ Control Room, including adding the 'dj_redis_panel' to both registration locations for legacy admin links. This example highlights documenting configuration choices with comments. ```python DJ_CONTROL_ROOM_SETTINGS = { # Redis panel needs to be in both places for legacy admin links 'PANEL_ADMIN_REGISTRATION': { 'dj_redis_panel': True, } } ``` -------------------------------- ### Panel Optional Attributes Examples (Python) Source: https://yassi.github.io/dj-control-room/api-reference_q= Examples for setting optional attributes of a custom panel. `app_name` customizes the Django app label and URL namespace, while `package` specifies the PyPI package name to enable automatic installation instructions. ```python app_name = "my_panel" # Only needed if it differs from your dist name package = "my-panel" ``` -------------------------------- ### Minimal DJ Control Room Settings Configuration (Python) Source: https://yassi.github.io/dj-control-room/configuration_q= Demonstrates the most basic configuration for DJ Control Room, utilizing default settings. This is recommended to start with and customize only when necessary. ```python # Minimal - use defaults DJ_CONTROL_ROOM_SETTINGS = {} ``` -------------------------------- ### Check Installed dj- Packages Source: https://yassi.github.io/dj-control-room/installation_q= Lists all installed Python packages that have 'dj-' in their name. This command is useful for troubleshooting installation issues by verifying that Django Control Room and its related panels are present in the environment. ```bash pip list | grep dj- ``` -------------------------------- ### DJ Control Room Settings with Panel Registration (Python) Source: https://yassi.github.io/dj-control-room/configuration_q= Shows an example of configuring DJ Control Room settings, specifically enabling the 'dj_redis_panel' within the PANEL_ADMIN_REGISTRATION. This configuration is useful for legacy admin links. ```python DJ_CONTROL_ROOM_SETTINGS = { # Redis panel needs to be in both places for legacy admin links 'PANEL_ADMIN_REGISTRATION': { 'dj_redis_panel': True, } } ``` -------------------------------- ### Configure INSTALLED_APPS in Django Settings Source: https://yassi.github.io/dj-control-room/installation_q= Adds Django Control Room and its installed panels to the INSTALLED_APPS setting in your Django project's settings.py file. Panel apps should be listed before `dj_control_room` to ensure they appear under a single section in the admin sidebar. ```python # settings.py INSTALLED_APPS = [ # Django built-in apps 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', # Panels (add the ones you installed) 'dj_redis_panel', # If you installed [redis] 'dj_cache_panel', # If you installed [cache] 'dj_urls_panel', # If you installed [urls] 'dj_celery_panel', # If you installed [celery] 'dj_signals_panel', # If you installed [signals] # Django Control Room (list after panels so they appear in one section) 'dj_control_room', # Your apps 'myapp', # ... ] ``` -------------------------------- ### Run Django Development Server Source: https://yassi.github.io/dj-control-room/development Starts the Django development server, allowing you to view and interact with the project locally. The default URL is provided for accessing the admin interface. ```bash python manage.py runserver ``` -------------------------------- ### Run Specific Tests with Pytest Source: https://yassi.github.io/dj-control-room/development Demonstrates how to run specific test files or individual test cases using the Pytest framework for targeted testing and debugging. ```bash pytest tests/test_admin.py -v pytest tests/test_admin.py::TestAdminIntegration::test_celery_panel_appears_in_admin_index ``` -------------------------------- ### Run Django Migrations Source: https://yassi.github.io/dj-control-room/installation_q= Executes Django's database migrations. While Django Control Room itself does not have migrations, this step is part of the standard Django setup process. ```bash python manage.py migrate ``` -------------------------------- ### Install Specific Version of Django Control Room Source: https://yassi.github.io/dj-control-room/installation_q= Installs a specific version of the Django Control Room package. This can be useful for compatibility testing or rolling back to a known stable version if issues arise with the latest release. ```bash pip install dj-control-room==0.1.0 # Specify version ``` -------------------------------- ### Install Specific Django Control Room Panels (Bash) Source: https://yassi.github.io/dj-control-room/index Installs the dj-control-room package along with a selection of specific panels using pip. This allows for a more tailored installation based on your project's needs. ```bash pip install dj-control-room[redis,cache,urls,celery] ``` -------------------------------- ### Install Cookiecutter and Create Panel Source: https://yassi.github.io/dj-control-room/creating-panels This command installs the cookiecutter tool and then uses it to generate a new Django Control Room panel project from the official template. Ensure you have cookiecutter version 2.0.0 or higher installed. ```bash pip install cookiecutter # requires cookiecutter>=2.0.0 cookiecutter https://github.com/yassi/cookiecutter-dj-control-room-plugin ``` -------------------------------- ### Clone Repository and Navigate Source: https://yassi.github.io/dj-control-room/development Clones the Django Control Room repository and changes the current directory into the project root. This is the first step for any local development setup. ```bash git clone https://github.com/yassi/dj-control-room.git cd dj-control-room ``` -------------------------------- ### Upgrade Pip Source: https://yassi.github.io/dj-control-room/installation_q= Upgrades the pip package installer to the latest version. This can resolve issues related to package installation or compatibility problems with newer Python packages. ```bash pip install --upgrade pip ``` -------------------------------- ### Run All Tests Source: https://yassi.github.io/dj-control-room/development Executes the entire test suite for the project. Supports running tests within a Docker environment or directly on the local machine. ```bash # Docker make test_docker # Local make test_local ``` -------------------------------- ### Panel URL Attributes Example Source: https://yassi.github.io/dj-control-room/creating-panels This Python code demonstrates the optional `docs_url` and `pypi_url` attributes for a Django Control Room panel. These URLs are displayed on the panel's install/configure page, providing links to documentation and the PyPI package. ```python docs_url = "https://github.com/yourname/my-panel" pypi_url = "https://pypi.org/project/my-panel/" ``` -------------------------------- ### Install Panel in Editable Mode Source: https://yassi.github.io/dj-control-room/creating-panels Command to install your custom panel in editable mode, allowing for live changes during development without needing to reinstall the package. This is useful for rapid iteration. ```bash pip install -e /path/to/my-panel ``` -------------------------------- ### Install Cookiecutter for Panel Creation Source: https://yassi.github.io/dj-control-room/creating-panels_q= Installs the cookiecutter tool, which is required to use the official template for generating a new Django Control Room panel. Ensure you have cookiecutter version 2.0.0 or higher. ```bash pip install cookiecutter # requires cookiecutter>=2.0.0 ``` -------------------------------- ### Panel Package Attribute Example Source: https://yassi.github.io/dj-control-room/creating-panels This Python code shows the optional `package` attribute for a Django Control Room panel. Setting this attribute enables the install/configure page for your panel, displaying pip install instructions. ```python package = "my-panel" ``` -------------------------------- ### Collect Static Files for Production Source: https://yassi.github.io/dj-control-room/installation_q= Gathers all static files from your Django project and its apps into a single location, typically for deployment in a production environment. This command is essential for serving static assets correctly. ```bash python manage.py collectstatic ``` -------------------------------- ### Upgrade dj-control-room using pip Source: https://yassi.github.io/dj-control-room/installation_q= This snippet shows how to upgrade the dj-control-room Python package to its latest version using pip. It's a straightforward command-line operation. ```bash pip install --upgrade dj-control-room ``` ```bash pip install --upgrade dj-control-room[all] ``` -------------------------------- ### Configure Environment-Specific Settings Source: https://yassi.github.io/dj-control-room/configuration_q= Demonstrates how to use environment variables to set Django Control Room configurations, such as `REGISTER_PANELS_IN_ADMIN`. This allows for different settings in development and production. ```python # settings.py import os DJ_CONTROL_ROOM_SETTINGS = { 'REGISTER_PANELS_IN_ADMIN': os.getenv('CR_REGISTER_PANELS', 'False') == 'True', } ``` ```dotenv # .env for development CR_REGISTER_PANELS=True # .env for production CR_REGISTER_PANELS=False ``` -------------------------------- ### Panel Required Attributes Examples (Python) Source: https://yassi.github.io/dj-control-room/api-reference_q= Examples demonstrating how to set the required attributes for a custom panel. The `name` attribute provides the display name, `description` offers a brief explanation, and `icon` specifies the visual representation using predefined identifiers. ```python name = "My Panel" description = "Monitor system health and performance metrics" icon = "chart" ``` -------------------------------- ### Panel Optional Method Example (Python) Source: https://yassi.github.io/dj-control-room/api-reference_q= Example of implementing the optional `get_url_name` method for a custom panel. This method returns the URL name for the panel's main entry point, defaulting to 'index' if not overridden. ```python def get_url_name(self): return "dashboard" # Or "index", "home", etc. ``` -------------------------------- ### Create and Activate Virtual Environment Source: https://yassi.github.io/dj-control-room/development_q= Creates a Python virtual environment named 'venv' and activates it. This isolates project dependencies for local development. The activation command differs between Unix-like systems and Windows. ```bash # Create virtual environment python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate ``` -------------------------------- ### Open Shell in Docker Container Source: https://yassi.github.io/dj-control-room/development_q= Provides access to a shell within the running Docker container for development tasks. This command is used after starting services with `make docker_up`. ```bash make docker_shell ``` -------------------------------- ### Development Static Files Configuration Source: https://yassi.github.io/dj-control-room/configuration_q= Ensures static files are served automatically during development when DEBUG is set to True. No explicit configuration is needed beyond setting DEBUG. ```python # settings.py DEBUG = True # Django's static file serving handles it ``` -------------------------------- ### Verify Panel Discovery in Django Shell Source: https://yassi.github.io/dj-control-room/installation_q= Uses the Django shell to programmatically check if Django Control Room panels are correctly discovered and registered. This involves importing the registry, autodiscovering panels, and iterating through the registered panels to print their names and IDs. ```python python manage.py shell from dj_control_room.registry import registry registry.autodiscover() for panel in registry.get_panels(): print(f"{panel.name} ({panel.id})") ``` -------------------------------- ### Configure Django Control Room Settings Source: https://yassi.github.io/dj-control-room/configuration_q= Defines the initial settings for Django Control Room, including panel registration in the admin. This is typically done in the settings.py file. ```python # settings.py DJ_CONTROL_ROOM_SETTINGS = { 'REGISTER_PANELS_IN_ADMIN': False, 'PANEL_ADMIN_REGISTRATION': {}, } ``` -------------------------------- ### Panel URL Reversal Example (Python) Source: https://yassi.github.io/dj-control-room/api-reference_q= Illustrates how Django Control Room resolves a panel's URL using the `app_name` and the returned `url_name` from the `get_url_name` method. This is crucial for linking to the panel's views. ```python reverse(f'{panel.app_name}:{url_name}') ``` -------------------------------- ### Production Static Files Collection Source: https://yassi.github.io/dj-control-room/configuration_q= Collects all static files, including those from Django Control Room and its panels, into a single location for deployment. This command should be run before deploying to production. ```bash python manage.py collectstatic ``` -------------------------------- ### Run Tests with Coverage Source: https://yassi.github.io/dj-control-room/development Executes the test suite and generates a code coverage report, indicating which parts of the codebase are exercised by the tests. This helps in identifying areas that need more test coverage. ```bash pytest --cov=dj_control_room tests/ ``` -------------------------------- ### Panel Description Attribute Example Source: https://yassi.github.io/dj-control-room/creating-panels This Python code shows the `description` attribute for a Django Control Room panel. It provides a brief explanation of the panel's functionality, which is displayed to users in the dashboard. ```python description = "Monitor system health and performance metrics" ``` -------------------------------- ### Define URL Patterns for Control Room Panel (Python) Source: https://yassi.github.io/dj-control-room/creating-panels Defines the URL patterns for the Django Control Room panel. It includes a main entry point ('index') and a detail view with a primary key parameter. The 'app_name' must match the panel's app name for proper URL resolution. This setup allows navigation within the panel. ```python from django.urls import path from . import views app_name = 'my_panel' # Must match panel.app_name (defaults to normalized dist name) urlpatterns = [ path('', views.index, name='index'), # Main entry point path('detail//', views.detail, name='detail'), ] ``` -------------------------------- ### Configure Admin URL Patterns Source: https://yassi.github.io/dj-control-room/configuration_q= Sets up the URL routing for Django Control Room and its associated panels within the Django admin interface. This configuration is done in the project's urls.py file. ```python # urls.py from django.urls import path, include urlpatterns = [ # Mount panels with explicit paths under admin path('admin/dj-redis-panel/', include('dj_redis_panel.urls')), path('admin/dj-cache-panel/', include('dj_cache_panel.urls')), # Control Room dashboard path('admin/dj-control-room/', include('dj_control_room.urls')), path('admin/', admin.site.urls), ] ``` -------------------------------- ### Panel App Name Attribute Example Source: https://yassi.github.io/dj-control-room/creating-panels This Python code demonstrates the optional `app_name` attribute for a Django Control Room panel. It specifies the Django app label to be used for `INSTALLED_APPS` and URL reversing. This is only necessary if your app label differs from your normalized distribution name. ```python app_name = "my_panel" # Only needed if it differs from your PyPI dist name ``` -------------------------------- ### Manually Trigger Panel Discovery Source: https://yassi.github.io/dj-control-room/configuration_q= Provides a way to manually initiate the discovery of panels via Python entry points, bypassing the automatic discovery that occurs on Django startup. This is useful for advanced customization or debugging. ```python from dj_control_room.registry import registry # Force panel discovery registry.autodiscover() ``` -------------------------------- ### Configure Admin URL Paths for Panels Source: https://yassi.github.io/dj-control-room/configuration Defines explicit URL paths for mounting Django Control Room panels within the Django admin interface. This ensures that each panel has a dedicated and accessible URL. ```python # urls.py urlpatterns = [ # Mount panels with explicit paths under admin path('admin/dj-redis-panel/', include('dj_redis_panel.urls')), path('admin/dj-cache-panel/', include('dj_cache_panel.urls')), # Control Room dashboard path('admin/dj-control-room/', include('dj_control_room.urls')), path('admin/', admin.site.urls), ] ``` -------------------------------- ### Build and Publish Python Package Source: https://yassi.github.io/dj-control-room/creating-panels Commands to build a Python package using the 'build' tool and upload it to PyPI using 'twine'. Ensure you have built the package before attempting to upload. ```bash pip install build python -m build pip install twine twine upload dist/* ``` -------------------------------- ### Get All Registered Panels Source: https://yassi.github.io/dj-control-room/configuration_q= Retrieves all panels that have been registered within the DJ Control Room system. This is a core function for accessing panel information. ```python panels = registry.get_panels() ``` -------------------------------- ### Configure Django App (Python) Source: https://yassi.github.io/dj-control-room/creating-panels_q= Sets up the Django application configuration. This file defines the application's name and verbose name, which are used by Django for internal referencing and display purposes. ```python from django.apps import AppConfig class MyPanelConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'my_panel' verbose_name = 'My Panel' ``` -------------------------------- ### Panel Entry Point Configuration (TOML) Source: https://yassi.github.io/dj-control-room/creating-panels_q= Configures the panel's entry point using the `pyproject.toml` file. This tells Django Control Room how to discover and load your custom panel. ```toml [project.entry-points."dj_control_room.panels"] my_panel = "my_panel.panel:MyPanel" ``` -------------------------------- ### Enable Global Admin Panel Registration Source: https://yassi.github.io/dj-control-room/configuration_q= Globally enables all installed panels to register in both the Django Control Room section and their own dedicated admin sections. This setting is part of the DJ_CONTROL_ROOM_SETTINGS dictionary in settings.py. ```python DJ_CONTROL_ROOM_SETTINGS = { # Show panels in both Control Room AND their own admin sections 'REGISTER_PANELS_IN_ADMIN': True, } ``` -------------------------------- ### Configure Project with pyproject.toml Source: https://yassi.github.io/dj-control-room/creating-panels Defines project metadata, build requirements, dependencies, and entry points for a Django Control Room panel. This file is essential for packaging and distributing the panel. ```toml [build-system] requires = ["setuptools>=61.0", "wheel"] build-backend = "setuptools.build_meta" [project] name = "my-panel" version = "0.1.0" description = "My awesome panel for Django Control Room" readme = "README.md" license = {text = "MIT"} authors = [ {name = "Your Name", email = "you@example.com"}, ] requires-python = ">=3.9" classifiers = [ "Framework :: Django", "Framework :: Django :: 4.2", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", ] keywords = ["django", "admin", "panel"] dependencies = [ "Django>=4.2", ] [project.entry-points."dj_control_room.panels"] my_panel = "my_panel.panel:MyPanel" [project.urls] Homepage = "https://github.com/yourusername/my-panel" Documentation = "https://github.com/yourusername/my-panel" Repository = "https://github.com/yourusername/my-panel" [tool.setuptools.packages.find] exclude = ["tests*"] [tool.setuptools.package-data] "my_panel" = ["templates/**/*", "static/**/*"] ``` -------------------------------- ### Panel Get URL Name Method Example Source: https://yassi.github.io/dj-control-room/creating-panels This Python code defines the optional `get_url_name()` method for a Django Control Room panel. This method returns the URL name for the panel's main entry point, defaulting to 'index' if not specified. Django Control Room uses this to construct the panel's URL. ```python def get_url_name(self): return "index" # Or "dashboard", "home", etc. ``` -------------------------------- ### Panel Entry Point Configuration Source: https://yassi.github.io/dj-control-room/creating-panels This TOML snippet configures the entry point for a Django Control Room panel within the `pyproject.toml` file. It registers the panel class under the `dj_control_room.panels` group, allowing Django Control Room to discover and load your custom panel. ```toml # pyproject.toml [project.entry-points."dj_control_room.panels"] my_panel = "my_panel.panel:MyPanel" ``` -------------------------------- ### Initialize and Use the Panel Registry (Python) Source: https://yassi.github.io/dj-control-room/api-reference Interact with the global panel registry to discover and manage registered panels. The `registry` instance automatically discovers panels via entry points and provides methods to retrieve all panels or specific ones by ID. ```python from dj_control_room.registry import registry # Discover all panels registered via Python entry points registry.autodiscover() # Get a list of all registered panels panels = registry.get_panels() for panel in panels: print(f"{panel._registry_id}: {panel.name}") # Get a specific panel by ID panel = registry.get_panel('dj_redis_panel') if panel: print(panel.name) ``` -------------------------------- ### Write Unit Tests for Custom Panel Source: https://yassi.github.io/dj-control-room/creating-panels Provides a basic structure for writing unit tests for your custom Django Control Room panel using Django's TestCase. It includes tests for panel attributes and URL name retrieval. ```python # tests/test_panel.py from django.test import TestCase from my_panel.panel import MyPanel class PanelTestCase(TestCase): def test_panel_attributes(self): panel = MyPanel() self.assertEqual(panel.name, 'My Panel') self.assertTrue(panel.description) self.assertTrue(panel.icon) def test_url_name(self): panel = MyPanel() self.assertEqual(panel.get_url_name(), 'index') ``` -------------------------------- ### Get Featured Panel IDs Source: https://yassi.github.io/dj-control-room/api-reference_q= Retrieves a list of all available featured panel IDs. This function is useful for iterating through or referencing official panels. ```python from dj_control_room.featured_panels import get_featured_panel_ids ids = get_featured_panel_ids() # ['dj_redis_panel', 'dj_cache_panel', ...] ``` -------------------------------- ### Configure INSTALLED_APPS for Django Control Room (Python) Source: https://yassi.github.io/dj-control-room/index Adds the necessary Django Control Room and its panel applications to your project's INSTALLED_APPS setting. Panels should be listed before dj-control-room to ensure they appear grouped together. ```python INSTALLED_APPS = [ # ... 'dj_redis_panel', 'dj_cache_panel', 'dj_urls_panel', 'dj_control_room', # list after panels so they appear in one section ] ``` -------------------------------- ### Apply Staff-Only Access Decorator Source: https://yassi.github.io/dj-control-room/configuration_q= Ensures that panel views are accessible only to users with staff privileges. This is achieved by applying the `staff_member_required` decorator from Django's admin views. ```python from django.contrib.admin.views.decorators import staff_member_required @staff_member_required def my_panel_view(request): # Your view logic pass ``` -------------------------------- ### Configure Django INSTALLED_APPS for Panel Source: https://yassi.github.io/dj-control-room/creating-panels Adds your custom panel and 'dj_control_room' to the INSTALLED_APPS setting in your Django project's settings.py file. This makes the panel discoverable by Django. ```python INSTALLED_APPS = [ # ... 'dj_control_room', 'my_panel', ] ``` -------------------------------- ### Generate New Panel using Cookiecutter Template Source: https://yassi.github.io/dj-control-room/creating-panels_q= Uses the cookiecutter command-line utility to generate a new Django Control Room panel project from the official GitHub repository. This command will prompt for project details. ```bash cookiecutter https://github.com/yassi/cookiecutter-dj-control-room-plugin ``` -------------------------------- ### Get All Registered Panels (Python) Source: https://yassi.github.io/dj-control-room/api-reference_q= Retrieves a list of all registered panel instances using the `get_panels()` method of the `registry`. This allows iteration over all available panels and accessing their properties. ```python panels = registry.get_panels() for panel in panels: print(f"{panel._registry_id}: {panel.name}") ``` -------------------------------- ### Customize Control Room Dashboard URL Source: https://yassi.github.io/dj-control-room/configuration_q= Allows changing the default URL path for the Django Control Room dashboard. This involves modifying the urlpatterns in the project's urls.py file. ```python # urls.py from django.urls import path, include urlpatterns = [ # Custom path instead of 'admin/dj-control-room/' path('dashboard/control-room/', include('dj_control_room.urls')), path('admin/', admin.site.urls), ] ``` -------------------------------- ### Override Admin Panel Registration Per Panel Source: https://yassi.github.io/dj-control-room/configuration_q= Provides fine-grained control over which panels appear in their own admin sections, overriding the global setting. This is configured within the PANEL_ADMIN_REGISTRATION dictionary in DJ_CONTROL_ROOM_SETTINGS. ```python DJ_CONTROL_ROOM_SETTINGS = { 'REGISTER_PANELS_IN_ADMIN': False, # Default for all 'PANEL_ADMIN_REGISTRATION': { 'dj_redis_panel': True, # Redis shows in both places 'dj_cache_panel': False, # Cache only in Control Room 'dj_urls_panel': True, # URLs shows in both places } } ``` -------------------------------- ### Define Custom Panel Entry Point (INI) Source: https://yassi.github.io/dj-control-room/index Registers a custom panel using Python entry points. This configuration tells Django Control Room how to discover and load your custom panel classes. ```ini [project.entry-points."dj_control_room.panels"] my_panel = "my_panel.panel:MyPanel" ``` -------------------------------- ### Customize Django Control Room Dashboard URL Source: https://yassi.github.io/dj-control-room/configuration Allows changing the default URL path for the Django Control Room dashboard. This provides flexibility in how the dashboard is accessed within the admin interface. ```python # urls.py urlpatterns = [ # Custom path instead of 'admin/dj-control-room/' path('dashboard/control-room/', include('dj_control_room.urls')), path('admin/', admin.site.urls), ] ``` -------------------------------- ### Get Specific Panel by ID (Python) Source: https://yassi.github.io/dj-control-room/api-reference_q= Fetches a specific panel instance from the registry using its unique ID with the `get_panel(panel_id)` method. Returns the panel object if found, otherwise returns `None`. ```python panel = registry.get_panel('dj_redis_panel') if panel: print(panel.name) ```