import time
Then add the below code
#Finding the daylight saving time
is_dst = time.daylight and time.localtime().tm_isdst > 0
utc_offset = (time.altzone if is_dst else time.timezone)
#Checking for negative and positve offset values
if(utc_offset > 0):
utc_offset_hours = (utc_offset / 3600)
sign = '- '
else:
utc_offset_hours = (-(utc_offset) / 3600)
sign = '+ '
utc_offset_minutes = (utc_offset % 3600) / 60
#Converting Integer values to string before concatenating
utc_offset = sign + str(utc_offset_hours) + '.' +str(utc_offset_minutes)
print utc_offset
Then add the below code
#Finding the daylight saving time
is_dst = time.daylight and time.localtime().tm_isdst > 0
utc_offset = (time.altzone if is_dst else time.timezone)
#Checking for negative and positve offset values
if(utc_offset > 0):
utc_offset_hours = (utc_offset / 3600)
sign = '- '
else:
utc_offset_hours = (-(utc_offset) / 3600)
sign = '+ '
utc_offset_minutes = (utc_offset % 3600) / 60
#Converting Integer values to string before concatenating
utc_offset = sign + str(utc_offset_hours) + '.' +str(utc_offset_minutes)
print utc_offset
1. Enable virtualevn using command 'soure bin/activate'
2. Then try the command 'echo $PATH' to show it's path. Then it will show the path with like given below
/var/path/virtauanenv/bin
3. Go the the package folder which you want to install. Then use the below command
/home/user/package/folder$ /var/path/virtauanenv/bin/python setup.py install
2. Then try the command 'echo $PATH' to show it's path. Then it will show the path with like given below
/var/path/virtauanenv/bin
3. Go the the package folder which you want to install. Then use the below command
/home/user/package/folder$ /var/path/virtauanenv/bin/python setup.py install
How to embed image content in src atrribute
By Webdevelopmentlogics
Adding Api Token Authentication in django
By Webdevelopmentlogics
1. Add the following in the settings file
INSTALLED_APPS = (
.......
'rest_framework.authtoken',
)
2. In the PUBLIC_URLS add the url configuration to support the api calls
re.compile(r'^/folder/'),
3. Change the url configration file to support the api urls
url(r'^client/', include('apps.admin.client.urls')),
url(r'^server/', include('apps.api.server.urls')),
INSTALLED_APPS = (
.......
'rest_framework.authtoken',
)
2. In the PUBLIC_URLS add the url configuration to support the api calls
re.compile(r'^/folder/'),
3. Change the url configration file to support the api urls
url(r'^client/', include('apps.admin.client.urls')),
url(r'^server/', include('apps.api.server.urls')),
Older Posts
< ||| > > > Newer Posts