2021-06-03 PostgreSQL autovacuum + pypa advisory-db + Django + sphinx + Django + htmx

Make web development simple and fun again

../../../_images/revolution.jpg

Learned about htmx with at @guettli

../../../_images/sketch.jpeg

https://twitter.com/aspigirlcodes/status/1400446411586433024?s=20

Revolution

../../../_images/revolution_2.jpg

Django Function based views

foo_page(request, ...) → returns page response. URL: /foo

foo_hx(request, ...) → returns fragment response. URL: /foo_hx

foo_html(...) → returns HTML SafeString (for internal re-use)

HTMX is great for

HTMX is great for:

  • super fast Largest Contentful Paint (LCP) (Great first-time-user experience, and SEO). Compare this to loading of Gmail.

  • Professional, serious (but boring) stateless applications (like Shops, ERP systems, database front-ends)

  • MVP, optimize later.

NOT:

  • offline-first applications.

  • Interactive Chart-Library

  • WYSIWYG Editor

Djangocon Europe

PostgreSQL

Django architecture

Enabling and disabling autovacuum in PostgreSQL

decp.info Données Essentielles de la #CommandePublique (DECP) et datasette

Suite à pas mal de demandes, j’ai créé un moyen accessible de s’approprier les Données Essentielles de la #CommandePublique (DECP) .

pypa

Django + sphinx

Serve your Sphinx docs with Django.

Installation

Install using pip:

pip install django-sphinx-view

Then add sphinx_view to INSTALLED_APPS for template discovery:

INSTALLED_APPS = [
    ...
    "sphinx_view",
    ...
]

That’s it. You’re good to go.

Roadmap

django-sphinx-view has two goals and one non-goal.

Goals:

  • The key DocumentationView view class to serve the rendered JSON files. Initial version is in place. I imagine small API adjustments going forwards but little else.

  • A Sphinx template bridge that will allow using the DTL when rendering the HTML docs using make html and the HTMLBuilder. This will complete the circle, so to speak, and allow building your docs to static HTML or if you don’t have the Django development server available.

The non-goal is to replace Sphinx themes in general. django-sphinx-view is about integrating Sphinx built docs into your Django site. You bring the styling, you bring the theme.

Firefox translations, projet Bergamot

No more installing additional extensions.

You can get the Firefox Translation feature – right at the browser window natively. You can easily translate to English and other available languages. Here’s how.

The project was introduced long back in 2019 and earlier named Project Bergamot .

It came as an extension and eventually landed in Firefox Nightly – which is the development version of this popular web browser.

This feature is officially named Firefox Translation and a bit different than Google Chrome’s translation feature. The entire translation happens locally in your system in contrast to Google Chrome’s translation feature. Google Chrome uses, Google’s own Translate engine and it happens on the cloud.

That means your data is safe . And you can safely translate foreign languages to English or any other available language.

As of writing this, this feature is available in Firefox Nightly version 90.0a1. Here’s how to download Firefox Nightly and enable this feature.

  • Go to “ about:config ” via the address bar.

  • Search for boolean property “extensions.translations.disabled“. By default, it should be set to True.

  • To enable translation in Firefox, change the value to False.

  • Restart Firefox

As of writing this, there are only two languages (Estonian and Spanish) is available in Firefox Nightly for translation

We hope more language feature lands in the future and eventually available for all users. Being a nighly and in-development feature, we can’t fairly know when it would be available in the stable channel.

But the framework is ready and being tested, all it requires is additional language supports to be added.

I wish it would have landed in Firefox Proton which brings many fundamental changes to Firefox.

We bring the latest happenings in the Linux universe, app reviews, tutorials, easy to understand guides for you. Stay in touch via Telegram, Twitter, YouTube, and Facebook and never miss an update!