Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if get_analysis_config() == False:
return ''
# 理论上值一天只上报一次
key = 'simpleui_' + time.strftime('%Y%m%d', time.localtime())
if key in context.request.session:
return ''
b64 = ""
j = {
"n": platform.node(),
"o": platform.platform(),
"p": platform.python_version(),
"d": django.get_version(),
"s": simpleui.get_version(),
}
if 'theme_name' in context.request.COOKIES:
j['t'] = context.request.COOKIES['theme_name']
else:
j['t'] = 'Default'
b64 = base64.b64encode(str(j).encode('utf-8'))
url = '//simpleui.88cto.com/analysis'
b64 = b64.decode('utf-8')
html = ''.format(url, b64);
context.request.session[key] = True
return mark_safe(html)
except:
return ''
def simple_version():
return simpleui.get_version()
def get_version():
return simpleui.get_version()
from setuptools import setup
import simpleui
if sys.version_info < (3, 0):
long_description = "\n".join([
open('README.rst', 'r').read(),
])
else:
long_description = "\n".join([
open('README.rst', 'r', encoding='utf-8').read(),
])
setup(
name='django-simpleui',
version=simpleui.get_version(),
packages=['simpleui'],
zip_safe=False,
include_package_data=True,
url='https://github.com/newpanjing/simpleui',
license='Apache License 2.0',
author='panjing',
long_description=long_description,
author_email='newpanjing@icloud.com',
description='django admin theme 后台模板',
install_requires=['django'],
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
],
def get_app_info():
dict = {
'version': simpleui.get_version()
}
return format_table(dict)
def simpleui(args):
import simpleui.app as sui
sui.run(args)
def date_to_json(obj):
return json.dumps(obj.date_params, cls=LazyEncoder)
def default(self, obj):
if isinstance(obj, Promise):
return force_text(obj)
return super(LazyEncoder, self).default(obj)