I’m setting up a new Superset for a client and I would like to display his company logo in the browser with the favicon.
It's not into the superset/config.py, there we can change the icon of Superset but not the favicon
I am thinking about Flask or Appbuilder answers but not sure...
You can simply change the favicon.png file contained in the superset/assets/images folder.
With latest version of Superset (1.4.1).
You can add below values in the custom config (superset_config.py).
# Visual Customizations
APP_NAME = "CUSTOM_APP_NAME"
APP_ICON = "/static/assets/images/your_custom_logo_horiz.png"
APP_ICON_WIDTH = 200
# Path for routing when APP_ICON image is clicked
LOGO_TARGET_PATH = '/' # Forwards to /superset/welcome/home
LOGO_TOOLTIP = "Go Home" # Text displayed when hovering.
FAVICONS = [{"href": "/static/assets/images/custom_favicon.png"}]
Related
I’m making a server to convert Rmarkdown to Dash apps. The idea is parse all params in the rmd file and make corresponding Dash inputs. Then add a submit button which compile the rmd to html somewhere and iframe back. I use an external database to store the info for rmd paths so user can dynamically add files. The problem is when a rmd file changes, the server has to reparse the file and recreate the app and serve at the same url. I don’t have an elegant solution. Right now I’m doing something like this.
server = Flask(__name__)
#server.route(“rmd/path:path”):
def convert_rmd_to_dash(path):
file = get_file_path_from_db(path)
mtime = get_last_modified_time(file)
cached_app, cached_mtime = get_cache(path)
if cached_mtime == mtime:
return cached_app
inputs = parse_file(file)
app = construct_dash_app(inputs)
return app.index()
def construct_dash_app(inputs):
app = dash.Dash(
name,
server=server,
routes_pathname_prefix=’/some_url_user_will_never_use/’ + file_name + time.time())
app.layout = …
…
return app
It works but I get many routing rules under /some_url_user_will_never_use. Directly overwriting rmd/path might be possible but feels hacky based on Stackoveflow’s answer. Is there a better solution? Thanks.
I installed ROR and SPREE in windows. When I am running the site, logo not displaying in the demo content.
Please tell the solution to fix it. I tried to change the logo using spree.rb with below code:
# Example:
# Uncomment to stop tracking inventory levels in the application
# config.track_inventory_levels = false
Try to use something like this. may be it is helpful to you:
Spree.config do |config|
config.admin_interface_logo = 'logo/some_other_logo.png'
config.logo = 'logo/this_logo.png'
end
I have a couple of unversioned PDFs in the media library... when I try opening them up from their URLs, it says "Layout not found". When I assign a layout (any layout), it just doesn't render anything.
I've added forcedownload=true to the media library section of the web.config... is there anything I'm missing? I thought this was supposed to download by default
http://testsite.org/sitecore/media%20library/pdfs/Publications/Periodicals/Test
The URL above basically doesn't work
Links to items in the media library are usually prefixed with /~/media/, unless you have changed the value of Media.MediaLinkPrefix in config. The link should be something like:
http://testsite.org/~/media/pdfs/Publications/Periodicals/Test.pdf
Make sure you are generating the URLs using MediaManager.GetMediaUrl()
FileField fileField = Sitecore.Context.Item.Fields["File Field"];
var mediaItem = new MediaItem(fileField.MediaItem);
string url = Sitecore.StringUtil.EnsurePrefix('/', MediaManager.GetMediaUrl(fileMediaItem));
Always use LinkManager.GetItemUrl() for items and MediaManager.GetMediaUrl() for media items to generate Sitecore URLs.
http://briancaos.wordpress.com/2012/08/24/sitecore-links-with-linkmanager-and-mediamanager/
http://corecompetency.tohams.com/index.php/linking-to-an-image-or-file-in-the-media-library/
You don't have to assign a layout to media item. Make sure you add "/" prefix before the url. Ex: site/~/media/path to pdf.ashx.
Also make sure you have media files published.
//below is the code to specify an Image URL
MediaItem mediaItem = new MediaItem(Sitecore.Context.Database.GetItem("Path"));
if (mediaItem != null)
{
imgBtn.ImageUrl = Sitecore.StringUtil.EnsurePrefix('/', Sitecore.Resources.Media.MediaManager.GetMediaUrl(mediaItem);
imgBtn.AlternateText = mediaItem.Alt;
}
I'm trying to use django-tinymce to edit fields in django admin.
I've the app installed in my virtualenv (django-tinymce==1.5.1b4). It's listed in my installed apps -
INSTALLED_APPS = (
#...
'tinymce',
#...
)
My settings includes the following
TINYMCE_DEFAULT_CONFIG = {
'theme': "advanced",
'theme_advanced_toolbar_location': "top",
'theme_advanced_buttons1': "bold,italic,underline,separator,"
"bullist,separator,outdent,indent,separator,undo,redo",
'theme_advanced_buttons2': "",
'theme_advanced_buttons3': "",
}
TINYMCE_SPELLCHECKER = True
TINYMCE_COMPRESSOR = True
And I've got the files available at /MEDIA_ROOT/js/tiny_mce (the default).
My models look like -
from tinymce import models as tinymce_models
class MyModel(models.Model)
post = tinymce_models.HTMLField()
When I go to the model admin page, the field appears as a normal text field and my browser tells me there's an error on the inline js script for the field. It says it doesn't recognise the variable tinyMCE. It doesn't look like the page is even trying to load the js file (I'm getting no 404's - I can't see any sign of anything being loaded).
I'm not sure what I'm missing..
Have You, Sir, done python manage.py collectstatic ?
What value variable in settings.py is in TINYMCE_JS_ROOT and TINYMCE_JS_URL
If variable TINYMCE_JS_URL is not set check if You, Sir, have file at /MEDIA_ROOT/js/tiny_mce/tiny_mce.js. If not, try to copy manually from django-tinymce's egg.
OK, looks like it might have been a bug in the django_tinymce code. I've reverted to 1.5.1b2 and everything works as expected. Guess I should look into filing a bug report.
I am working on a custom markup formatter for Django and I wanted to interface it with MarkItUp.
It is successfully being called when I save the field, which is of type MarkupField, but when I try to preview this field from the Admin interface using the default settings, all I get back in the preview box is plaintext.
I am using the MarkItUp version from here: http://bitbucket.org/carljm/django-markitup/src
Here are my settings:
MARKITUP_FILTER = ('util.wookie.formatter.wookie', {})
JQUERY_URL = 'js/lib/jquery.js'
In urls, I have the following line:
(r'^markitup/', include('markitup.urls')),
Any ideas?
Is something serving the assets from both the MARKITUP_MEDIA_URL the JQUERY_URL locations?