Python Django
Hello World Django PyCharm Example
PyCharm is a very popular Python programming IDE. It provides a lot of tools for you to make Python development easy. This article will tell you how to use it to develop Django web application step by step. The PyCharm IDE is the professional version. If you do not want to buy the professional version, …
Django Class Based View Vs Function Based View
The Django view function is responsible to process user request and return a django.http.HttpResponse object to client browser. And view function is defined in Django app views.py file. But besides this, you can also define custom view class to achieve same purpose. Your view class should extends Django provided built-in class-based generic views such as …
How To Enable Or Disable CSRF Validation In Django Web Application
Django has provided a feature that can help you to avoid csrf attacks on your Django application. But sometimes especially in your development environment, you do not want this feature when sending post requests to your web server use curl in the command line, if this feature is enabled, you will get errors. This article …
How To Enable Or Disable CSRF Validation In Django Web Application Read More »
How To Return Html File As Django View Response
Morden web application are all designed with MVC( Model, View, Controller ) pattern. But in django, the pattern name is MTV( Model, Template, View Function ). So in django, template html is the view, and view function plays the role of controller. This article will tell you how to create template and view function in …
How To Create Django View Template Files Structure Correctly Use Block & Include Tag
We use template Html files in the Django web application to render model data. And Django provides a very clear and easy way for you to manage the combination of layout page and content page. So you can define the layout page in one template Html file, and then define the content page in another …
How To Create Django View Template Files Structure Correctly Use Block & Include Tag Read More »
How To Assign Variables To Child Template Use {% include %} Tag In Django
We have learned how to add search result pagination to the user list page in the article Django Filter And Pagination Example. In that example, we use below Html code in DjangoHelloWorld / templates / dept_emp / user_list.html template file to add pagination. But how to add pagination to other list pages such as dept_list.html …
How To Assign Variables To Child Template Use {% include %} Tag In Django Read More »
How To Create Canonical Url In Django
Canonical url is a url that tell search engine ( google, bing etc ) which url is the primary url for same content web pages. It is used to fix the duplicate content issue with different webpage url formats. So that search engine will know all the url that generate same web content is belongs …