From c309cd3f0de79eb8617e029f23f74c29765cf17d Mon Sep 17 00:00:00 2001 From: dongho Date: Wed, 11 Dec 2024 02:07:36 +0900 Subject: [PATCH] first commit --- main.py | 27 +++ security/__init__.py | 1 + security/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 189 bytes security/__pycache__/security.cpython-310.pyc | Bin 0 -> 801 bytes security/security.py | 17 ++ templates/base.html | 46 ++++ templates/browser_random_number.html | 198 ++++++++++++++++++ templates/browser_security_random_number.html | 19 ++ templates/index.html | 14 ++ 9 files changed, 322 insertions(+) create mode 100644 main.py create mode 100644 security/__init__.py create mode 100644 security/__pycache__/__init__.cpython-310.pyc create mode 100644 security/__pycache__/security.cpython-310.pyc create mode 100644 security/security.py create mode 100644 templates/base.html create mode 100644 templates/browser_random_number.html create mode 100644 templates/browser_security_random_number.html create mode 100644 templates/index.html diff --git a/main.py b/main.py new file mode 100644 index 0000000..1208c9b --- /dev/null +++ b/main.py @@ -0,0 +1,27 @@ +from fastapi import FastAPI, APIRouter, Request +from fastapi.templating import Jinja2Templates +from security import security_router +import uvicorn + +app = FastAPI() +app.include_router(security_router) + +templates = Jinja2Templates(directory="templates") + + +@app.get("/") +async def read_root(request: Request): + data = "hi" + return templates.TemplateResponse( + request=request, + name="index.html", + contents={"data": data} + ) + +if __name__ == "__main__": + uvicorn.run( + "main:app", + host="0.0.0.0", + port=8080, + reload=True + ) diff --git a/security/__init__.py b/security/__init__.py new file mode 100644 index 0000000..6946f4e --- /dev/null +++ b/security/__init__.py @@ -0,0 +1 @@ +from .security import security_router diff --git a/security/__pycache__/__init__.cpython-310.pyc b/security/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..455170e763a40c8fa1b79df00e59c13b69041eae GIT binary patch literal 189 zcmd1j<>g`kf-={LbTuIT7{oyaOhAqU5Elyoi4=wu#vF!R#wbQch7_h?22JLdj6h*c z##{WwsmY~9nI)C+Mfs&AsYQO8Ot&~-VnrZBRx%W^04Xr>%RoOPKQ~oBHM_W^C^17n xxu~+BL^r7@zq~lLNFSz6KR!M)FS8^*Uaz3?7Kcr4eoARhsvXF}VvvCX3;-$@E=vFa literal 0 HcmV?d00001 diff --git a/security/__pycache__/security.cpython-310.pyc b/security/__pycache__/security.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eb0a697a2df2551aa0e83d55de2febfadb9947f6 GIT binary patch literal 801 zcmZuvv5wO~5ZzsG5<6Tjfs;;xhHG7rAnFr>2I(jw6ey6J$nj1b-+67byAdR!xD(gr zAE4wr_=|0+_yro6b?gWbBh6@LygTo`@s@)@pP;?Cc$+?CgnW0!pT@CxhOQSF1Q9eR zl15arh*4Lw+><=wlmHc;;3*ZI9g8}^MOXB8H0naYCQh{tOnV+j1R_(Am{M)F{$!!b_u4_IJw!qsd}A)}pnpTxrxwNP#7ID z<-7K%RWt)#m4$|o*5|(xHN@{fA5T`Lgb7?}qvF*hQJcyOVv(T#W%v&EnjPaC>eOZwb$V0Vlc05+!uEbWH7nAyhQ(Qn zR}=m>jBt`YZI3jRnww6bcJGW``%Il+G7bB-w~V!kt4ujI%EMsqHLY>;I}u&EdvH{^sRh + + + + + + + {% block title %}My FastAPI App{% endblock %} + {% block css %} + {% endblock %} + + + + + + + {% block content %} + {% endblock %} + {% block js %} + {% endblock %} +
+

© 2024 EKSTRAH Security Application

+
+ + + diff --git a/templates/browser_random_number.html b/templates/browser_random_number.html new file mode 100644 index 0000000..aa9c971 --- /dev/null +++ b/templates/browser_random_number.html @@ -0,0 +1,198 @@ +{% extends "base.html" %} + +{% block title %}Browser Random Generation{% endblock %} + +{% block content %} +
+
+

Detected Browser: Something

+
+
+ +
+
+{% endblock %} + +{% block js %} + + + +{% endblock %} diff --git a/templates/browser_security_random_number.html b/templates/browser_security_random_number.html new file mode 100644 index 0000000..fb908c2 --- /dev/null +++ b/templates/browser_security_random_number.html @@ -0,0 +1,19 @@ + + + + + {% block title %}My FastAPI App{% endblock %} + + + + {% block content %} + {% endblock %} + + {# Footer #} +
+

© 2024 EKSTRAH Security Application

+
+ + {% block js %}{% endblock %} + + diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..df200c0 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} + +{% block title %}Home Page{% endblock %} + +{% block content %} +
+

Hello World

+
+ +{% endblock %} + +{% block css %} +{{ super() }} +{% endblock %}