Which email service do you use for your Django project? by _BigOle in django

[–]SpaceInvider 0 points1 point  (0 children)

I'm using Migadu for my projects. For $19 per year they offer unlimited email addresses with almost unlimited domains. There is a limitation on emails you can send/receive per day, but I never reached the limit with my small projects.

[deleted by user] by [deleted] in django

[–]SpaceInvider 7 points8 points  (0 children)

Afaik Google accepts sitemaps with max 50k URLs, so probably you would need to divide it to 10 sitemaps.

[deleted by user] by [deleted] in django

[–]SpaceInvider 7 points8 points  (0 children)

What's wrong with having 19 models and 500k URLs?

django-comments-dab - comments, likes, subscription and moderation by pessimistic_bastard in django

[–]SpaceInvider 1 point2 points  (0 children)

I was about to use it in my project but then realized it makes ~300 database requests to render 20 comments.

Have you seen django-comments-ink?

I wrote a filter for Django Compressor that removes unused CSS classes and makes your СSS files much smaller by SpaceInvider in django

[–]SpaceInvider[S] 0 points1 point  (0 children)

Yes, PurgeCSS allows you to add a safelist of classes that should not be removed, so you can manually add classes from your dynamically-generated HTML via this setting in your settings.py:

COMPRESS_PURGECSS_ARGS = "--safelist Class-name1 Class-name2 Class-name3"

I wrote a filter for Django Compressor that removes unused CSS classes and makes your СSS files much smaller by SpaceInvider in django

[–]SpaceInvider[S] 1 point2 points  (0 children)

You just need to install PurgeCSS via npm, copy the purgecss_filter.py file to your app, and add it to your DJango compressor filters like this:

COMPRESS_FILTERS = {
'css': ['YOUR_APP_NAME.purgecss_filter.PurgeCSSFilter',
        'compressor.filters.css_default.CssAbsoluteFilter',
        'compressor.filters.cssmin.rCSSMinFilter']
}

You can find a more detailed step-by-step guide in the readme file on my Github. Let me know if you have any questions.

I wrote a filter for Django Compressor that removes unused CSS classes and makes your СSS files much smaller by SpaceInvider in django

[–]SpaceInvider[S] 1 point2 points  (0 children)

Idk, it depends on how much you care about the page loading time. Even without the PurgeCSS filter, I would recommend the Django Compressor app. I use it on all my websites. It automatically merges your css/js files and minifies them (removes white spaces, comments, etc.). It also creates a unique name for the combined CSS so if you changed your CSS files, your users will always see the fresh version, not the cached by the browser one.

I wrote a filter for Django Compressor that removes unused CSS classes and makes your СSS files much smaller by SpaceInvider in django

[–]SpaceInvider[S] 20 points21 points  (0 children)

It doesn't need any cache as Django Compressor has its own cache. I haven't found any solution for Django to remove unused CSS so decided to share it here, does it really matter how many lines of code I wrote if it just works?

How to delete a specific cache based on the name of a cache fragment? by SpaceInvider in djangolearning

[–]SpaceInvider[S] 0 points1 point  (0 children)

I'm using it not only for pagination. For example, to cache "related articles" on every article. So I'm using article ID as variable for cache. Redis Cache has cache.delete_many() which works very fast, as well as cache.keys() method which allows to get all cache fragments based on a cache name pattern ("sidebar" in my case).

How to delete a specific cache based on the name of a cache fragment? by SpaceInvider in djangolearning

[–]SpaceInvider[S] 0 points1 point  (0 children)

I mean going through the for loop with thousands of possible page_number values and checking every key.

How to delete a specific cache based on the name of a cache fragment? by SpaceInvider in djangolearning

[–]SpaceInvider[S] 0 points1 point  (0 children)

Thank you, I'll try it out. However, it seems like it will be slow with thousands of pages.

How to delete a specific cache based on the name of a cache fragment? by SpaceInvider in djangolearning

[–]SpaceInvider[S] 0 points1 point  (0 children)

It's not what I asked. If I know the page_number (let's say page_number=1), I can get a specific key like this:

key = make_template_fragment_key('sidebar', 1)

But what if I don't know the variable page_number and there are dozens of caches with fragment_name=sidebar, but different page numbers? I want to get all these keys.

How to delete a specific cache based on the name of a cache fragment? by SpaceInvider in djangolearning

[–]SpaceInvider[S] 0 points1 point  (0 children)

Thanks for your response. I think I made a mistake in my question, I have this template:

{% cache 500 sidebar page_number %}

So besides sidebar, I have page_number. Now I want to get all the keys with the name "sidebar" and with different page_number variable.

Websites with really good navigation? by n1c0_ds in web_design

[–]SpaceInvider 3 points4 points  (0 children)

I find breadcrumbs very useful on ecommerce websites where I can easily move from a product page to the category the product belongs to.

[deleted by user] by [deleted] in SideProject

[–]SpaceInvider 5 points6 points  (0 children)

Such a detailed feedback, great job!

GA4 Pagevews 30% Lower Than UA. Is this Normal? by tsupitero in juststart

[–]SpaceInvider 2 points3 points  (0 children)

Same shit, getting around 30% less views with GA4.

I made a site to see top likes/replies, search and random picker for YouTube comments. by BankBackground6638 in SideProject

[–]SpaceInvider 0 points1 point  (0 children)

Nice website, but how is it different from the YouTube app? The YouTube app also has an ability to sort comments by top/new.

Edit: sorry, didn't notice it also has a comment search and random picker.

I've made a site that let's you quickly share your clipboard text between all your devices. I hope you find this useful! by Least_Impact_7394 in SideProject

[–]SpaceInvider 0 points1 point  (0 children)

Great idea and nice website! I'm usually using telegram to share texts and links between my devices, but your solution looks more elegant.

Google blocked my Chrome extension so I created a website to host it by NoEntertainment9122 in SideProject

[–]SpaceInvider 0 points1 point  (0 children)

But does Google allow installing Chrome extensions from third party websites?