Python Leftovers

-
Create a JSON Response in Python
JSON (JavaScript Object Notation) file is a very popular medium to interchange data between different formats. It contains data in text format that is supported by various languages such as Python, PHP, PERL, etc. The main purpose of the JSON file is to transfer data between the server and the client. The requests are generated by Python to retrieve the data from a particular resource URI. If the response of the request is returned in JSON format then the content of the response can be retrieved using the response.json() function. It returns the response by using a Python dictionary object. How this function can be used to parse JSON response using the Python request library will be shown in this tutorial.
-
Use of Django Request and Response Objects – Linux Hint
The Request-response cycle is used to transfer the data between the client and server in all types of web APIs. The client-server architecture is used in the Django framework to implement the web application. The request and response are the two main components of the client-server application. An HttpRequest object is created in the Django application when a client requests any resource. A particular view function is used to handle the request and send the response using the HttpResponse object. The uses of different attributes and methods of HttpRequest and HttpResponse classes of the Django framework will be explained in this tutorial.
-
Form Validation in Django – Linux Hint
Form validation is a very important task for any web application to enter valid data in the database. The users of the application will not be able to insert invalid data if the form data are validated before submitting. Django is called MVT (Model View Template) based framework where the task of the controller is done by this framework itself. The database-related tasks are done by Model and the data are presented to the template using View. The fields of a form are generated based on the particular model that will insert data into the Django database after validation. One type of validation is done by the browser-based on the field type that is defined in the model. Using the is_valid() function is another way to check the form data whether they are valid or not after submitting the form. This tutorial will show you how the data can be inserted into the Django database after validating the form.
-
How to Build a Basic Search for a Django Site? – Linux Hint
A particular content of any site is normally retrieved by the users through Google search. However, if this search option is implemented on the website, then the users can easily find their desired content within the site without using Google search. . Another benefit of adding a search option within a website is that the developer can manage the searching output properly. That means he can control which content of the site will appear or not. This tutorial will show the process of implementing the basic search in the Django site.
-

- Login or register to post comments
Printer-friendly version- 2351 reads
PDF version
More in Tux Machines
- Highlights
- Front Page
- Latest Headlines
- Archive
- Recent comments
- All-Time Popular Stories
- Hot Topics
- New Members
digiKam 7.7.0 is released
After three months of active maintenance and another bug triage, the digiKam team is proud to present version 7.7.0 of its open source digital photo manager. See below the list of most important features coming with this release.
|
Dilution and Misuse of the "Linux" Brand
|
Samsung, Red Hat to Work on Linux Drivers for Future Tech
The metaverse is expected to uproot system design as we know it, and Samsung is one of many hardware vendors re-imagining data center infrastructure in preparation for a parallel 3D world.
Samsung is working on new memory technologies that provide faster bandwidth inside hardware for data to travel between CPUs, storage and other computing resources. The company also announced it was partnering with Red Hat to ensure these technologies have Linux compatibility.
|
today's howtos
|








.svg_.png)
Content (where original) is available under CC-BY-SA, copyrighted by original author/s.

Recent comments
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago
1 year 11 weeks ago