Repository: CiviWiki/OpenCiviWiki

Issue:
add django-browser-reload
## Task

- [ ] follow the [installation instructions](https://github.com/adamchainz/django-browser-reload#installation) to enable `django-browser-reload` for this project


Discussion:
Hello, would be willing to work on this issue
Thanks, @Walexero 😀
okay, i guess i would get my hands off this then
@Walexero, sorry for the confusion. I seem to have forgotten to assign you to the issue when you claimed it.

@Mohammed-Saif0 , thank you for working on the issue in pull-request #1366. However, we will give @Walexero the opportunity to work on this issue since they claimed it four days ago.
Sorry again for the confusion.
okay thanks, would start working on it, i have another issue opened, have completed one of the tasks remains the second, please respond on the issue page

Hello is this issue still open? if it's so i'd like to give it a try
Hi @daaavo. @Walexero is still assigned to this issue but may like some help if you ask them.
Hello, @brylie. Is this issue still open?

Yes.
Hello @brylie. I don't know why my changes for this issue are failing the django-upgrade test. Here, is the response when trying to commit my changes.
`django-upgrade...........................................................Failed
- hook id: django-upgrade
- exit code: 1

Rewriting project/core/urls.py
`

It should have automatically fixed the code issues. Just stage the changes to `urls.py` and commit. The plugin makes sure we write code that uses the latest Django features and idioms.
Hello, @brylie. I have another error when trying to commit the changes...This is what I get after I stage the changes to urls.py
![browerr](https://user-images.githubusercontent.com/87471613/220857310-1c2163c4-3f39-4b0a-83ef-1fc2964f5c18.png)

This is my log file
[pre-commit.log](https://github.com/CiviWiki/OpenCiviWiki/files/10811659/pre-commit.log)


The error in the log file seems to be the following:

> raise RuntimeError("The Poetry configuration is invalid:\n" + message)
>      RuntimeError: The Poetry configuration is invalid:
>        - [extras.pipfile_deprecated_finder.2] 'pip-shims<=0.3.4' does not match '^[a-zA-Z-_.0-9]+$'


Try again on a fresh branch, from the latest develop. Then only run `poetry add ...` and the package name.

Resolving patch:
diff --git a/project/core/settings.py b/project/core/settings.py
--- a/project/core/settings.py
+++ b/project/core/settings.py
@@ -36,6 +36,7 @@
     "categories",
     "notification",
     "debug_toolbar",
+    "django_browser_reload",
 )
 
 MIDDLEWARE = [
@@ -50,6 +51,7 @@
     # 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
     "django.contrib.messages.middleware.MessageMiddleware",
     "django.middleware.clickjacking.XFrameOptionsMiddleware",
+    "django_browser_reload.middleware.BrowserReloadMiddleware",
 ]
 
 INTERNAL_IPS = [
diff --git a/project/core/urls.py b/project/core/urls.py
--- a/project/core/urls.py
+++ b/project/core/urls.py
@@ -13,7 +13,6 @@
     1. Import the include() function: from django.urls import include, path
     2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
 """
-
 from core.router import CiviWikiRouter
 from django.conf import settings
 from django.conf.urls.static import static
@@ -47,6 +46,7 @@
     ),
     re_path(r"^media/(?P<path>.*)$", serve, {"document_root": settings.MEDIA_ROOT}),
     path("__debug__/", include("debug_toolbar.urls")),
+    path("__reload__/", include("django_browser_reload.urls")),
 ]
 
 urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)


Test patch: