File tree Expand file tree Collapse file tree 2 files changed +420
-256
lines changed
src/ansys/dynamicreporting/core/serverless Expand file tree Collapse file tree 2 files changed +420
-256
lines changed Original file line number Diff line number Diff line change @@ -431,8 +431,21 @@ def setup(self, collect_static: bool = False) -> None:
431
431
overrides ["DEBUG" ] = self ._debug
432
432
433
433
overrides ["MEDIA_ROOT" ] = str (self ._media_directory )
434
+
434
435
if self ._static_directory is not None :
436
+ # collect static files to this directory
435
437
overrides ["STATIC_ROOT" ] = str (self ._static_directory )
438
+ # collect static files from here
439
+ # Replace STATICFILES_DIRS to point only to the pre-collected directory in the Ansys installation.
440
+ source_static_dir = (
441
+ self ._ansys_installation / f"nexus{ self ._ansys_version } " / "django" / "static"
442
+ )
443
+ if not source_static_dir .exists ():
444
+ raise ImproperlyConfiguredError (
445
+ f"The static files directory '{ source_static_dir } ' does not exist in the installation. "
446
+ "Please check your Ansys installation and version."
447
+ )
448
+ overrides ["STATICFILES_DIRS" ] = [str (source_static_dir )]
436
449
437
450
# relative URLs: By default, ADR serves static files from the URL /static/
438
451
# and media files from the URL /media/. These can be changed using the
You can’t perform that action at this time.
0 commit comments