TestDriven.io(@testdrivenio) 's Twitter Profileg
TestDriven.io

@testdrivenio

Teaching practical programming through real-world applications. Tweets by @MikeHerman and @JanGiacomelli.

ID:937888350974787584

linkhttps://testdriven.io calendar_today05-12-2017 03:36:22

23,4K Tweets

34,8K Followers

162 Following

Follow People
TestDriven.io(@testdrivenio) 's Twitter Profile Photo

Asynchronous Tasks with Flask and Celery

testdriven.io/blog/flask-andโ€ฆ

This article looks at how to configure Celery to handle long-running tasks in a Flask app.

account_circle
Adam Johnson(@AdamChainz) 's Twitter Profile Photo

โœ๏ธ New post covering a admin extension I wrote to prevent a certain kind of inter-request state leakage.

Perhaps niche, perhaps worth adding to Django?

account_circle
TestDriven.io(@testdrivenio) 's Twitter Profile Photo

Python tip:

'yield' is a keyword in Python that's used to define generators.

When a function containing yield is called, it returns an iterator that can produce a sequence of values lazily, on the fly, one at a time.

The function's state is saved after each yield.

Python tip: 'yield' is a keyword in Python that's used to define generators. When a function containing yield is called, it returns an iterator that can produce a sequence of values lazily, on the fly, one at a time. The function's state is saved after each yield.
account_circle
TestDriven.io(@testdrivenio) 's Twitter Profile Photo

Modern Test-Driven Development in Python
testdriven.io/blog/modern-tdโ€ฆ

Interested in how TDD works?

This guide walks you through the process, using modern tools and techniques, from start to finish.

by @JanGiacomelli

account_circle
Bob Belderbos(@bbelderbos) 's Twitter Profile Photo

pre-commit helps with code quality:

- don't waste time on manual code formatting

- unified code base and adhering to style guides (eg PEP8)

- run linters early + often, it prevents bugs

- less review time + good dev habits

+ it's easy to set up, see: youtube.com/watch?v=XFyLzrโ€ฆ

account_circle
TestDriven.io(@testdrivenio) 's Twitter Profile Photo

Django tip:

Use 'SplitDateTimeField' to handle separate date and time entries, seamlessly combining them into a single datetime object.

Combine it with 'SplitDateTimeWidget' to render these inputs separately, ensuring uniformity across your forms.

Django tip: Use 'SplitDateTimeField' to handle separate date and time entries, seamlessly combining them into a single datetime object. Combine it with 'SplitDateTimeWidget' to render these inputs separately, ensuring uniformity across your forms.
account_circle
TestDriven.io(@testdrivenio) 's Twitter Profile Photo

Django tip:

You can perform a related lookup in Django admin.

For example, you can search books in the admin by the author ๐Ÿ‘‡

Django tip: You can perform a related lookup in Django admin. For example, you can search books in the admin by the author ๐Ÿ‘‡
account_circle
TestDriven.io(@testdrivenio) 's Twitter Profile Photo

Django tip:

Since Django 5.0, you can use 'form_field.as_field_group' to render all the related elements of a Django form field.

Django tip: Since Django 5.0, you can use 'form_field.as_field_group' to render all the related elements of a Django form field.
account_circle
TestDriven.io(@testdrivenio) 's Twitter Profile Photo

Django tip:

You can enable a search box on your admin list page.
You just need to provide a list of 'search_fields' (they must be a text field) ๐Ÿ‘‡

Django tip: You can enable a search box on your admin list page. You just need to provide a list of 'search_fields' (they must be a text field) ๐Ÿ‘‡
account_circle
Matt Harrison(@__mharrison__) 's Twitter Profile Photo

Mastering list comprehensions will supercharge your Python.

These are a compact, powerful way to do mapping, filtering, or looping operations.

Mastering list comprehensions will supercharge your Python. These are a compact, powerful way to do mapping, filtering, or looping operations.
account_circle
TestDriven.io(@testdrivenio) 's Twitter Profile Photo

