- Docker: v18.06.0+
- Docker Compose: v1.22.0+
- Ports 80 and 443 should be open
- Hardware:
- Minimum configuration: 4 GB RAM, 2 CPU, 8 GB disk space
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This module is contains a handy tool to bulk delete DNS records from Cloudflare DNS via API | |
Usage: | |
```bash | |
git clone https://gist.github.com/bb15b3fc54ec6cbe7476b52c49e7c4aa.git | |
cd bb15b3fc54ec6cbe7476b52c49e7c4aa | |
python3 ./cloudflare_bulk_delete_dns.py your_api_token zone_id | |
``` | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# main/models.py | |
from django.core.validators import MaxValueValidator | |
class Product(WithSlug): | |
... | |
# all the other fields | |
tax_rate = models.PositiveIntegerField( | |
default=25, | |
help_text=_("Tax rate"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run the folder (recursively) finds all files of the provided extension | |
# or all files. | |
# Counts number of lines in each file. | |
# prints put the top 10 bigest files, by number of lines | |
# require python ver.: 3.9+ | |
from pathlib import Path | |
def all_files(path=".", extention=None): | |
_ext = "**/*" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vars = ["var", "var1", "var2"] | |
with open("test.txt", "w+") as f: | |
for v in vars: | |
f.write(v + " ") | |
# test.txt | |
# var var1 var2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vars = ["var", "var1", "var2"] | |
with open("test.txt", "w+") as f: | |
for v in vars: | |
f.write(v + " ") | |
# text.txt | |
var var1 var2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.auth.models import User | |
class BillingProfile(models.Model): | |
payer = models.ForeignKey(User, on_delete=models.CASCADE) |