Django - format labels in admin panel - django

I have a label "Inactive sites" in my django admin:
class InactiveSite(Site):
class Meta:
proxy = True
verbose_name_plural = 'Inactive sites (' + str(Site.objects.filter(is_active=False).count()) + ')'
I would like to format "Inactive sites" (change color, font size, etc.). How can I do that?

You can override Django's template for the admin page and include your own css file (preferred way) or directly add it to the html.
You can use the developer tools of chrome or firefox to identify what selector you need.
In Chrome CTRL+SHIFT+C and then click on the link text.
At the moment I only have a modified admin, for me the css selector is: #admin-home > ul > li > ul > li > a
See here: https://docs.djangoproject.com/en/1.10/ref/contrib/admin/#overriding-admin-templates
The answer here has a code sample: https://stackoverflow.com/a/37317429/640916

Related

Django forms useless div tag

I am getting one problem while using django forms. Actually When I am using RadioSelect widget it is giving unnecessary div tags. Means each radio button is separated with individual div tag. And I don't want that. Please help Image of Div tags for each label
How can I get those label and input tag i.e Radio Buttons in single div tag not these many
index.html
forms.py

Trix rendering html tags such as div and br tags in Django

I am using Trix as a rich text editor in Django, however i run into a problem, when going to save the data,
If i type, Hey trix check, it will return trix check backk
and it also adds br tags as well, if you want to check it can be seen on
www.brogrow.in
Can anyone help on it?
For login you can use -
Username - new &
password - Nov#2020
Try to add the safe filter in your template that display the content with the div and br tags. It should not display the HTML content of your blog posts.

How to change product url by id to name in opencart?

the defult url of a product is =
http://localhost/OpenCartDesign/upload/index.php?route=product/product&product_id=64
I want to change this in http://localhost/OpenCartDesign/upload/index.php?route=product/product&product_name= here show product name not product id
Rename /OpenCartDesign/upload/.htaccess.txt to /OpenCartDesign/upload/.htaccess. Inside Dashboard go to System > Settings > Action: Edit (Store) > Server (tab) > Use SEO URLs: YES and click the SAVE button.
Then you will have this http://localhost/OpenCartDesign/upload/product-name which is much better for SEO.

Is there any way to assign menu icon for flask-admin generated category link?

Is there any way to assign menu icon for flask-admin generated category link?
We can set the icon for menu item via
menu_icon_type=ICON_TYPE_GLYPH, menu_icon_value='glyphicon-tags'
But I didn't see any such named parameter existing for category link.
This was recently added as a feature in this pull request: https://github.com/flask-admin/flask-admin/pull/950
Now you can use category_icon_classes when you initialize Admin, like this:
admin = Admin(
app,
name='My Admin',
category_icon_classes={
'Profiles': 'glyphicon glyphicon-wrench',
}
)

Prestashop: How do I change my page title as an administrator

How do I change my page title (file attached) as an administrator? From the back office.
Click here to view my example of "Page title"
To change your shop’s name in PrestaShop, first open your site’s Admin Control Panel,
Go to Preferences -> Store Contacts(Contacts)
Replace ‘Shop Name’ text box with your desired shop name.
Scroll down and click Save.
Thanks.
Are you trying to change the site name?
You can do this from:
Backoffice > Preferences > Store Contacts > Contact details > Shop
name
If you need to update CMS page:
Backoffice > Preferences > CMS > Click Edit on page you want to change
-> Meta title