-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
daab923
commit 50ab23e
Showing
16 changed files
with
369 additions
and
123 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# https://medium.com/@hhuysamen/sending-emails-using-django-4-2-3e5de1ff64dc | ||
|
||
import ssl | ||
|
||
from django.core.mail.backends.smtp import EmailBackend as SMTPBackend | ||
from django.utils.functional import cached_property | ||
|
||
|
||
class EmailBackend(SMTPBackend): | ||
@cached_property | ||
def ssl_context(self): | ||
if self.ssl_certfile or self.ssl_keyfile: | ||
ssl_context = ssl.SSLContext(protocol=ssl.PROTOCOL_TLS_CLIENT) | ||
ssl_context.load_cert_chain(self.ssl_certfile, self.ssl_keyfile) | ||
return ssl_context | ||
else: | ||
ssl_context = ssl.create_default_context() | ||
ssl_context.check_hostname = False | ||
ssl_context.verify_mode = ssl.CERT_NONE | ||
return ssl_context |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,59 @@ | ||
asgiref==3.5.2 | ||
aenum==3.1.15 | ||
asgiref==3.7.2 | ||
backports.zoneinfo==0.2.1 | ||
boto3==1.26.79 | ||
botocore==1.29.79 | ||
certifi==2022.12.7 | ||
beautifulsoup4==4.12.2 | ||
boto3==1.26.163 | ||
botocore==1.29.163 | ||
bs4==0.0.1 | ||
certifi==2023.5.7 | ||
cffi==1.15.1 | ||
charset-normalizer==2.1.1 | ||
contourpy==1.0.6 | ||
cryptography==40.0.1 | ||
charset-normalizer==3.1.0 | ||
contourpy==1.1.0 | ||
cryptography==41.0.1 | ||
cycler==0.11.0 | ||
diagrams==0.23.3 | ||
Django==4.2.2 | ||
django-extensions==3.2.1 | ||
fonttools==4.38.0 | ||
django-extensions==3.2.3 | ||
fonttools==4.40.0 | ||
graphviz==0.20.1 | ||
gunicorn==20.1.0 | ||
idna==3.4 | ||
importlib-resources==5.12.0 | ||
isodate==0.6.1 | ||
jdcal==1.4.1 | ||
Jinja2==3.1.2 | ||
jmespath==1.0.1 | ||
kiwisolver==1.4.4 | ||
lxml==4.9.2 | ||
matplotlib==3.6.2 | ||
mysql-connector-python==8.0.32 | ||
mysqlclient==2.1.1 | ||
networkx==2.8.8 | ||
numpy==1.23.5 | ||
MarkupSafe==2.1.3 | ||
matplotlib==3.7.1 | ||
mysql-connector-python==8.0.33 | ||
mysqlclient==2.2.0 | ||
networkx==3.1 | ||
numpy==1.25.0 | ||
oauthlib==3.2.2 | ||
onelogin==3.1.0 | ||
packaging==21.3 | ||
Pillow==9.3.0 | ||
onelogin==3.1.5 | ||
packaging==23.1 | ||
Pillow==9.5.0 | ||
protobuf==3.20.3 | ||
pyclean==2.2.0 | ||
pyclean==2.7.3 | ||
pycparser==2.21 | ||
pydantic==1.10.9 | ||
pydot==1.4.2 | ||
PyJWT==2.6.0 | ||
pyOpenSSL==23.1.1 | ||
pyparsing==3.0.9 | ||
PyJWT==2.7.0 | ||
pyOpenSSL==23.2.0 | ||
pyparsing==3.1.0 | ||
python-dateutil==2.8.2 | ||
python3-saml==1.15.0 | ||
pytz==2022.6 | ||
pytz==2023.3 | ||
requests==2.31.0 | ||
requests-oauthlib==1.3.1 | ||
s3transfer==0.6.0 | ||
s3transfer==0.6.1 | ||
six==1.16.0 | ||
soupsieve==2.4.1 | ||
sqlparse==0.4.4 | ||
urllib3==1.26.12 | ||
typed-ast==1.5.4 | ||
typing_extensions==4.6.3 | ||
urllib3==1.26.16 | ||
xmlsec==1.3.13 | ||
zipp==3.15.0 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
asgiref==3.5.2 | ||
backports.zoneinfo==0.2.1 | ||
boto3==1.26.79 | ||
botocore==1.29.79 | ||
certifi==2022.12.7 | ||
cffi==1.15.1 | ||
charset-normalizer==2.1.1 | ||
contourpy==1.0.6 | ||
cryptography==40.0.1 | ||
cycler==0.11.0 | ||
Django==4.2.2 | ||
django-extensions==3.2.1 | ||
fonttools==4.38.0 | ||
gunicorn==20.1.0 | ||
idna==3.4 | ||
isodate==0.6.1 | ||
jdcal==1.4.1 | ||
jmespath==1.0.1 | ||
kiwisolver==1.4.4 | ||
lxml==4.9.2 | ||
matplotlib==3.6.2 | ||
mysql-connector-python==8.0.32 | ||
mysqlclient==2.1.1 | ||
networkx==2.8.8 | ||
numpy==1.23.5 | ||
oauthlib==3.2.2 | ||
onelogin==3.1.0 | ||
packaging==21.3 | ||
Pillow==9.3.0 | ||
protobuf==3.20.3 | ||
pyclean==2.2.0 | ||
pycparser==2.21 | ||
pydot==1.4.2 | ||
PyJWT==2.6.0 | ||
pyOpenSSL==23.1.1 | ||
pyparsing==3.0.9 | ||
python-dateutil==2.8.2 | ||
python3-saml==1.15.0 | ||
pytz==2022.6 | ||
requests==2.31.0 | ||
requests-oauthlib==1.3.1 | ||
s3transfer==0.6.0 | ||
six==1.16.0 | ||
sqlparse==0.4.4 | ||
urllib3==1.26.12 | ||
xmlsec==1.3.13 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# diagram.py | ||
from diagrams import Diagram | ||
from diagrams.aws.compute import EC2 | ||
from diagrams.aws.database import RDS | ||
from diagrams.aws.network import ELB | ||
|
||
with Diagram("Web Service", show=False): | ||
ELB("lb") >> EC2("web") >> RDS("userdb") | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# https://stackoverflow.com/questions/19475955/using-django-models-in-external-python-script | ||
from django.core.management.base import BaseCommand | ||
from django.core.mail import send_mail | ||
|
||
class Command(BaseCommand): | ||
help = "Test send_email" | ||
|
||
def handle(self, *args, **options): | ||
subject = "test from webstage8" | ||
fromaddr = "[email protected]" | ||
toaddr = ["[email protected]"] | ||
body = "this worked form gsl-webstage8" | ||
try: | ||
send_mail(subject, body, fromaddr, toaddr, fail_silently=False) | ||
except Exception as e: | ||
print("Exception: " + str(e)) | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
digraph "Web Service" { | ||
graph [fontcolor="#2D3436" fontname="Sans-Serif" fontsize=15 label="Web Service" nodesep=0.60 pad=2.0 rankdir=LR ranksep=0.75 splines=ortho] | ||
node [fixedsize=true fontcolor="#2D3436" fontname="Sans-Serif" fontsize=13 height=1.4 imagescale=true labelloc=b shape=box style=rounded width=1.4] | ||
edge [color="#7B8894"] | ||
aa87ab6ec1a5404f8a7dfbf745fd8a60 [label=lb height=1.9 image="/opt/ssop/venv/lib64/python3.9/site-packages/resources/aws/network/elastic-load-balancing.png" shape=none] | ||
"9c33105ee3a44262b91f00922e59e7a4" [label=web height=1.9 image="/opt/ssop/venv/lib64/python3.9/site-packages/resources/aws/compute/ec2.png" shape=none] | ||
aa87ab6ec1a5404f8a7dfbf745fd8a60 -> "9c33105ee3a44262b91f00922e59e7a4" [dir=forward fontcolor="#2D3436" fontname="Sans-Serif" fontsize=13] | ||
"48053bbab0ac4d80a16c6279e0859504" [label=userdb height=1.9 image="/opt/ssop/venv/lib64/python3.9/site-packages/resources/aws/database/rds.png" shape=none] | ||
"9c33105ee3a44262b91f00922e59e7a4" -> "48053bbab0ac4d80a16c6279e0859504" [dir=forward fontcolor="#2D3436" fontname="Sans-Serif" fontsize=13] | ||
} |
This file contains 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
Oops, something went wrong.