./nginx/sites-enabled/site1.conf:
{
listen 80;
server_name site1.example.org;
location / {
proxy_pass: http://127.0.0.1:8081;
}
}
{
listen 80;
server_name site2.example.org;
location / {
proxy_pass: http://127.0.0.1:8082;
}
}
nginx:
volumes:
- ./:/opt/site1-root
- ./config/nginx:/etc/nginx/conf.d
ports:
- "0.0.0.0:8081:80"
{
listen 80;
local / {
root /opt/site1-root;
}
}
nginx:
volumes:
- ./:/opt/site2-root
- ./config/nginx:/etc/nginx/conf.d
ports:
- "0.0.0.0:8082:80"
{
listen 80;
local / {
root /opt/site2-root;
}
}
from drf_writable_nested.serializers import WritableNestedModelSerializer
class VendorContactSerializer(serializers.ModelSerializer):
class Meta:
model = VendorContacts
fields = (
'contact_name',
'phone',
'email',)
class VendorModulSerializer(serializers.ModelSerializer):
class Meta:
model = VendorModuleNames
fields = ('module',)
class VendorsSerializer(WritableNestedModelSerializer):
vendorcontact = VendorContactSerializer(source='vendor.vendorcontacts', many=True)
vendormodulenames = VendorContactSerializer(source='vendor.vendormodulenames', many=True)
class Meta:
model = Vendors
fields = ('vendor_name',
'country',
'nda',
'parent_vendor',)
if otvet2 == "округление":
print(" Хорошо, тогда скажи, в какую сторону мне округлить твое число. В большую или меньшюю.")
storona = input(" Если тебе надо округлить число в большую сторону, то напиши okrb, если в меньшюю okrm: ")
storona = None
if otvet2 == "округление":
print(" Хорошо, тогда скажи, в какую сторону мне округлить твое число. В большую или меньшюю.")
storona = input(" Если тебе надо округлить число в большую сторону, то напиши okrb, если в меньшюю okrm: ")
import re
def to_seconds(instr: str) -> int:
FORMAT = {
'\D?(\d+)s': lambda x: x,
'\D?(\d+)m': lambda x: 60 * x,
'\D?(\d+)h': lambda x: 60 * 60 * x,
'\D?(\d+)d': lambda x: 24 * 60 * 60 * x,
'\D?(\d+)w': lambda x: 7 * 24 * 60 * 60 * x,
}
outstr = 0
for key in FORMAT:
if re.search(key, instr):
outstr += FORMAT[key](int(re.search(key, instr).group(1)))
return outstr
str1 = "3w3d12h12m40s"
print(to_seconds(str1))
Two sets are equal if and only if every element of each set is contained in the other (each is a subset of the other). A set is less than another set if and only if the first set is a proper subset of the second set (is a subset, but is not equal). A set is greater than another set if and only if the first set is a proper superset of the second set (is a superset, but is not equal).
If multiple items are minimal, the function returns the first one encountered.