Skip to content

Commit

Permalink
nit #11001
Browse files Browse the repository at this point in the history
  • Loading branch information
chrabyrd committed Jul 15, 2024
1 parent b105dec commit f0fcf31
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 103 deletions.
79 changes: 0 additions & 79 deletions arches/app/templates/standalone-component-base.htm

This file was deleted.

10 changes: 8 additions & 2 deletions arches/install/arches-templates/project_name/settings.py-tpl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ ARCHES_APPLICATIONS = ()
INSTALLED_APPS += ARCHES_APPLICATIONS

MIDDLEWARE = [
"django_hosts.middleware.HostsRequestMiddleware", # this _must_ be first MIDDLEWARE entry
"corsheaders.middleware.CorsMiddleware",
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
Expand All @@ -174,7 +173,14 @@ MIDDLEWARE = [
# "silk.middleware.SilkyMiddleware",
]

MIDDLEWARE.append('django_hosts.middleware.HostsResponseMiddleware') # this _must_ be last MIDDLEWARE entry
MIDDLEWARE.insert( # this must resolve to first MIDDLEWARE entry
0,
"django_hosts.middleware.HostsRequestMiddleware"
)

MIDDLEWARE.append( # this must resolve last MIDDLEWARE entry
"django_hosts.middleware.HostsResponseMiddleware"
)

STATICFILES_DIRS = build_staticfiles_dirs(
root_dir=ROOT_DIR,
Expand Down
10 changes: 8 additions & 2 deletions arches/install/arches-templates/project_name/urls.py-tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ from django.conf.urls.i18n import i18n_patterns
from django.urls import include, path

urlpatterns = [
path('', include('arches.urls')), # ensure project and Arches-application urls go _above_ this entry
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# project-level urls
]

# Ensure Arches core urls are superceded by project-level urls
urlpatterns.append(path('', include('arches.urls')))

# Adds URL pattern to serve media files during development
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

# Only handle i18n routing in active project. This will still handle the routes provided by Arches core and Arches applications,
# but handling i18n routes in multiple places causes application errors.
Expand Down
9 changes: 6 additions & 3 deletions arches/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@
INSTALLED_APPS += ARCHES_APPLICATIONS

MIDDLEWARE = [
"django_hosts.middleware.HostsRequestMiddleware", # this _must_ be first MIDDLEWARE entry
"corsheaders.middleware.CorsMiddleware",
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
Expand All @@ -396,9 +395,13 @@
"arches.app.utils.middleware.SetAnonymousUser",
]

MIDDLEWARE.append(
MIDDLEWARE.insert( # this must resolve to first MIDDLEWARE entry
0, "django_hosts.middleware.HostsRequestMiddleware"
)

MIDDLEWARE.append( # this must resolve last MIDDLEWARE entry
"django_hosts.middleware.HostsResponseMiddleware"
) # this _must_ be last MIDDLEWARE entry
)

WEBPACK_LOADER = {
"DEFAULT": {
Expand Down
39 changes: 22 additions & 17 deletions releases/7.6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,49 +320,55 @@ Minor incompatibilities:
DEFAULT_HOST = "{{ project_name }}"
```
4. Add the following line to the *top* of `MIDDLEWARE`:
4. Add the following lines *after* `MIDDLEWARE`:
```
"django_hosts.middleware.HostsRequestMiddleware", # this _must_ be first MIDDLEWARE entry
MIDDLEWARE.insert( # this must resolve to first MIDDLEWARE entry
0,
"django_hosts.middleware.HostsRequestMiddleware"
)
MIDDLEWARE.append( # this must resolve last MIDDLEWARE entry
"django_hosts.middleware.HostsResponseMiddleware"
)
```
5. Add the following line *after* `MIDDLEWARE`:
```
MIDDLEWARE.append('django_hosts.middleware.HostsResponseMiddleware') # this _must_ be last MIDDLEWARE entry
```
6. Add the following line *after* `ARCHES_APPLICATIONS`:
5. Add the following line *after* `ARCHES_APPLICATIONS`:
```
INSTALLED_APPS += ARCHES_APPLICATIONS
```
7. If there are any duplicated entries between `ARCHES_APPLICATIONS` and `INSTALLED_APPS`, remove the entry from `INSTALLED_APPS`.
6. If there are any duplicated entries between `ARCHES_APPLICATIONS` and `INSTALLED_APPS`, remove the entry from `INSTALLED_APPS`.
8. Update `WEBPACK_LOADER` to the following:
7. Update `WEBPACK_LOADER` to the following:
```
WEBPACK_LOADER = {
"DEFAULT": {
"STATS_FILE": os.path.join(APP_ROOT, '..', 'webpack/webpack-stats.json'),
},
}
```
3. Update `LOCALE_PATHS.append(...)` to `LOCALE_PATHS.insert(0, ...)`
8. Update `LOCALE_PATHS.append(...)` to `LOCALE_PATHS.insert(0, ...)`
```
LOCALE_PATHS.insert(0, os.path.join(APP_ROOT, 'locale'))
```
4. Add `"json"` to `FILE_TYPES` if you wish to use the JSON-LD bulk import module.
9. Add `"json"` to `FILE_TYPES` if you wish to use the JSON-LD bulk import module.
11. Update urls.py:
```
from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls.i18n import i18n_patterns
from django.urls import include, path
... # other project-level imports
urlpatterns = [
... # other project-level routes
path('', include('arches.urls')), # ensure project and Arches-application urls go _above_ this entry
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# project-level urls
]
# Ensure Arches core urls are superceded by project-level urls
urlpatterns.append(path('', include('arches.urls')))
# Adds URL pattern to serve media files during development
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# Only handle i18n routing in active project. This will still handle the routes provided by Arches core and Arches applications,
# but handling i18n routes in multiple places causes application errors.
Expand All @@ -371,7 +377,6 @@ Minor incompatibilities:
urlpatterns = i18n_patterns(*urlpatterns)
urlpatterns.append(path("i18n/", include("django.conf.urls.i18n")))
```
12. Run `python manage.py updateproject`
Expand Down

0 comments on commit f0fcf31

Please sign in to comment.