template filters for slice string and print new lines in Django filters

python html django 3 weeks ago
<!-- will give first 100 characters from my_string --> {{ my_string | slice:"100 "}} <!-- will automatically print new lines if given (like textarea inputs) --> {{ my_para | linebreaks }}
35
Posted By
work with react without node installation in
//Basic way
<!DOCTYPE html>
<html>
javascript react js html
harika
Render custom components without node install
<!DOCTYPE html>
<html>
  <head>
react js html
harika
How to get first element of the list in Djang
<h3> Print all elements</h3>
<div>
    {% for item in my_list %}
html python django
kishore_kumar
Search options in bootstrap select , search s
<script src="https://ajax.googleapis.com
<script src="https://maxcdn.bootstrapcdn
<link href="https://maxcdn.bootstrapcdn.
html bootstrap
kishore_kumar
How to iterate json object in angular js
<html>
    <body>
        <table data-ng-repeat="(key, val
html json angular js
harika
How to get key value pairs of json object in
<html>
    <body>
        <table data-ng-repeat="(key, val
html json angular js
harika
for loop counter in python Django template
{% for my_object in my_object_list %}
    {{ forloop.counter }} {# starting in
    {{ forloop.counter0 }} {# starting i
python django html
kishore_kumar
Python Script to create AWS beanstalk
#!/usr/bin/python
  
import boto
python aws beanstalk
sandeep sandeep
List all files and folders using python os mo
import os

def list_files_folders(path):
python python-os
kishore_kumar
Get current environment variables in python
import os
env = os.environ

python python-os
kishore_kumar
Get os details using python os
import os
print os.uname()
# Don't use os.system('uname -a'), its j
python python-os
kishore_kumar
Get stats ( lines, words, char count ) of fil
def file_stats(path):
    f = open(path, 'r')
    lines = f.readlines()
python
kishore_kumar
Use map function in python
def get_double(num):
    return num * 2

python
kishore_kumar
Python sample codes for beginners
print "Welcome to python"
python
gaya38 gaya38
Python program for even number checking
a=input("Enter a value:")
if (a%2==0):
    print "The given number is even numb
python
gaya38 gaya38
Python program for prime number check
a=input("Enter a value:")
k=0
b=(a/2)+1
python
gaya38 gaya38
Pass command line arguments in python
import sys
x=len(sys.argv)
a=[]
python
gaya38 gaya38
Python program for the largest number in an a
a = [1,43,98,5]#Dummy data
for l in range(len(a)-1):
        if (a[l]>a[l+1]):
python
gaya38 gaya38
print list of even numbers within a range
n=100
a=[10,20,30,40,50]
b=[60,70,80,90]
python
gaya38 gaya38
generate fibonacci series in python
n=input("Enter the constraint to print n
m=input("Enter the maximum value to prin
a=0
python
gaya38 gaya38