If you need to apply multiple layers of validation to a form field, you can use 'ComboField'.

'ComboField' calls multiple Field clean() methods, allowing you to combine multiple validation rules.

Example ๐Ÿ‘‡

If you need to apply multiple layers of validation to a form field, you can use 'ComboField'. 'ComboField' calls multiple Field clean() methods, allowing you to combine multiple validation rules. Example ๐Ÿ‘‡
account_circle
Adam Johnson(@AdamChainz) 's Twitter Profile Photo

โœ๏ธ New post on searching through Djangoโ€™s Git log.

๐Ÿ”Ž I often do this to find behaviour changes when upgrading client projects, at least for larger ones.

account_circle
TestDriven.io(@testdrivenio) 's Twitter Profile Photo

Python tip:

Python's decorators allow you to add functionality to a function or method without modifying its code directly.
This can be useful for adding logging, caching, or other behaviour to your code.

Python tip: Python's decorators allow you to add functionality to a function or method without modifying its code directly. This can be useful for adding logging, caching, or other behaviour to your code.
account_circle
Tom Dekan(@tomdekan) 's Twitter Profile Photo

My guide '7 simple examples using Django GeneratedField โšก๏ธ' (buff.ly/4azcu9X ) was featured in Django News yesterday ๐ŸŽ Great to see ๐Ÿ™‚

My guide '7 simple examples using Django GeneratedField โšก๏ธ' (buff.ly/4azcu9X ) was featured in Django News yesterday ๐ŸŽ Great to see ๐Ÿ™‚ #django
account_circle
Socks(@tris0x) 's Twitter Profile Photo

best Guide for this topic i've found. thanks Mike! Dockerizing Django with Postgres, Gunicorn, and Nginx from @TestDrivenio by @mikeherman testdriven.io/blog/dockeriziโ€ฆ

account_circle
TestDriven.io(@testdrivenio) 's Twitter Profile Photo

Django tip:

In Django admin, 'inlines' allow you to edit models on the same page as their parent model.
You can choose between 'TabularInline' or 'StackedInline' for layout.

Django tip: In Django admin, 'inlines' allow you to edit models on the same page as their parent model. You can choose between 'TabularInline' or 'StackedInline' for layout.
account_circle
Stephen Gruppetta(@s_gruppetta_ct) 's Twitter Profile Photo

I guarantee this is the most useless fact you'll read todayโ€ฆ

You know when you print an object for a class without a `__repr__()` and you get the memory address?

Then you use `id()` and also get the memory address (in CPython), but it looks different?

They're the same number

I guarantee this is the most useless fact you'll read todayโ€ฆ You know when you print an object for a class without a `__repr__()` and you get the memory address? Then you use `id()` and also get the memory address (in CPython), but it looks different? They're the same number
account_circle
TestDriven.io(@testdrivenio) 's Twitter Profile Photo

Django tip:

Define methods in ModelAdmin to calculate and display data dynamically.
Use these methods in list_display to show custom values like counts or aggregates directly in your admin list view.

Django tip: Define methods in ModelAdmin to calculate and display data dynamically. Use these methods in list_display to show custom values like counts or aggregates directly in your admin list view.
account_circle
TestDriven.io(@testdrivenio) 's Twitter Profile Photo

Python tip:

The 'removesuffix' string method removes a specified suffix from a string if it exists.

Example ๐Ÿ‘‡

Python tip: The 'removesuffix' string method removes a specified suffix from a string if it exists. Example ๐Ÿ‘‡
account_circle
DjangoCon US(@djangocon) 's Twitter Profile Photo

Happy Friday folks! ๐Ÿฅณ If you're looking for something to do this weekend, submit a talk proposal to DjangoCon US.

The deadline is quickly approaching โฉ April 24, 2024 at 12 PM EDT.

Don't forget you can submit more than one!

2024.djangocon.us/news/cfp-last-โ€ฆ

account_circle