Customize the Django Admin With Python

The Django framework comes with a powerful administrative tool called admin. You can use it out of the box to quickly add, delete, or edit any database model from a web interface. But with a little extra code, you can customize the Django admin to take your admin capabilities to the next level.
In this tutorial, you’ll learn how to:

Add attribute columns in the model object list
Link between model objects
Add filters to the model object list
Make model object lists searchable
Modify the object edit forms
Override Django admin templates

Free Bonus: Click here to get access to a free Django Learning Resources Guide

Continue reading the original article

Tesseract OCR for Non-English Languages

In this tutorial, you will learn how to OCR non-English languages using the Tesseract OCR engine.

If you refer to my previous Optical Character Recognition (OCR) tutorials on the PyImageSearch blog, you’ll note that all of the OCR text is in the English language.

But what if you wanted to OCR text that was non-English?

What steps would you need to take?

And how does Tesseract work with non-English languages?

We’ll be answering all of those questions in this tutorial.

To learn how to OCR text in non-English languages using Tesseract, just keep reading.

Looking for the source code to this post?
Jump Right

Continue reading the original article

PyDev of the Week: Or Carmi

This week we welcome Or Carmi (@liiight) as our PyDev of the Week! Or is the creator and maintainer of notifiers. You can see what else Or has been up to by checking out his Github profile.
Let’s spend some time getting to know Or better!
Can you tell us a little about yourself (hobbies, education, etc):
My name is Or Carmi. I’m 38 years old, live in Israel, married and a father of 4 boys. I have 2 dogs, 4 cats, an African grey parrot, a rabbit and a bulbul (look it up ????). I currently work as a senior QA automation

Continue reading the original article

7 Sources of Passive Income for Coders

These are the types of passive income:

Affiliate earningsAdvertising earningseBooksOnline coursesSaaSIndex funds and exchange-traded funds (ETFs)Real estate

Where to Go From Here?

Enough theory, let’s get some practice!

To become successful in coding, you need to get out there and solve real problems for real people. That’s how you can become a six-figure earner easily. And that’s how you polish the skills you really need in practice. After all, what’s the use of learning theory that nobody ever needs?

Practice projects is how you sharpen your saw in coding!

Do you want to become a code master by focusing on practical code projects that actually earn

Continue reading the original article

How to Create a Database Table with pyodbc in Python

In this article, you will get the necessary information on how to create a table in SQLite using the package pyodbc in Python.  Example code is included and a link to a Github repo will be provided in the references section.

Prerequisites

To use pyodbc in this article some prerequisites need to be met.

ODBC Driver – you need to download and install the ODBC driver for the database provider you are using. In this article, I am using SQLite.  Downloaded an ODCB driver for sqlite3 from http://www.ch-werner.de/sqliteodbc/,SQLite3 – this article assumes that you have SQLite3 in your system and have created a

Continue reading the original article

Real Python Podcast Interview

I am on the latest Real Python podcast where I talk about my ReportLab book, wxPython, and lots more.
The podcast episode that I take part in is called Episode 20: Building PDFs in Python with ReportLab. Check it out and feel free to ask questions in the comments.
Related Articles

Talk Python Podcast and Twitter Q&A

Profitable Python Episode: Put Your Family First

My (abridged) Career in Python – Podcast.__init__ Interview

The post Real Python Podcast Interview appeared first on The Mouse Vs. The Python.

Continue reading the original article

PEP 8: Hanging Indentation and Closing Brackets in Python

PEP 8 purists are ready to attack you and your code if they catch you not complying with the PEP 8 standard. For instance, Python coders put their braces, brackets, or parentheses into a separate line to make it easier to grasp nested lists or dictionaries.

This article shows how to line up the closing braces, brackets, and parentheses correctly in Python. This is called “hanging indentation” and it’s at the heart of PEP 8 standardized, clean code that’s easy to read and understand!

A quick example shows how you can create a multi-line construct that complies with the PEP 8

Continue reading the original article

Python One Line Return if

Problem: How to return from a Python function or method in single line?

Example: Consider the following “goal” statement:

def f(x):
return None if x == 0

However, this leads to a Syntax error:

In this tutorial, you’ll learn how to write the return statement with an if expression in a single line of Python code. You can get an overview of the three methods in the interactive code shell:

Exercise: The code has no output. Print the results of all three function executions for a given x. Is it always the same?

Let’s dive into the three methods.

Method 1: As a Multi-Liner

The following

Continue reading the original article