Topics
  • Most Recent Stories
  • Trending Stories
  • Miscellaneous
  • Python
  • PHP
  • MySql
  • jQuery
  • CS CART
  • Ubuntu
  • Django
  • WordPress
  • React Js
  • Woocommerce
  • Selenium
  • JavaScript
  • Programming
  • Node Js
  • Angular Js
  • Memory
  • Encryption and Decryption
  • Cryptography
  • ORM

Questions and Answers

Answer written - Django
author
,
Fond of IT
To overcome the above shared problem, we use "Custom template tags" feature of Django. It is one of the great feature to handle common section which gets display in base.html template and be available in all templates those are using base template. Suppose there is a section to display about text in sidebar and you want to write code once and use it in all templates without calling it in all views... (more)
Question Asked - MySql
author
,
Fond of IT
Please find below the Latest interview questions and answers: jQuery: 1- What is event capturing and bubbling? 2- What does Bind and Call function do? 3- What is the difference between $(document).ready and $(window).load, and which one loads faster? 4- What is Closures in js? 5- What does Cache argument do in ajax? MySql: 1- What is Primary key and Candidate key with difference? 2- H... (more)
Answer written - Django
author
,
Fond of IT
To start debugging in django while doing development you will need to follow below steps and get to go: 1- $pip install django_extensions Now include in settings.py under INSTALLED_APPS as 'django_extensions'. 2- $pip install werkzeug You have set all required things for debugging, just need to write below statement where you want to debug: 3- assert False, latest_poll_list   It wil... (more)
Answer written - Python
author
,
Fond of IT
You can connect with MySql database in Python using mysql connector python. You will need to install it first using below command and import it in your program. Refer to below example how to install and execute sql queries. pip install mysql-connector-python Example: import mysql.connector from mysql.connector import Error try:     cn = mysql.connector.connect(host='localhost',datab... (more)
Answer written - Django
author
,
Fond of IT
Django comes with sqlite as database backend but you can use any of the database as per your need. To use MySql as database in django you will need to do some modification in settings.py file in DATABASES dictionary, refer to below line of code to proceed easily: By default you will see below code: DATABASES = {     'default': {         'ENGINE': 'django.db.backends.sq... (more)
Answer written - Python
author
,
Fond of IT
##Write a Python program to get the difference between a given number and 17, if the number is greater than 17 return double the absolute difference. def get_difference(n):   if n < 17:     return 17 - n   else:     return (n - 17)*2 diff1 = get_difference(15) diff2 = get_difference(20) print(diff1) print(diff2) ########################### ##Write a Python program to calculate the sum of ... (more)
Answer written - Python
author
,
Fond of IT

You can use datetime module to get number of days between two dates, refer to below example to get the result:

from datetime import date

start = date(2019, 5, 1)  //Put start date
end   = date(2019, 5, 10) // Put end date

number_of_days = end - start
print(number_of_days.days)

Answer written - Python
author
,
Fond of IT

We can get the same format as below using print function in Python:

print("""
  A string that you "don't" have to escape 
  this 
  is a ............. multi-line 
  heredoc string -----------------> example
  """)

Answer written - WordPress
author
,
Fond of IT
Yes you can change the wordpress login screen label like username of email address to only email address as per your choice. We have login_head action and gettext filter using combination of these hook we can modify the label. Please follow the below example for better understanding:    //Modify login label function login_screen() {     add_filter( 'gettext', 'modify_label', ... (more)
Answer written - Python
author
,
Fond of IT
You can get a python program below which will take two arguments year (eg. 2019) and month (eg. 6) in integer format and will display complete calendar of the month from that year you will enter from console. import calendar year = int(input("Please enter year:")) month = int(input("Please enter month:")) print(calendar.month(year, month))   Just paste the above code in a python file and ex... (more)