Skip to content

Configurable image path - #2778

Open
janno42 wants to merge 3 commits into
e-valuation:mainfrom
janno42:static_images
Open

Configurable image path#2778
janno42 wants to merge 3 commits into
e-valuation:mainfrom
janno42:static_images

Conversation

@janno42

@janno42 janno42 commented Aug 13, 2026

Copy link
Copy Markdown
Member

For the "EvaP light" instance described in #2763, we would also like to be able to change the branding.
This moves images to their own directory, which can be replaced in the settings so we can use files from a different directory if needed.

@janno42

janno42 commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

I need assistance with the mypy errors :/

@niklasmohrin

Copy link
Copy Markdown
Member

I think we could make the type error go away by changing the setting to be a tuple instead of a list.

However, it seems more sensible to me to delete the view in development (I think it is left from our old way of doing frontend tests), and use a "get static" helper from Django in the staff view

@janno42

janno42 commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

What do you mean by "helper from Django"?

@niklasmohrin

Copy link
Copy Markdown
Member

I think we should use finders.find from https://docs.djangoproject.com/en/6.1/ref/contrib/staticfiles/#finders-module instead of assuming that that the sample excel file is in exactly the first static directory from the setting

@janno42

janno42 commented Aug 17, 2026

Copy link
Copy Markdown
Member Author

We also use settings.STATICFILES_DIRS[0] in these files:

  • evaluation/management/commands/scss.py
  • evaluation/management/commands/ts.py
  • evaluation/tests/test_commands.py

Should these also be changed?

@niklasmohrin niklasmohrin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think for the development commands the change is not as important (we don't expect a changed value for STATICFILES_DIRS); we should think about it, but we can do that in another PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants