Python Tutorial

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 Return Html File As Django View Response Read More »

How To Use Django url Tag And reverse() Function To Avoid Url Hard Coded

Hard coded url in your Django template html files or views.py file is a bad practice. Because it is difficult to maintain url changes. If you change one url, you may need to change that url in a lot of pages. So Django provide template url tag and reverse function for you to avoid hard

How To Use Django url Tag And reverse() Function To Avoid Url Hard Coded Read More »

How To Write Text In Jupyter Notebook And IPython To File

IPython provides a lot of magic commands, with the %%writefile command, you can create a text file and write text in jupyter notebook to the file in the IPython interface easily. This article will show you two examples to demo how to open a file in jupyter notebook and how to write text in jupyter

How To Write Text In Jupyter Notebook And IPython To File Read More »

How To Get Many To Many Model Field Values In Django View

We have learned how to add many to many fields for Django models in the article How To Operate Foreign Key And Many To Many Field In Django Model. But when we display the many to many field values ( in this example is the Employee’s Department values ) in Django Html template page, we

How To Get Many To Many Model Field Values In Django View Read More »

How To Add Interactive Widget ( Slide Bar ) In Jupyter Notebook

In the previous article, we have told you how to add rich media output components ( audio, video, image, etc) in jupyter notebook. But all those widgets are not interactive. This article will show you an example of how to add a slide bar in jupyter notebook. When you slide the bar, it will change

How To Add Interactive Widget ( Slide Bar ) In Jupyter Notebook Read More »

How To Display Rich Output Media ( Audio, Video, Image etc) In IPython Jupyter Notebook

The package IPython.display provides a lot of classes for you to display rich media objects in the Jupyter notebook directly and immediately. Using classes in the IPython.display package, you can display audio (local or remote ), video(youtube or local ), image, local file links, Html data in the Jupyter notebook. This article will show you

How To Display Rich Output Media ( Audio, Video, Image etc) In IPython Jupyter Notebook Read More »

How To Use IPython Jupyter Notebook To Develop Python Code

IPython is an enhanced Python interactive environment, you can run all Python source code in IPython. And it provides more features that make your development process easy. Jupyter notebook is a browser-server based website tool that can save your python source code in a .ipynb notebook file, and then when you submit the python source

How To Use IPython Jupyter Notebook To Develop Python Code Read More »

How To Install Anaconda On Linux, Windows, MacOS Correctly

Anaconda is a scientific Python distribution that contains a lot of not often used scientific python libraries. If you want to do data analysis, scientific computing, you can install the anaconda and use it to implement what you want. But after I install anaconda on Linux, I found that I can not use it correctly.

How To Install Anaconda On Linux, Windows, MacOS Correctly Read More »