Closed
Bug 553726
Opened 15 years ago
Closed 14 years ago
Figure out HOSTNAME issues in settings_local (collection icons don't always show up).
Categories
(addons.mozilla.org Graveyard :: Code Quality, defect, P3)
addons.mozilla.org Graveyard
Code Quality
Tracking
(Not tracked)
RESOLVED
WONTFIX
4.x (triaged)
People
(Reporter: stephend, Unassigned)
References
()
Details
Some collection icon images aren't showing up on https://preview.addons.mozilla.org/z/en-US/firefox/ (see screenshot), because of "HOSTNAME" issues, according to Wil:
"We need to load settings_local before settings...because it makes more sense to merge defaults into your settings than the other way around"
The effect of this is that image paths are like so:
http://pm-app-amo24.mozilla.org/en-US/firefox/images/collection_icon/4/1262723594, and are 404s.
Comment 1•15 years ago
|
||
This is because SITE_URL is used in settings.py when it still holds a bad value. In a perfect world, settings.py should load the local settings, and then just fill in anything that hasn't been set with default values.
A cheesy hack has been suggested:
settings.py:
ADDON_ICON_PATH = "%s/%s/%s/images/addon_icon/%%d/%%s"
def xx(env):
env['ADDON_ICON_URL'] = env['STATIC_URL'] + env['ADDON_ICON_PATH']
settings_local.py:
xx(globals())
print ADDON_ICON_URL
Comment 3•15 years ago
|
||
Hmm... I'd rather do something like:
settings_pre.py <-- git ignored
settings.py <-- checked in
settings_post.py <-- git ignored
Then we can define things in settings_pre.py that need to happen ahead of time:
settings_pre.py
HOSTNAME='preview.a.m.o'
settings.py
try:
from settings_pre import *
except ImportError:
pass
if not HOSTNAME:
HOSTNAME = 'whateverisdefault'
settings_post.py:
# any overrides we need to do, e.g. DEBUG values, etc.
Not having an override-able conf would be a bad thing.
Comment 4•15 years ago
|
||
If settings.py has all the "if not x: x=..." lines, how does settings_post help you? Everything is override-able by putting it in settings_pre (or, settings_local in our case).
Comment 5•15 years ago
|
||
Hmm... okay that makes sense.
Updated•15 years ago
|
Priority: -- → P3
Updated•15 years ago
|
Target Milestone: 5.9 → 5.10
Updated•15 years ago
|
Target Milestone: 5.10 → 5.11
Updated•15 years ago
|
Target Milestone: 5.11 → 4.x (triaged)
Updated•15 years ago
|
Assignee: jbalogh → nobody
Component: Public Pages → Code Quality
QA Contact: web-ui → code-quality
Target Milestone: 4.x (triaged) → 5.11
Updated•15 years ago
|
Target Milestone: 5.11 → 4.x (triaged)
Comment 6•14 years ago
|
||
maybe someday we'll figure out a way not to have to override everything in settings_local that changes. In the meantime, we've lasted this long without it and this bug is way too specific to track it.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
Assignee | ||
Updated•9 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•