using (var wb = new XLWorkbook())
{
var ws = wb.Worksheet(0);
var imagePath = @"d:\\Projects\\Export_to_excel_1\\qrcode.jpg";
var image = ws.AddPicture(imagePath)
.MoveTo(ws.Cell("B3"))
.Scale(2.0); // optional: resize picture
wb.SaveAs("d:\\Projects\\Export_to_excel_1\\report.xlsx");
}
$(function () {
$.ajaxSetup({
headers: {
"X-CSRFToken": "{{ csrf_token }}"
}
});
})
Internal Server Error: /send/update/
Traceback (most recent call last):
File "C:\Soft\Python39\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
response = get_response(request)
File "C:\Soft\Python39\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
TypeError: update() missing 1 required positional argument: 'data'
[20/Mar/2021 16:31:23] "POST /send/update/ HTTP/1.1" 500 58115
*****@ServerUbuntu:~/samba/share/Projects/test_site$ pip3.8 install -U sqlite3
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement sqlite3
ERROR: No matching distribution found for sqlite3
<html>
<head>
<title>Test Update Data</title>
<script type="text/javascript">
function getnewdata(){
$.ajax({
url: '*.*.*.*:8000/update/',
type: 'get',
dataType: 'json',
success: function(data) {
alert(data);
}
});
}
$(document).ready(function(){
setInterval(getnewdata,1000);
});
</script>
</head>
<body>
<p>{{ tfree }}</p>
<p>{{ mfree }}</p>
</body>
</html>
def test(request):
tmem = {}
tmem["mfree"] = bytes2human(psutil.virtual_memory()[4])
tmem["tfree"] = str(datetime.datetime.now())
return render(request, 'test_update.html', tmem)
def update(tmem):
tmem = {}
tmem["mfree"] = bytes2human(psutil.virtual_memory()[4])
tmem["tfree"] = str(datetime.datetime.now())
#return JsonResponse(tmem)
return HttpResponse(json.dumps(tmem), content_type='application/json')
from django.contrib import admin
from django.urls import path
from showls import views
urlpatterns = [
path('', views.root),
path('test/', views.test),
path('update/', views.update),
]
.a{
appearance: button;
-webkit-writing-mode: horizontal-tb !important;
text-rendering: auto;
color: -internal-light-dark(black, white);
letter-spacing: normal;
word-spacing: normal;
text-transform: none;
text-indent: 0px;
text-shadow: none;
display: inline-block;
text-align: center;
align-items: flex-start;
cursor: default;
background-color: -internal-light-dark(rgb(239, 239, 239), rgb(59, 59, 59));
box-sizing: border-box;
margin: 0em;
font: 400 13.3333px Arial;
padding: 1px 6px;
#border-width: 2px;
border-width: 1px;
border-style: outset;
border-color: -internal-light-dark(rgb(118, 118, 118), rgb(133, 133, 133));
border-image: initial;
border-radius: 3px;
}
a:hover {
#background-color: #e5e5e5;
background-color: #ddd4d4;
}
a:active {
background-color: black;
}
a:visited {
background-color: #ccc;
}
<table>
<tr><th align="Left">OpenVpn Monitor</th><td><img src={% static 'showls/logo_vpn.png' %}></td><td><form action="http://*.*.*.*/vpnmonitor" method="get" target="_blank"><button type="submit">Открыть</button></form></td></tr>
</table>
<a title="OpenVpn Monitor" href="http://*.*.*.*/vpnmonitor">
<span style="color: #000000;">OpenVpn Monitor</a>
sudo iptables -A INPUT -i tun0 -j ACCEPT
sudo iptables -A FORWARD -i tun0 -j ACCEPT
sudo iptables -A FORWARD -s 10.8.0.0/24 -d 192.168.0.0/24 -j ACCEPT
sudo iptables -A FORWARD -s 192.168.0.0 -d 10.8.0.0/24 -j ACCEPT
sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o enp3s0 -j MASQUERADE