How To Submit Page Url In Google Search Console New Version

If you are a blogger or publisher, you should know google is the most valuable traffic driver engine. So after you write an original article with hard work, the first thing is to let google crawl and index the article content, this can let google know you are the original owner of that article. Google

How To Submit Page Url In Google Search Console New Version Read More »

What Does Double Underscore ( __ ) Means In Django Model QuerySet Objects Filter Method

You have learnd how to use Django model manager’s filter or exclude method to get query result data in article Django Simple CRUD Operation Example. To use filter method is so easy as below. Department.objects.filter(dept_desc__contains=’dev2qa’) <QuerySet [<Department: Development,Develop dev2qa.com website use Django>]> We can see that the filter function’s argument is dept_desc__contains=’dev2qa’, i think this is not difficult

What Does Double Underscore ( __ ) Means In Django Model QuerySet Objects Filter Method Read More »

How To Use Property Function / Decorator In Python

If you want to add an attribute to python class, you can use property() function or @property decorator. The two method all has advantages and disadvantages, and the goal of using that is to make code simple. After you define class attribute with property() function or @property decorator, your client code can invoke the class

How To Use Property Function / Decorator In Python Read More »

How To Create And Use Custom Model Managers In Django

We all know that model data operation in Django is so easy, you do not need to write any sql command at all, what you need to do is just use model class’s attribute objects ‘s methods to create, query, update and delete mode data records in backend database table like below. Suppose our model

How To Create And Use Custom Model Managers In Django Read More »

How To Force Reset Django Models Migrations

During the process of developing the example code in the article Django Bootstrap3 Example, when I change the model class source code ( for example add a new field ), I always want to migrate the changes to the backend database table immediately. But I found sometimes the migration does not take effect when the

How To Force Reset Django Models Migrations Read More »

How To Operate Foreign Key And Many To Many Field In Django Model

This example is based on the article Django Bootstrap3 Example, it reuse the Department and Employee model class. Suppose Department and Employee model are many to many relationships, that means one department can have multiple employees and one employee can belong to multiple departments. Then we need to do the following changes.

How To Operate Foreign Key And Many To Many Field In Django Model Read More »

How To Install Programs From Unidentified Developers In Mac OS

When I install a Mac application from the downloaded dmg file directly ( that means I do not install it from the Mac app store ), then the below error window will pop up. The error message is something like “iZipFast” can’s be opened because it is from an unidentified developer. This means that I

How To Install Programs From Unidentified Developers In Mac OS Read More »

How To Show Custom Model Columns Using Django Admin

In the previous article How To Add Models To Django Admin Site, we have learned how to manage your Django app’s model data in the Django project admin website. But even we implement the model class’s __str__(self) function, we can only display one model class column in the project admin site like the below picture.

How To Show Custom Model Columns Using Django Admin Read More »

How To Add Models To Django Admin Site

When you create a Django project and start the project built-in web server successfully, it also contains an admin website in this project. This admin website is the result of django.contrib.admin and django.contrib.auth Django applications. The Django project installed some default applications in the project settings.py file when you create it. You can find them in the INSTALLED_APPS section

How To Add Models To Django Admin Site Read More »