# https://docs.djangoproject.com/en/3.0/ref/contrib/contenttypes/#the-contenttypemanager

 

(BlogVenv) C:\Work\Software\eclipse-jee-2019-12-R-win32-x86_64\workspace\Blog>BlogVenv\Scripts\activate

(BlogVenv) C:\Work\Software\eclipse-jee-2019-12-R-win32-x86_64\workspace\Blog>python manage.py shell --settings=Blog.settings.settings_dev
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 19:29:22) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.contrib.contenttypes.models import ContentType
>>> from post.models import Post
>>>
>>> ContentType.objects.get(model='post')
[DEBUG] [2020-04-16 00:14:01,856] (0.000) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE "django_content_type"."model" = 'post'; args=('post',)

<ContentType: post>
>>>
>>> ContentType.objects.get_for_model(Post)
[DEBUG] [2020-04-16 00:14:11,427] (0.000) SELECT "django_content_type"."id", "django_content_type"."app_label", "django_content_type"."model" FROM "django_content_type" WHERE ("django_content_type"."app_label" = 'post' AND "django_content_type"."model" = 'post'); args=('post', 'post')

<ContentType: post>
>>>