Package: django-xicon
django-xicon is a Django reusable application to handle a modern bunch of site iconsContentsInstallationConfigurationSettingsUsageContributingLicensingContactsNowadays<linkrel="shortcuticon"href="favicon.ico"type="image/x-icon"sizes="16x16"/>is not enough for good site or web application.Apple,MicrosoftandGooglecreates their own standards.django-xiconsolve the boring problem of reading and implementing of these standards requirements through fast and simple Django project configuration. These standards requirements are not fully implemented, but enough to pass most of the checks.InstallationObtain your copy of source code from the git repository:$ git clonehttps://github.com/vint21h/django-xicon.git. Or download the latest release fromhttps://github.com/vint21h/django-xicon/tags/.Run$ python ./setup.py installfrom the repository source tree or unpacked archive. Or use pip:$ pip installdjango-xicon.ConfigurationAdd"xicon"tosettings.INSTALLED_APPS:# settings.pyINSTALLED_APPS+=["xicon",]Add"xicon"to your URLs definitions if you want to servemanifest.jsonorbrowserconfig.xml:# urls.pyfromdjango.urlsimportinclude,re_pathurlpatterns+=[re_path(r"^xicon/",include("xicon.urls")),]SettingsXICON_FAVICONSContains list of favicons. Defaults to[]. Each element must be according to the next structure:{"src":"favicon.ico","type":"image/x-icon","size":"16x16",}# type: Dict[str, Optional[str]]Wheresrckey is a path to the favicon file in Django static directory,typeis favicon file mime-type andsizekey contains icon’swidthandheightand can be omitted.XICON_APPLE_TOUCH_ICONSContains list of apple touch icons. Defaults to[]. Each element must be according to the next structure:{"src":"apple-touch-icon-144x144.png","size":"144x144",}# type: Dict[str, Optional[str]]Wheresrckey is a path to the icon file in Django static directory andsizecontains icon’swidthandheightand can be omitted.XICON_APPLE_TOUCH_ICON_MASK_ICON_SRCContains path to Safari pinned tabs icon. Defaults to"".XICON_APPLE_TOUCH_ICON_MASK_ICON_COLORContains path to Safari pinned tab icon hover color. Defaults to"", must start with#.XICON_APPLE_MOBILE_WEB_APP_STATUS_BAR_STYLE_COLORContains iOS web application status bar color. Defaults to"".XICON_APPLE_MOBILE_WEB_APP_TITLEContains iOS web application launch icon title. Defaults to"".XICON_ANDROID_CHROME_THEME_COLORContains android chrome web application toolbar color also used inmanifest.json. Defaults to"", must start with#.XICON_ANDROID_CHROME_ICONSContains a list of icons formanifest.json. Defaults to[]. Each element must be according to the next structure:{"src":"android-chrome-64x64.png","type":"image/png","sizes":"64x64",}# type: Dict[str, str]Wheresrckey is a path to the icon file in Django static directory,typeis favicon file mime-type andsizekey contains icon’swidthandheight.XICON_ANDROID_CHROME_NAMEContains android chrome web application name formanifest.json. Defaults to"".XICON_ANDROID_CHROME_SHORT_NAMEContains android chrome web application short name formanifest.json. Defaults to"".XICON_ANDROID_CHROME_BACKGROUND_COLORContains android chrome web application background color formanifest.json. Defaults to"", must start with#.XICON_ANDROID_CHROME_DISPLAYContains android chrome web application browser UI mode formanifest.json. Defaults to"".XICON_ANDROID_CHROME_ORIENTATIONContains android chrome web application screen orientation formanifest.json. Defaults to"".XICON_MSAPPLICATION_NAMEContains microsoft application name. Defaults to"".XICON_MSAPPLICATION_TILE_COLORContains Microsoft application tile color also used inbrowserconfig.xml. Defaults to"", must start with#.XICON_MSAPPLICATION_TILESContains list of icons for Microsoft application meta tags and also used inbrowserconfig.xml. Defaults to[]. Each element must be according to the next structure:{"src":"mstile-70x70.png","name":"square70x70logo",}# type: Dict[str, str]Wheresrckey is a path to the icon file in Django static directory andnamecontains tile name (type).UsageIf you want to use all power ofdjango-xicon, just set up all settings and include"xicon/includes/xicon.html"to your base template<head>HTML tag:{# base.html #}<head>{%include"xicon/includes/xicon.html"%}</head>Or just for favicons, setupXICON_FAVICONSsetting, load"xicon_tags"to your base template and place"xicon_favicons"in<head>HTML tag:{# base.html #}{%loadxicon_tags%}<head>{%xicon_favicons%}</head>If you want to setup web application forapple devices, setup all settings prefixed withXICON_APPLE_and include"xicon/includes/apple.html"to your base template<head>HTML tag:{# base.html #}<head>{%include"xicon/includes/apple.html"%}</head>Or just for apple touch icons, setupAPPLE_TOUCH_ICONSsetting, load"xicon_tags"to your base template and place"xicon_apple_touch_icons"in<head>HTML tag:{# base.html #}{%loadxicon_tags%}<head>{%xicon_apple_touch_icons%}</head>To use Safari pinned tabs mask icon setupXICON_APPLE_TOUCH_ICON_MASK_ICON_SRCandXICON_APPLE_TOUCH_ICON_MASK_ICON_COLORsettings, load"xicon_tags"to your base template and place"xicon_apple_touch_icon_mask_icon"in<head>HTML tag:{# base.html #}{%loadxicon_tags%}<head>{%xicon_apple_touch_icon_mask_icon%}</head>To configure iOS web application bar style color setupXICON_APPLE_MOBILE_WEB_APP_STATUS_BAR_STYLE_COLORsetting, load"xicon_tags"to your base template and place"xicon_apple_mobile_web_app_status_bar_style"in<head>HTML tag:{# base.html #}{%loadxicon_tags%}<head>{%xicon_apple_mobile_web_app_status_bar_style%}</head>To configure iOS web application launch icon title setupXICON_APPLE_MOBILE_WEB_APP_TITLEsetting, load"xicon_tags"to your base template and place"xicon_apple_mobile_web_app_title"in<head>HTML tag:{# base.html #}{%loadxicon_tags%}<head>{%xicon_apple_mobile_web_app_title%}</head>If you want to useandroid chromerelated things, just setup all settings prefixed withXICON_ANDROID_CHROME_and include"xicon/includes/android-chrome.html"to your base template<head>HTML tag:{# base.html #}<head>{%include"xicon/includes/android-chrome.html"%}</head>Or if you need only configure android chrome web application toolbar color, setupXICON_ANDROID_CHROME_THEME_COLOR, load"xicon_tags"to your base template and place"xicon_android_chrome_theme_color"in<head>HTML tag:{# base.html #}{%loadxicon_tags%}<head>{%xicon_android_chrome_theme_color%}</head>If you need generate and servemanifest.json, add"xicon"to your URLs definitions, setup next settings:XICON_ANDROID_CHROME_THEME_COLOR,XICON_ANDROID_CHROME_ICONS,XICON_ANDROID_CHROME_NAME,XICON_ANDROID_CHROME_SHORT_NAME,XICON_ANDROID_CHROME_BACKGROUND_COLOR,XICON_ANDROID_CHROME_DISPLAYandXICON_ANDROID_CHROME_ORIENTATION`, and then include"xicon/includes/android-chrome-manifest-meta.html"to your base template<head>HTML tag:# urls.pyfromdjango.urlsimportinclude,re_pathurlpatterns+=[re_path(r"^xicon/",include("xicon.urls")),]{# base.html #}<head>{%include"xicon/includes/android-chrome-manifest-meta.html"%}</head>If you want to setupmicrosoft applicationconfigure all settings prefixed withXICON_MSAPPLICATION_and include"xicon/includes/msapplication.html"to your base template<head>HTML tag:{# base.html #}<head>{%include"xicon/includes/msapplication.html"%}</head>Or if you need only configure microsoft application name, setupXICON_MSAPPLICATION_NAME, load"xicon_tags"to your base template and place"xicon_msapplication_name"in<head>HTML tag of your base template:{# base.html #}{%loadxicon_tags%}<head>{%xicon_msapplication_name%}</head>If you need configure microsoft application tile color, setupXICON_MSAPPLICATION_TILE_COLOR, load"xicon_tags"to your base template and place"xicon_msapplication_tile_color"in<head>HTML tag of your base template:{# base.html #}{%loadxicon_tags%}<head>{%xicon_msapplication_tile_color%}</head>If you need generate and servebrowserconfig.xml, add"xicon"to your URLs definitions, setup next settings:XICON_MSAPPLICATION_TILE_COLORandXICON_MSAPPLICATION_TILES, and then include"xicon/includes/msapplication-browserconfig-meta.html"to your base template<head>HTML tag:# urls.pyfromdjango.urlsimportinclude,re_pathurlpatterns+=[re_path(r"^xicon/",include("xicon.urls")),]{# base.html #}<head>{%include"xicon/includes/msapplication-browserconfig-meta.html"%}</head>Or just for microsoft application tiles, setupMSAPPLICATION_TILESsetting, load"xicon_tags"to your base template and place"xicon_mstiles"in<head>HTML tag:{# base.html #}{%loadxicon_tags%}<head>{%xicon_mstiles%}</head>ContributingFork itInstallGNU MakeInstall and configurepyenvandpyenv-virtualenv pluginInstall and configuredirenvCreate environment config from examplecp.env.example.envInstall development dependencies:makeinstallCreate your fix/feature branch:gitcheckout-bmy-new-fix-or-featureCheck code style and moreover:makecheckRun tests:maketestPush to the branch:gitpushoriginmy-new-fix-or-featureCreate a new Pull RequestLicensingdjango-xicon is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
For complete license text see COPYING file.ContactsProject Website:https://github.com/vint21h/django-xicon/Author: Alexei Andrushievich <vint21h@vint21h.pp.ua>For complete authors list see AUTHORS file.