Hardik Rana

Intersted in Machine learning and artificial intelligence.Exploring various fields of computer science like web development,Android development

Models In Django-Free Django Tutorials

Objects in Django In object-oriented programming there is a concept called object.The idea behind object is that instead of writing everything as a sequence programming instructions,we can model things and can also define how they interact with each other. So object is a collection of actions and properties.Let’s understand it by example. Suppose if we …

Models In Django-Free Django Tutorials Read More »

Writing Your First Blog App In Django-Part 3

We will continue to build our blog app where we left in the post writing-your-first-blog-app-in-django-part-2 Now let’s change our blog app little bit to get clear url rendering.Change the main blog app’s url.py file as following: from django.contrib import admin from django.urls import path from django.conf.urls import include,url urlpatterns = [ path(‘admin/’, admin.site.urls), path(‘articles/’, include(‘articles.urls’)), ] …

Writing Your First Blog App In Django-Part 3 Read More »

Django ORM and QuerySets – Free Django Tutorials

What is a queryset? For a given any model,a queryset is a list of objects.With the use of queryset user can read the data from database and can also order it. Let’s learn it by example. Django shell Go to the directory where we have blog app saved which we are creating in this post https://padhle.com/writing-your-first-blog-app-in-django-part-2/ in …

Django ORM and QuerySets – Free Django Tutorials Read More »

Templates In Django – Free Django Tutorials

What is a Template? A template is an HTML file that contains the design for our website. Why templates? Consider this function which can be written in a views.py file def current_datetime(request): now = datetime.datetime.now() html = “<html><body>It is now %s.</body></html>” % now return HttpResponse(html) Although this technique is useful for the purpose of explaining …

Templates In Django – Free Django Tutorials Read More »