duckframework 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (402) hide show
  1. duckframework-1.0.1/AUTHORS.md +12 -0
  2. duckframework-1.0.1/LICENSE +27 -0
  3. duckframework-1.0.1/MANIFEST.in +15 -0
  4. duckframework-1.0.1/PKG-INFO +263 -0
  5. duckframework-1.0.1/README.md +214 -0
  6. duckframework-1.0.1/duck/__init__.py +61 -0
  7. duckframework-1.0.1/duck/__main__.py +234 -0
  8. duckframework-1.0.1/duck/ansi.py +9 -0
  9. duckframework-1.0.1/duck/app/__init__.py +21 -0
  10. duckframework-1.0.1/duck/app/app.py +1292 -0
  11. duckframework-1.0.1/duck/app/microapp.py +284 -0
  12. duckframework-1.0.1/duck/art.py +29 -0
  13. duckframework-1.0.1/duck/automation/__init__.py +735 -0
  14. duckframework-1.0.1/duck/automation/dispatcher.py +202 -0
  15. duckframework-1.0.1/duck/automation/trigger.py +76 -0
  16. duckframework-1.0.1/duck/backend/__init__.py +0 -0
  17. duckframework-1.0.1/duck/backend/django/__init__.py +0 -0
  18. duckframework-1.0.1/duck/backend/django/bridge.py +79 -0
  19. duckframework-1.0.1/duck/backend/django/logging.py +89 -0
  20. duckframework-1.0.1/duck/backend/django/middlewares/__init__.py +0 -0
  21. duckframework-1.0.1/duck/backend/django/middlewares/auth.py +8 -0
  22. duckframework-1.0.1/duck/backend/django/middlewares/clickjacking.py +6 -0
  23. duckframework-1.0.1/duck/backend/django/middlewares/common.py +5 -0
  24. duckframework-1.0.1/duck/backend/django/middlewares/csrf.py +5 -0
  25. duckframework-1.0.1/duck/backend/django/middlewares/duckshare.py +109 -0
  26. duckframework-1.0.1/duck/backend/django/middlewares/messages.py +6 -0
  27. duckframework-1.0.1/duck/backend/django/middlewares/security.py +5 -0
  28. duckframework-1.0.1/duck/backend/django/middlewares/session.py +11 -0
  29. duckframework-1.0.1/duck/backend/django/session/__init__.py +0 -0
  30. duckframework-1.0.1/duck/backend/django/session/proxyengine.py +5 -0
  31. duckframework-1.0.1/duck/backend/django/setup.py +30 -0
  32. duckframework-1.0.1/duck/backend/django/templatetags/__init__.py +0 -0
  33. duckframework-1.0.1/duck/backend/django/templatetags/ducktags.py +35 -0
  34. duckframework-1.0.1/duck/backend/django/urls.py +96 -0
  35. duckframework-1.0.1/duck/backend/django/utils.py +198 -0
  36. duckframework-1.0.1/duck/backend/django/views.py +140 -0
  37. duckframework-1.0.1/duck/cli/__init__.py +18 -0
  38. duckframework-1.0.1/duck/cli/commands/__init__.py +0 -0
  39. duckframework-1.0.1/duck/cli/commands/collectstatic.py +158 -0
  40. duckframework-1.0.1/duck/cli/commands/django.py +37 -0
  41. duckframework-1.0.1/duck/cli/commands/integration/__init__.py +346 -0
  42. duckframework-1.0.1/duck/cli/commands/integration/_django_settings.py +286 -0
  43. duckframework-1.0.1/duck/cli/commands/integration/_django_urls.py +28 -0
  44. duckframework-1.0.1/duck/cli/commands/logs.py +165 -0
  45. duckframework-1.0.1/duck/cli/commands/makeblueprint.py +91 -0
  46. duckframework-1.0.1/duck/cli/commands/makeproject.py +90 -0
  47. duckframework-1.0.1/duck/cli/commands/monitor.py +451 -0
  48. duckframework-1.0.1/duck/cli/commands/runserver.py +86 -0
  49. duckframework-1.0.1/duck/cli/commands/runtests.py +39 -0
  50. duckframework-1.0.1/duck/cli/commands/service.py +317 -0
  51. duckframework-1.0.1/duck/cli/commands/sitemap.py +113 -0
  52. duckframework-1.0.1/duck/cli/commands/ssl_gen.py +30 -0
  53. duckframework-1.0.1/duck/compat.py +11 -0
  54. duckframework-1.0.1/duck/contrib/__init__.py +0 -0
  55. duckframework-1.0.1/duck/contrib/asyncio.py +94 -0
  56. duckframework-1.0.1/duck/contrib/reloader/__init__.py +0 -0
  57. duckframework-1.0.1/duck/contrib/reloader/dependency_graph.py +266 -0
  58. duckframework-1.0.1/duck/contrib/reloader/ducksight.py +156 -0
  59. duckframework-1.0.1/duck/contrib/responses/__init__.py +9 -0
  60. duckframework-1.0.1/duck/contrib/responses/errors.py +291 -0
  61. duckframework-1.0.1/duck/contrib/responses/simple_response.py +125 -0
  62. duckframework-1.0.1/duck/contrib/responses/template_response.py +68 -0
  63. duckframework-1.0.1/duck/contrib/sitemap.py +369 -0
  64. duckframework-1.0.1/duck/contrib/sync/__init__.py +90 -0
  65. duckframework-1.0.1/duck/contrib/sync/smart_async.py +567 -0
  66. duckframework-1.0.1/duck/contrib/websockets/__init__.py +789 -0
  67. duckframework-1.0.1/duck/contrib/websockets/exceptions.py +26 -0
  68. duckframework-1.0.1/duck/contrib/websockets/extensions.py +201 -0
  69. duckframework-1.0.1/duck/contrib/websockets/frame.py +207 -0
  70. duckframework-1.0.1/duck/contrib/websockets/logging.py +130 -0
  71. duckframework-1.0.1/duck/contrib/websockets/opcodes.py +53 -0
  72. duckframework-1.0.1/duck/csp.py +36 -0
  73. duckframework-1.0.1/duck/db/hooks.py +108 -0
  74. duckframework-1.0.1/duck/env.py +19 -0
  75. duckframework-1.0.1/duck/etc/__init__.py +3 -0
  76. duckframework-1.0.1/duck/etc/apps/README.md +1 -0
  77. duckframework-1.0.1/duck/etc/apps/__init__.py +0 -0
  78. duckframework-1.0.1/duck/etc/apps/certbot/blueprint.py +26 -0
  79. duckframework-1.0.1/duck/etc/apps/certbot/views/__init__.py +54 -0
  80. duckframework-1.0.1/duck/etc/apps/counterapp/blueprint.py +37 -0
  81. duckframework-1.0.1/duck/etc/apps/counterapp/static/css/bootstrap-icons.min.css +5 -0
  82. duckframework-1.0.1/duck/etc/apps/counterapp/static/css/bootstrap.min.css +7 -0
  83. duckframework-1.0.1/duck/etc/apps/counterapp/static/css/fonts/bootstrap-icons.woff +0 -0
  84. duckframework-1.0.1/duck/etc/apps/counterapp/static/css/fonts/bootstrap-icons.woff2 +0 -0
  85. duckframework-1.0.1/duck/etc/apps/counterapp/static/css/prism.css +3 -0
  86. duckframework-1.0.1/duck/etc/apps/counterapp/static/js/bootstrap.min.js +7 -0
  87. duckframework-1.0.1/duck/etc/apps/counterapp/static/js/jquery-3.7.1.min.js +2 -0
  88. duckframework-1.0.1/duck/etc/apps/counterapp/static/js/prism.js +8 -0
  89. duckframework-1.0.1/duck/etc/apps/counterapp/views/__init__.py +184 -0
  90. duckframework-1.0.1/duck/etc/apps/defaultsite/blueprint.py +32 -0
  91. duckframework-1.0.1/duck/etc/apps/defaultsite/shared_static/duck-favicon.png +0 -0
  92. duckframework-1.0.1/duck/etc/apps/defaultsite/static/css/base.css +207 -0
  93. duckframework-1.0.1/duck/etc/apps/defaultsite/static/css/contact.css +137 -0
  94. duckframework-1.0.1/duck/etc/apps/defaultsite/static/images/about-us.jpg +0 -0
  95. duckframework-1.0.1/duck/etc/apps/defaultsite/static/images/duck-cover-bw.png +0 -0
  96. duckframework-1.0.1/duck/etc/apps/defaultsite/static/images/duck-default-bw.png +0 -0
  97. duckframework-1.0.1/duck/etc/apps/defaultsite/static/images/duck-default.png +0 -0
  98. duckframework-1.0.1/duck/etc/apps/defaultsite/static/images/duck-favicon.png +0 -0
  99. duckframework-1.0.1/duck/etc/apps/defaultsite/static/images/duck.png +0 -0
  100. duckframework-1.0.1/duck/etc/apps/defaultsite/static/images/kofi_donate_img.png +0 -0
  101. duckframework-1.0.1/duck/etc/apps/defaultsite/templates/about.html +15 -0
  102. duckframework-1.0.1/duck/etc/apps/defaultsite/templates/base.html +323 -0
  103. duckframework-1.0.1/duck/etc/apps/defaultsite/templates/contact.html +41 -0
  104. duckframework-1.0.1/duck/etc/apps/defaultsite/templates/home.html +1 -0
  105. duckframework-1.0.1/duck/etc/apps/defaultsite/views/__init__.py +14 -0
  106. duckframework-1.0.1/duck/etc/apps/defaultsite/views/about.py +16 -0
  107. duckframework-1.0.1/duck/etc/apps/defaultsite/views/contact.py +20 -0
  108. duckframework-1.0.1/duck/etc/apps/defaultsite/views/context/__init__.py +33 -0
  109. duckframework-1.0.1/duck/etc/apps/defaultsite/views/home.py +16 -0
  110. duckframework-1.0.1/duck/etc/apps/defaultsite/views/speedtest.py +18 -0
  111. duckframework-1.0.1/duck/etc/apps/defaultsite/views/static.py +32 -0
  112. duckframework-1.0.1/duck/etc/apps/essentials/blueprint.py +69 -0
  113. duckframework-1.0.1/duck/etc/apps/essentials/views/__init__.py +3 -0
  114. duckframework-1.0.1/duck/etc/apps/essentials/views/media.py +64 -0
  115. duckframework-1.0.1/duck/etc/apps/essentials/views/sitemap.py +57 -0
  116. duckframework-1.0.1/duck/etc/apps/essentials/views/static.py +130 -0
  117. duckframework-1.0.1/duck/etc/automations/certbot.py +359 -0
  118. duckframework-1.0.1/duck/etc/headers/default.json +11 -0
  119. duckframework-1.0.1/duck/etc/headers/default_ssl.json +12 -0
  120. duckframework-1.0.1/duck/etc/internals/__init__.py +0 -0
  121. duckframework-1.0.1/duck/etc/internals/profile_app.py +40 -0
  122. duckframework-1.0.1/duck/etc/internals/template.py +73 -0
  123. duckframework-1.0.1/duck/etc/middlewares.py +15 -0
  124. duckframework-1.0.1/duck/etc/normalizers.py +3 -0
  125. duckframework-1.0.1/duck/etc/settings.py +8 -0
  126. duckframework-1.0.1/duck/etc/ssl/README.md +2 -0
  127. duckframework-1.0.1/duck/etc/ssl/server.crt +23 -0
  128. duckframework-1.0.1/duck/etc/ssl/server.csr +17 -0
  129. duckframework-1.0.1/duck/etc/ssl/server.key +28 -0
  130. duckframework-1.0.1/duck/etc/ssl_defaults.py +10 -0
  131. duckframework-1.0.1/duck/etc/statuscodes.py +73 -0
  132. duckframework-1.0.1/duck/etc/structures/README.md +1 -0
  133. duckframework-1.0.1/duck/etc/structures/blueprint/views/__init__.py +12 -0
  134. duckframework-1.0.1/duck/etc/structures/projects/full/.env +1 -0
  135. duckframework-1.0.1/duck/etc/structures/projects/full/.gitignore +11 -0
  136. duckframework-1.0.1/duck/etc/structures/projects/full/LICENSE +1 -0
  137. duckframework-1.0.1/duck/etc/structures/projects/full/README.md +1 -0
  138. duckframework-1.0.1/duck/etc/structures/projects/full/TODO.md +2 -0
  139. duckframework-1.0.1/duck/etc/structures/projects/full/etc/README.md +1 -0
  140. duckframework-1.0.1/duck/etc/structures/projects/full/etc/ssl/server.crt +23 -0
  141. duckframework-1.0.1/duck/etc/structures/projects/full/etc/ssl/server.key +28 -0
  142. duckframework-1.0.1/duck/etc/structures/projects/full/requirements.txt +1 -0
  143. duckframework-1.0.1/duck/etc/structures/projects/full/web/__init__.py +0 -0
  144. duckframework-1.0.1/duck/etc/structures/projects/full/web/automations.py +48 -0
  145. duckframework-1.0.1/duck/etc/structures/projects/full/web/backend/django/duckapp/duckapp/__init__.py +0 -0
  146. duckframework-1.0.1/duck/etc/structures/projects/full/web/backend/django/duckapp/duckapp/asgi.py +16 -0
  147. duckframework-1.0.1/duck/etc/structures/projects/full/web/backend/django/duckapp/duckapp/settings.py +264 -0
  148. duckframework-1.0.1/duck/etc/structures/projects/full/web/backend/django/duckapp/duckapp/urls.py +23 -0
  149. duckframework-1.0.1/duck/etc/structures/projects/full/web/backend/django/duckapp/duckapp/wsgi.py +16 -0
  150. duckframework-1.0.1/duck/etc/structures/projects/full/web/backend/django/duckapp/manage.py +23 -0
  151. duckframework-1.0.1/duck/etc/structures/projects/full/web/main.py +11 -0
  152. duckframework-1.0.1/duck/etc/structures/projects/full/web/settings.py +788 -0
  153. duckframework-1.0.1/duck/etc/structures/projects/full/web/templatetags.py +37 -0
  154. duckframework-1.0.1/duck/etc/structures/projects/full/web/ui/components/README.md +3 -0
  155. duckframework-1.0.1/duck/etc/structures/projects/full/web/ui/pages/README.md +3 -0
  156. duckframework-1.0.1/duck/etc/structures/projects/full/web/ui/static/README.md +1 -0
  157. duckframework-1.0.1/duck/etc/structures/projects/full/web/ui/templates/README.md +3 -0
  158. duckframework-1.0.1/duck/etc/structures/projects/full/web/urls.py +46 -0
  159. duckframework-1.0.1/duck/etc/structures/projects/full/web/views.py +21 -0
  160. duckframework-1.0.1/duck/etc/structures/projects/mini/etc/README.md +1 -0
  161. duckframework-1.0.1/duck/etc/structures/projects/mini/etc/ssl/server.crt +23 -0
  162. duckframework-1.0.1/duck/etc/structures/projects/mini/etc/ssl/server.key +28 -0
  163. duckframework-1.0.1/duck/etc/structures/projects/mini/requirements.txt +1 -0
  164. duckframework-1.0.1/duck/etc/structures/projects/mini/web/__init__.py +0 -0
  165. duckframework-1.0.1/duck/etc/structures/projects/mini/web/backend/django/duckapp/duckapp/__init__.py +0 -0
  166. duckframework-1.0.1/duck/etc/structures/projects/mini/web/backend/django/duckapp/duckapp/asgi.py +16 -0
  167. duckframework-1.0.1/duck/etc/structures/projects/mini/web/backend/django/duckapp/duckapp/settings.py +264 -0
  168. duckframework-1.0.1/duck/etc/structures/projects/mini/web/backend/django/duckapp/duckapp/urls.py +23 -0
  169. duckframework-1.0.1/duck/etc/structures/projects/mini/web/backend/django/duckapp/duckapp/wsgi.py +16 -0
  170. duckframework-1.0.1/duck/etc/structures/projects/mini/web/backend/django/duckapp/manage.py +23 -0
  171. duckframework-1.0.1/duck/etc/structures/projects/mini/web/main.py +11 -0
  172. duckframework-1.0.1/duck/etc/structures/projects/mini/web/settings.py +90 -0
  173. duckframework-1.0.1/duck/etc/structures/projects/mini/web/urls.py +46 -0
  174. duckframework-1.0.1/duck/etc/structures/projects/mini/web/views.py +21 -0
  175. duckframework-1.0.1/duck/etc/structures/projects/normal/LICENSE +1 -0
  176. duckframework-1.0.1/duck/etc/structures/projects/normal/README.md +2 -0
  177. duckframework-1.0.1/duck/etc/structures/projects/normal/TODO.md +2 -0
  178. duckframework-1.0.1/duck/etc/structures/projects/normal/etc/README.md +1 -0
  179. duckframework-1.0.1/duck/etc/structures/projects/normal/etc/ssl/server.crt +23 -0
  180. duckframework-1.0.1/duck/etc/structures/projects/normal/etc/ssl/server.key +28 -0
  181. duckframework-1.0.1/duck/etc/structures/projects/normal/requirements.txt +1 -0
  182. duckframework-1.0.1/duck/etc/structures/projects/normal/web/__init__.py +0 -0
  183. duckframework-1.0.1/duck/etc/structures/projects/normal/web/backend/django/duckapp/duckapp/__init__.py +0 -0
  184. duckframework-1.0.1/duck/etc/structures/projects/normal/web/backend/django/duckapp/duckapp/asgi.py +16 -0
  185. duckframework-1.0.1/duck/etc/structures/projects/normal/web/backend/django/duckapp/duckapp/settings.py +264 -0
  186. duckframework-1.0.1/duck/etc/structures/projects/normal/web/backend/django/duckapp/duckapp/urls.py +23 -0
  187. duckframework-1.0.1/duck/etc/structures/projects/normal/web/backend/django/duckapp/duckapp/wsgi.py +16 -0
  188. duckframework-1.0.1/duck/etc/structures/projects/normal/web/backend/django/duckapp/manage.py +23 -0
  189. duckframework-1.0.1/duck/etc/structures/projects/normal/web/main.py +11 -0
  190. duckframework-1.0.1/duck/etc/structures/projects/normal/web/settings.py +410 -0
  191. duckframework-1.0.1/duck/etc/structures/projects/normal/web/ui/components/README.md +3 -0
  192. duckframework-1.0.1/duck/etc/structures/projects/normal/web/ui/pages/README.md +3 -0
  193. duckframework-1.0.1/duck/etc/structures/projects/normal/web/ui/static/README.md +1 -0
  194. duckframework-1.0.1/duck/etc/structures/projects/normal/web/ui/templates/README.md +3 -0
  195. duckframework-1.0.1/duck/etc/structures/projects/normal/web/urls.py +46 -0
  196. duckframework-1.0.1/duck/etc/structures/projects/normal/web/views.py +21 -0
  197. duckframework-1.0.1/duck/etc/structures/projects/testing/README.md +1 -0
  198. duckframework-1.0.1/duck/etc/structures/projects/testing/etc/README.md +1 -0
  199. duckframework-1.0.1/duck/etc/structures/projects/testing/etc/ssl/server.crt +23 -0
  200. duckframework-1.0.1/duck/etc/structures/projects/testing/etc/ssl/server.key +28 -0
  201. duckframework-1.0.1/duck/etc/structures/projects/testing/web/__init__.py +0 -0
  202. duckframework-1.0.1/duck/etc/structures/projects/testing/web/backend/django/duckapp/duckapp/__init__.py +0 -0
  203. duckframework-1.0.1/duck/etc/structures/projects/testing/web/backend/django/duckapp/duckapp/asgi.py +16 -0
  204. duckframework-1.0.1/duck/etc/structures/projects/testing/web/backend/django/duckapp/duckapp/settings.py +264 -0
  205. duckframework-1.0.1/duck/etc/structures/projects/testing/web/backend/django/duckapp/duckapp/urls.py +23 -0
  206. duckframework-1.0.1/duck/etc/structures/projects/testing/web/backend/django/duckapp/duckapp/wsgi.py +16 -0
  207. duckframework-1.0.1/duck/etc/structures/projects/testing/web/backend/django/duckapp/manage.py +23 -0
  208. duckframework-1.0.1/duck/etc/structures/projects/testing/web/settings.py +17 -0
  209. duckframework-1.0.1/duck/etc/structures/projects/testing/web/urls.py +1 -0
  210. duckframework-1.0.1/duck/etc/templates/base_response.html +117 -0
  211. duckframework-1.0.1/duck/etc/templates/csrf_error.html +68 -0
  212. duckframework-1.0.1/duck/etc/templates/simple_icon_response.html +13 -0
  213. duckframework-1.0.1/duck/etc/templates/simple_response.html +12 -0
  214. duckframework-1.0.1/duck/etc/templatetags/__init__.py +75 -0
  215. duckframework-1.0.1/duck/exceptions/__init__.py +0 -0
  216. duckframework-1.0.1/duck/exceptions/all.py +208 -0
  217. duckframework-1.0.1/duck/exceptions/error_ids.py +12 -0
  218. duckframework-1.0.1/duck/globals.py +19 -0
  219. duckframework-1.0.1/duck/html/__init__.py +28 -0
  220. duckframework-1.0.1/duck/html/components/__init__.py +1976 -0
  221. duckframework-1.0.1/duck/html/components/button.py +56 -0
  222. duckframework-1.0.1/duck/html/components/card.py +24 -0
  223. duckframework-1.0.1/duck/html/components/checkbox.py +25 -0
  224. duckframework-1.0.1/duck/html/components/code.py +202 -0
  225. duckframework-1.0.1/duck/html/components/container.py +102 -0
  226. duckframework-1.0.1/duck/html/components/core/__init__.py +0 -0
  227. duckframework-1.0.1/duck/html/components/core/children.py +180 -0
  228. duckframework-1.0.1/duck/html/components/core/exceptions.py +118 -0
  229. duckframework-1.0.1/duck/html/components/core/force_update.py +145 -0
  230. duckframework-1.0.1/duck/html/components/core/mutation.py +69 -0
  231. duckframework-1.0.1/duck/html/components/core/opcodes.py +155 -0
  232. duckframework-1.0.1/duck/html/components/core/props.py +223 -0
  233. duckframework-1.0.1/duck/html/components/core/staticfiles/lively.js +2438 -0
  234. duckframework-1.0.1/duck/html/components/core/staticfiles/msgpack.min.js +2 -0
  235. duckframework-1.0.1/duck/html/components/core/system.py +169 -0
  236. duckframework-1.0.1/duck/html/components/core/utils.py +69 -0
  237. duckframework-1.0.1/duck/html/components/core/vdom.py +284 -0
  238. duckframework-1.0.1/duck/html/components/core/warnings.py +16 -0
  239. duckframework-1.0.1/duck/html/components/core/websocket.py +637 -0
  240. duckframework-1.0.1/duck/html/components/duck.py +32 -0
  241. duckframework-1.0.1/duck/html/components/extensions/__init__.py +428 -0
  242. duckframework-1.0.1/duck/html/components/fileinput.py +133 -0
  243. duckframework-1.0.1/duck/html/components/footer.py +141 -0
  244. duckframework-1.0.1/duck/html/components/form.py +113 -0
  245. duckframework-1.0.1/duck/html/components/heading.py +20 -0
  246. duckframework-1.0.1/duck/html/components/hero.py +19 -0
  247. duckframework-1.0.1/duck/html/components/icon.py +28 -0
  248. duckframework-1.0.1/duck/html/components/image.py +45 -0
  249. duckframework-1.0.1/duck/html/components/input.py +157 -0
  250. duckframework-1.0.1/duck/html/components/label.py +12 -0
  251. duckframework-1.0.1/duck/html/components/link.py +28 -0
  252. duckframework-1.0.1/duck/html/components/lively.py +71 -0
  253. duckframework-1.0.1/duck/html/components/modal.py +255 -0
  254. duckframework-1.0.1/duck/html/components/navbar.py +279 -0
  255. duckframework-1.0.1/duck/html/components/page.py +1094 -0
  256. duckframework-1.0.1/duck/html/components/paragraph.py +13 -0
  257. duckframework-1.0.1/duck/html/components/progressbar.py +127 -0
  258. duckframework-1.0.1/duck/html/components/script.py +89 -0
  259. duckframework-1.0.1/duck/html/components/section.py +13 -0
  260. duckframework-1.0.1/duck/html/components/select.py +100 -0
  261. duckframework-1.0.1/duck/html/components/snackbar.py +130 -0
  262. duckframework-1.0.1/duck/html/components/style.py +98 -0
  263. duckframework-1.0.1/duck/html/components/table_of_contents.py +116 -0
  264. duckframework-1.0.1/duck/html/components/templatetags/__init__.py +222 -0
  265. duckframework-1.0.1/duck/html/components/textarea.py +99 -0
  266. duckframework-1.0.1/duck/html/components/utils/__init__.py +0 -0
  267. duckframework-1.0.1/duck/html/components/utils/caching.py +280 -0
  268. duckframework-1.0.1/duck/html/components/utils/include.py +79 -0
  269. duckframework-1.0.1/duck/html/components/utils/static.py +84 -0
  270. duckframework-1.0.1/duck/html/components/video.py +93 -0
  271. duckframework-1.0.1/duck/http/__init__.py +0 -0
  272. duckframework-1.0.1/duck/http/content.py +447 -0
  273. duckframework-1.0.1/duck/http/core/__init__.py +0 -0
  274. duckframework-1.0.1/duck/http/core/asgi.py +448 -0
  275. duckframework-1.0.1/duck/http/core/handler.py +702 -0
  276. duckframework-1.0.1/duck/http/core/httpd/__init__.py +0 -0
  277. duckframework-1.0.1/duck/http/core/httpd/http2/__init__.py +440 -0
  278. duckframework-1.0.1/duck/http/core/httpd/http2/event_handler.py +300 -0
  279. duckframework-1.0.1/duck/http/core/httpd/http2/protocol.py +573 -0
  280. duckframework-1.0.1/duck/http/core/httpd/httpd.py +1086 -0
  281. duckframework-1.0.1/duck/http/core/httpd/servers.py +171 -0
  282. duckframework-1.0.1/duck/http/core/httpd/task_executor.py +103 -0
  283. duckframework-1.0.1/duck/http/core/processor.py +833 -0
  284. duckframework-1.0.1/duck/http/core/proxyhandler.py +600 -0
  285. duckframework-1.0.1/duck/http/core/response_finalizer.py +778 -0
  286. duckframework-1.0.1/duck/http/core/wsgi.py +371 -0
  287. duckframework-1.0.1/duck/http/fileuploads/__init__.py +1 -0
  288. duckframework-1.0.1/duck/http/fileuploads/handlers/__init__.py +188 -0
  289. duckframework-1.0.1/duck/http/fileuploads/multipart.py +150 -0
  290. duckframework-1.0.1/duck/http/headers.py +104 -0
  291. duckframework-1.0.1/duck/http/middlewares/__init__.py +78 -0
  292. duckframework-1.0.1/duck/http/middlewares/contrib/__init__.py +9 -0
  293. duckframework-1.0.1/duck/http/middlewares/contrib/django.py +77 -0
  294. duckframework-1.0.1/duck/http/middlewares/contrib/metashare.py +171 -0
  295. duckframework-1.0.1/duck/http/middlewares/contrib/session.py +99 -0
  296. duckframework-1.0.1/duck/http/middlewares/contrib/www_redirect.py +30 -0
  297. duckframework-1.0.1/duck/http/middlewares/security/__init__.py +24 -0
  298. duckframework-1.0.1/duck/http/middlewares/security/csrf.py +438 -0
  299. duckframework-1.0.1/duck/http/middlewares/security/header.py +158 -0
  300. duckframework-1.0.1/duck/http/middlewares/security/modules/__init__.py +0 -0
  301. duckframework-1.0.1/duck/http/middlewares/security/modules/command_injection.py +22 -0
  302. duckframework-1.0.1/duck/http/middlewares/security/modules/header_injection.py +53 -0
  303. duckframework-1.0.1/duck/http/middlewares/security/modules/sql_injection.py +211 -0
  304. duckframework-1.0.1/duck/http/middlewares/security/modules/xss.py +47 -0
  305. duckframework-1.0.1/duck/http/middlewares/security/requestslimit.py +147 -0
  306. duckframework-1.0.1/duck/http/middlewares/security/url.py +126 -0
  307. duckframework-1.0.1/duck/http/mimes.py +133 -0
  308. duckframework-1.0.1/duck/http/normalizers/__init__.py +23 -0
  309. duckframework-1.0.1/duck/http/querydict.py +240 -0
  310. duckframework-1.0.1/duck/http/request.py +1305 -0
  311. duckframework-1.0.1/duck/http/request_data.py +56 -0
  312. duckframework-1.0.1/duck/http/response.py +1410 -0
  313. duckframework-1.0.1/duck/http/response_payload.py +441 -0
  314. duckframework-1.0.1/duck/http/session/__init__.py +0 -0
  315. duckframework-1.0.1/duck/http/session/engine.py +293 -0
  316. duckframework-1.0.1/duck/http/session/session_storage_connector.py +127 -0
  317. duckframework-1.0.1/duck/logging/__init__.py +0 -0
  318. duckframework-1.0.1/duck/logging/console.py +255 -0
  319. duckframework-1.0.1/duck/logging/logger.py +463 -0
  320. duckframework-1.0.1/duck/meta/__init__.py +238 -0
  321. duckframework-1.0.1/duck/processes.py +144 -0
  322. duckframework-1.0.1/duck/routes/__init__.py +138 -0
  323. duckframework-1.0.1/duck/routes/route_blueprint.py +142 -0
  324. duckframework-1.0.1/duck/routes/route_registry.py +290 -0
  325. duckframework-1.0.1/duck/secrets.py +68 -0
  326. duckframework-1.0.1/duck/settings/__init__.py +3 -0
  327. duckframework-1.0.1/duck/settings/loaded.py +421 -0
  328. duckframework-1.0.1/duck/settings/settings.py +162 -0
  329. duckframework-1.0.1/duck/setup/__init__.py +174 -0
  330. duckframework-1.0.1/duck/setup/makeblueprint.py +106 -0
  331. duckframework-1.0.1/duck/setup/makeproject.py +62 -0
  332. duckframework-1.0.1/duck/shortcuts/__init__.py +655 -0
  333. duckframework-1.0.1/duck/storage.py +47 -0
  334. duckframework-1.0.1/duck/template/__init__.py +0 -0
  335. duckframework-1.0.1/duck/template/csrf.py +10 -0
  336. duckframework-1.0.1/duck/template/environment.py +331 -0
  337. duckframework-1.0.1/duck/template/loaders.py +154 -0
  338. duckframework-1.0.1/duck/template/response.py +21 -0
  339. duckframework-1.0.1/duck/template/templatetags.py +318 -0
  340. duckframework-1.0.1/duck/tests/__init__.py +0 -0
  341. duckframework-1.0.1/duck/tests/test_routes.py +102 -0
  342. duckframework-1.0.1/duck/tests/test_server.py +83 -0
  343. duckframework-1.0.1/duck/urls.py +97 -0
  344. duckframework-1.0.1/duck/utils/__init__.py +7 -0
  345. duckframework-1.0.1/duck/utils/asyncio/__init__.py +84 -0
  346. duckframework-1.0.1/duck/utils/asyncio/eventloop.py +405 -0
  347. duckframework-1.0.1/duck/utils/caching/__init__.py +533 -0
  348. duckframework-1.0.1/duck/utils/callabletools.py +149 -0
  349. duckframework-1.0.1/duck/utils/codesandbox.py +193 -0
  350. duckframework-1.0.1/duck/utils/cookie_consent.py +245 -0
  351. duckframework-1.0.1/duck/utils/dateutils.py +569 -0
  352. duckframework-1.0.1/duck/utils/email/__init__.py +283 -0
  353. duckframework-1.0.1/duck/utils/email/collection.py +154 -0
  354. duckframework-1.0.1/duck/utils/encrypt.py +20 -0
  355. duckframework-1.0.1/duck/utils/eventlist.py +154 -0
  356. duckframework-1.0.1/duck/utils/extraction.py +136 -0
  357. duckframework-1.0.1/duck/utils/file.py +56 -0
  358. duckframework-1.0.1/duck/utils/fileio.py +323 -0
  359. duckframework-1.0.1/duck/utils/filelock.py +76 -0
  360. duckframework-1.0.1/duck/utils/headers.py +37 -0
  361. duckframework-1.0.1/duck/utils/importer.py +31 -0
  362. duckframework-1.0.1/duck/utils/ipc.py +131 -0
  363. duckframework-1.0.1/duck/utils/lazy.py +189 -0
  364. duckframework-1.0.1/duck/utils/multiprocessing/__init__.py +186 -0
  365. duckframework-1.0.1/duck/utils/multiprocessing/process_manager.py +469 -0
  366. duckframework-1.0.1/duck/utils/multiprocessing/processpool.py +307 -0
  367. duckframework-1.0.1/duck/utils/multiprocessing/proxy.py +1075 -0
  368. duckframework-1.0.1/duck/utils/net.py +34 -0
  369. duckframework-1.0.1/duck/utils/object_from_id.py +24 -0
  370. duckframework-1.0.1/duck/utils/object_mapping.py +37 -0
  371. duckframework-1.0.1/duck/utils/path.py +142 -0
  372. duckframework-1.0.1/duck/utils/performance.py +78 -0
  373. duckframework-1.0.1/duck/utils/platform.py +24 -0
  374. duckframework-1.0.1/duck/utils/port_recorder.py +25 -0
  375. duckframework-1.0.1/duck/utils/rand_domain.py +35 -0
  376. duckframework-1.0.1/duck/utils/safe_compare.py +16 -0
  377. duckframework-1.0.1/duck/utils/safemarkup.py +63 -0
  378. duckframework-1.0.1/duck/utils/slug.py +171 -0
  379. duckframework-1.0.1/duck/utils/ssl.py +229 -0
  380. duckframework-1.0.1/duck/utils/string.py +329 -0
  381. duckframework-1.0.1/duck/utils/temp.py +2 -0
  382. duckframework-1.0.1/duck/utils/threading/__init__.py +138 -0
  383. duckframework-1.0.1/duck/utils/threading/patch.py +174 -0
  384. duckframework-1.0.1/duck/utils/threading/thread_manager.py +436 -0
  385. duckframework-1.0.1/duck/utils/threading/threadpool.py +424 -0
  386. duckframework-1.0.1/duck/utils/timer.py +184 -0
  387. duckframework-1.0.1/duck/utils/urlcrack.py +568 -0
  388. duckframework-1.0.1/duck/utils/urldecode.py +22 -0
  389. duckframework-1.0.1/duck/utils/validation.py +258 -0
  390. duckframework-1.0.1/duck/utils/wildcard.py +16 -0
  391. duckframework-1.0.1/duck/utils/xsocket/__init__.py +910 -0
  392. duckframework-1.0.1/duck/utils/xsocket/io.py +629 -0
  393. duckframework-1.0.1/duck/version.py +11 -0
  394. duckframework-1.0.1/duck/views.py +692 -0
  395. duckframework-1.0.1/duckframework.egg-info/PKG-INFO +263 -0
  396. duckframework-1.0.1/duckframework.egg-info/SOURCES.txt +400 -0
  397. duckframework-1.0.1/duckframework.egg-info/dependency_links.txt +1 -0
  398. duckframework-1.0.1/duckframework.egg-info/entry_points.txt +2 -0
  399. duckframework-1.0.1/duckframework.egg-info/requires.txt +14 -0
  400. duckframework-1.0.1/duckframework.egg-info/top_level.txt +1 -0
  401. duckframework-1.0.1/pyproject.toml +90 -0
  402. duckframework-1.0.1/setup.cfg +4 -0
@@ -0,0 +1,12 @@
1
+ # Authors
2
+
3
+ Brian Musakwa <digreatbrian@gmail.com>
4
+
5
+ ## Sole Developer and Owner
6
+ Brian Musakwa is the sole developer and owner of this software.
7
+
8
+ ## Acknowledgements
9
+ Special thanks to Guido van Rossum for creating Python, which made this project possible.
10
+
11
+ ## Project History
12
+ Duck was created in the early days of March 2024.
@@ -0,0 +1,27 @@
1
+ Copyright (c) 2024 Brian Musakwa
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification,
5
+ are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in the
12
+ documentation and/or other materials provided with the distribution.
13
+
14
+ 3. Neither the name of Duck nor the names of its contributors may be used
15
+ to endorse or promote products derived from this software without
16
+ specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
22
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
25
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,15 @@
1
+ include LICENSE
2
+ include AUTHORS.md
3
+ include README.md
4
+ recursive-include duck *
5
+ exclude duck/**/__pycache__
6
+ exclude duck/**/__pycache__/*.pyc
7
+ exclude duck/**/.logs
8
+ exclude duck/**/.logs/*.log
9
+ exclude duck/**/.cache/
10
+ exclude duck/**/.cache/*
11
+ exclude duck/**/testing/assets
12
+ exclude duck/**/testing/.ducksight
13
+ exclude duck/**/testing/.processes.json
14
+ exclude duck/**/testing/.ipc
15
+ exclude duck/**/testing/**/.ipc
@@ -0,0 +1,263 @@
1
+ Metadata-Version: 2.4
2
+ Name: duckframework
3
+ Version: 1.0.1
4
+ Summary: **Duck** is a powerful, open-source, full-fledged Python-based **web server**, **framework**, and **reverse proxy** designed for building modern, customizable web applications β€” from small sites to large-scale platforms.
5
+ Author-email: Brian Musakwa <digreatbrian@gmail.com>
6
+ Maintainer-email: Brian Musakwa <digreatbrian@gmail.com>
7
+ License-Expression: BSD-3-Clause
8
+ Project-URL: Homepage, https://duckframework.xyz
9
+ Project-URL: Source, https://github.com/duckframework/duck
10
+ Project-URL: Issues, https://github.com/duckframework/duck/issues
11
+ Project-URL: Documentation, https://docs.duckframework.xyz
12
+ Project-URL: Funding, https://duckframework.xyz/contribute
13
+ Keywords: Python,web framework,web server,reverse proxy,HTTP/2,WSGI,ASGI,Django integration,Flask,Tornado,FastAPI,microservices,middleware,high-performance,async,Duck framework,routing,load balancing,HTTP proxy,web application
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Web Environment
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3 :: Only
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Programming Language :: Python :: 3.14
26
+ Classifier: Topic :: Internet :: WWW/HTTP
27
+ Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
28
+ Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
29
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
30
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
31
+ Description-Content-Type: text/markdown
32
+ License-File: LICENSE
33
+ License-File: AUTHORS.md
34
+ Requires-Dist: Django>=5.1.5
35
+ Requires-Dist: Jinja2>=3.1.5
36
+ Requires-Dist: watchdog>=4.0.1
37
+ Requires-Dist: requests>=2.31.0
38
+ Requires-Dist: h2>=4.2.0
39
+ Requires-Dist: msgpack>=1.1.1
40
+ Requires-Dist: diskcache
41
+ Requires-Dist: colorama
42
+ Requires-Dist: tzdata
43
+ Requires-Dist: click
44
+ Requires-Dist: asgiref>=3.8.1
45
+ Requires-Dist: psutil>=7.0.0
46
+ Requires-Dist: rich>=14.1.0
47
+ Requires-Dist: setproctitle
48
+ Dynamic: license-file
49
+
50
+ # Duck Framework
51
+ ![Duck image](./images/duck-icon.png)
52
+
53
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/release/python-3100/)
54
+ [![GitHub stars](https://img.shields.io/github/stars/duckframework/duck?style=social)](https://github.com/duckframework/duck/stargazers)
55
+ [![GitHub forks](https://img.shields.io/github/forks/duckframework/duck?style=social)](https://github.com/duckframework/duck/network/members)
56
+ [![License](https://img.shields.io/github/license/duckframework/duck)](https://github.com/duckframework/duck/blob/main/LICENSE)
57
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/duckframework/duck/docs.yml?branch=main)](https://github.com/duckframework/duck/actions)
58
+ [![Open Issues](https://img.shields.io/github/issues/duckframework/duck)](https://github.com/duckframework/duck/issues)
59
+ [![Contributors](https://img.shields.io/github/contributors/duckframework/duck)](https://github.com/duckframework/duck/graphs/contributors)
60
+ [![HTTPS](https://img.shields.io/badge/HTTPS-supported-brightgreen.svg)](#)
61
+ [![HTTP/2](https://img.shields.io/badge/HTTP--2-supported-brightgreen.svg)](#)
62
+ [![WebSocket](https://img.shields.io/badge/WebSocket-supported-brightgreen.svg)](#)
63
+ [![Async Views](https://img.shields.io/badge/Async-WSGI%2FASGI-blue.svg)](#)
64
+ [![Task Automation](https://img.shields.io/badge/Task-Automation-blueviolet.svg)](#)
65
+ [![Content Compression](https://img.shields.io/badge/Compression-gzip%2C%20brotli%2C%20deflate-blue.svg)](#)
66
+ [![SSL Auto-Renewal](https://img.shields.io/badge/SSL-Auto%20Renewal-brightgreen.svg)](#)
67
+ [![Resumable Downloads](https://img.shields.io/badge/Downloads-Resumable-orange.svg)](#)
68
+ [![Security](https://img.shields.io/badge/Security-DoS%2C%20SQLi%2C%20CmdInj-red.svg)](#)
69
+ [![DuckSight Hot Reload](https://img.shields.io/badge/HotReload-DuckSight-yellow.svg)](#)
70
+ [![Django Integration](https://img.shields.io/badge/Django-Integration-blue.svg)](#)
71
+ [![Monitoring](https://img.shields.io/badge/Monitoring-CPU%2FRAM%2FDisk%2FI%2FO-brightgreen.svg)](#)
72
+
73
+ **Duck** is a powerful, open-source, full-fledged Python-based **web server**, **framework**, and **reverse proxy** designed for building modern, customizable web applications β€” from small sites to large-scale platforms.
74
+
75
+ **It simplifies web development with:**
76
+
77
+ 1. **Built-in HTTPS support** for secure connections
78
+ 2. **Native HTTP/2 support** with **HTTP/1** backward compatibility [link](https://docs.duckframework.xyz/main/https-and-http2.html)
79
+ 3. Hassle-free **free SSL certificate generation** with **automatic renewal** [link](https://docs.duckframework.xyz/main/free-ssl-certificate.html)
80
+ 4. **Lively Component System** β€” with `VDom Diffing` (support for fast UI's)
81
+ 5. **WebSocket support** β€” modern websocket implementation with `per-message compression`.
82
+ 6. Built-in [task automation](/automations.html) β€” no need for [cron jobs](https://en.m.wikipedia.org/wiki/Cron)
83
+ 7. Automatic **content compression** using `gzip`, `deflate` or `brotli`
84
+ 8. Support for **chunked transfer encoding**
85
+ 9. Easy integration with existing **Django** projects using `django-add`
86
+ 10. Organized routing with **Duck** [`Blueprints`](https://docs.duckframework.xyz/main/blueprint.html)
87
+ 11. Full support for **async views** or asynchronous code even in `WSGI` environment
88
+ 12. Dynamic project generation with `makeproject` (`mini`, `normal`, or `full`)
89
+ 13. Runs on both `WSGI` and `ASGI` environments, can even run `async` protocols like `HTTP/2` or `WebSockets` on `WSGI`.
90
+ 14. High-performance with low-latency response times
91
+ 15. **Resumable downloads** for large files
92
+ 16. Protection against **DoS**, **SQL Injection**, **Command Injection**, and other threats
93
+ 17. **Auto-reload** in debug mode for rapid development
94
+ 18. **Free production SSL** β€” no certificate costs
95
+ 19. **Automatic SSL renewal** using `certbot` plus Duck automation system
96
+ 20. Comes with built-in web development tools and helpers
97
+ 21. Log management with `duck logs` and file-based logging by default
98
+ 22. Real-time system monitoring for CPU, RAM, Disk usage, and I/O activity with `duck monitor`
99
+ 23. Easily generate app sitemap using command [`duck sitemap`](https://docs.duckframework.xyz/main/sitemap.html) or just use
100
+ the builtin blueprint [`duck.etc.apps.essentials.blueprint.Sitemap`](https://docs.duckframework.xyz/main/sitemap.html) for dynamic cached sitemap serving.
101
+ 24. Highly **customizable** to fit any use case
102
+
103
+ And more β€” see [feature list](https://duckframework.xyz/features)
104
+
105
+ ## Upcoming Features
106
+
107
+ 1. **HTTP/3 with QUIC** – Faster, modern transport for improved performance.
108
+ 2. **QUIC WebTransport** – A next-gen alternative to WebSockets for real-time communication.
109
+ 3. **Component Pre-rendering System** – A system to preload components in the background thread to reduce initial load times of component trees.
110
+ 4. **Customizable Dashboards** – Tailor interfaces to your workflow and preferences.
111
+ 5. **MQTT (Message Queuing Telementry Transport) Integration** – Run your own broker and manage IoT devices with ease.
112
+ 6. **Duck WebApp to APK** – Easily convert a Duck web application to APK.
113
+ 7. **DuckSight Hot Reload** – Instead of full reload on file changes, implement **hot reload** for the **DuckSight Reloader**. This is faster and efficient than full reload.
114
+ 8. **Internal Updates** – Implement logic for listing and securely applying updates when available, utilizing cryptographic code signing (using standards like TUF) to verify GitHub-sourced updates, protecting against rollbacks, and man-in-the-middle exploits.
115
+ 9. ~~**Worker Processes** – Use of worker processes to utilize all available CPU cores for improved request handling.~~
116
+ 10. **Complete Reverse Proxy Server** – **Duck** only acts as reverse proxy for Django only. Need to make Duck a full-fledged reverse proxy server with optional sticky sessions.
117
+ 11. ~~**Component Mutation Observer** – Need to build an optional component mutation observer for keeping track of child changes for fastest re-render (approx. 75x fast on unchanged children).~~
118
+ 12. **MCP (Model Context Protocol) Server** – Need to make it easy for creating MCP servers for easy AI communication.
119
+ 13. **...and more** – [Request a feature](./feature_request.md)
120
+
121
+ ---
122
+
123
+ ## TODO:
124
+ - Need to cythonize some of the project parts for improved speed esp., components.
125
+ - Need to make **Duck** fully async, especially in component & templates (currently at 89% async compatible, need to enable strictness for component rendering in async mode).
126
+
127
+ ---
128
+
129
+ ## πŸ¦† Fun Facts
130
+
131
+ - The **Duck** official website is powered by the **Duck** framework itselfβ€”showcasing a true "dogfooding" approach!
132
+ - **Duck's Lively components** bring you a **Lively UI** that's exceptionally fast and responsive, eliminating slow page re-rendering for a seamless user experience.
133
+ - Also, **Duck** official site is hosted directly with `Duck` itself, no NGINX or a reverse proxy is behind it. **Duck** handles everything including renewing expired `SSL` certificate & handle `HTTP/2` protocol!
134
+
135
+ ---
136
+
137
+ ## Getting Started
138
+
139
+ It is recommended to use **uv** for installing **Duck**.
140
+
141
+ **Install Duck using `uv`:**
142
+
143
+ ```sh
144
+ uv pip install git+https://github.com/duckframework/duck.git
145
+ ```
146
+
147
+ **Or using original `pip`:**
148
+
149
+ ```sh
150
+ pip install git+https://github.com/duckframework/duck.git
151
+ ```
152
+
153
+ ---
154
+
155
+ ## Project Creation
156
+
157
+ ```sh
158
+ duck makeproject myproject
159
+ ```
160
+
161
+ This creates a `normal` project named `myproject`. You can also create other project types using:
162
+
163
+ - `--full` for a full-featured project
164
+ - `--mini` for a simplified starter project
165
+
166
+ ### Full Project
167
+
168
+ The full version includes everything **Duck** offers. Recommended for experienced developers.
169
+
170
+ ```sh
171
+ duck makeproject myproject --full
172
+ ```
173
+
174
+ ### Mini Project
175
+
176
+ Beginner-friendly. Lightweight version with essential functionality.
177
+
178
+ ```sh
179
+ duck makeproject myproject --mini
180
+ ```
181
+
182
+ ---
183
+
184
+ ## Simple Startup
185
+
186
+ ```sh
187
+ duck makeproject myproject
188
+ cd myproject
189
+ duck runserver # or: python3 web/main.py
190
+ ```
191
+
192
+ This starts the server at **http://localhost:8000**
193
+
194
+ **Duck** serves a basic site by default β€” explore more at [Documentation](https://docs.duckframework.xyz/main)
195
+
196
+ > By default, Duck compresses streaming responses (like large downloads or video).
197
+ > To disable this behavior, set `compress_streaming_responses` to `False`.
198
+
199
+ ---
200
+
201
+ ## Django Integration
202
+
203
+ If you have an existing **Django** project and want production features like **HTTPS**, **HTTP/2**, and **resumable downloads**, Duck makes it easy.
204
+
205
+ Unlike `nginx` setups, **Duck** simplifies this with a few commands.
206
+
207
+ ### Benefits
208
+
209
+ - Native HTTP/2 & HTTPS implementation.
210
+ - Extra built-in security middleware (DoS, SQLi, etc.)
211
+ - Duck and Django run in the same Python environment (faster communication)
212
+ - Auto-compressed responses
213
+ - Resumable large downloads
214
+ - Fast and Reactive Lively components - for beautiful & responsive UI.
215
+ - [Free SSL with renewal](https://docs.duckframework.xyz/main/free-ssl-certificate.html)
216
+ - and more
217
+
218
+ ### Usage
219
+
220
+ ```sh
221
+ duck makeproject myproject
222
+ cd myproject
223
+ duck django-add "path/to/your/django_project"
224
+ duck runserver -dj
225
+ ```
226
+
227
+ ### Notes:
228
+
229
+ - Follow instructions provided by `django-add` command carefully
230
+ - Make sure your Django project defines at least one `urlpattern`
231
+ - Once setup, you’re good to go!
232
+
233
+ ---
234
+
235
+ ## Duck Official Site
236
+
237
+ Visit: [https://duckframework.xyz](https://duckframework.xyz)
238
+ Docs: [https://docs.duckframework.xyz](https://docs.duckframework.xyz)
239
+
240
+ ---
241
+
242
+ ## πŸš€ Premium Duck Components Coming Soon!
243
+ >
244
+ > All our UI components are currently free and open source. Stay tuned for upcoming Pro Packs featuring advanced dashboards, e-commerce, and integrations!
245
+ >
246
+ > ⭐ Star this repo to get notified on release!
247
+
248
+
249
+ ## Contributing & Issues
250
+
251
+ **Duck** is open to all forms of contribution β€” financial or technical.
252
+
253
+ ### Sponsorship/Donations:
254
+
255
+ Support development at [Open Collective](https://opencollective.com/duckframework/contribute)
256
+
257
+ ### Report issues:
258
+
259
+ Use the [GitHub Issues page](https://github.com/duckframework/duck/issues)
260
+
261
+ ---
262
+
263
+ > **Duck is updated regularly** β€” check the repo for improvements and bug fixes.
@@ -0,0 +1,214 @@
1
+ # Duck Framework
2
+ ![Duck image](./images/duck-icon.png)
3
+
4
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/release/python-3100/)
5
+ [![GitHub stars](https://img.shields.io/github/stars/duckframework/duck?style=social)](https://github.com/duckframework/duck/stargazers)
6
+ [![GitHub forks](https://img.shields.io/github/forks/duckframework/duck?style=social)](https://github.com/duckframework/duck/network/members)
7
+ [![License](https://img.shields.io/github/license/duckframework/duck)](https://github.com/duckframework/duck/blob/main/LICENSE)
8
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/duckframework/duck/docs.yml?branch=main)](https://github.com/duckframework/duck/actions)
9
+ [![Open Issues](https://img.shields.io/github/issues/duckframework/duck)](https://github.com/duckframework/duck/issues)
10
+ [![Contributors](https://img.shields.io/github/contributors/duckframework/duck)](https://github.com/duckframework/duck/graphs/contributors)
11
+ [![HTTPS](https://img.shields.io/badge/HTTPS-supported-brightgreen.svg)](#)
12
+ [![HTTP/2](https://img.shields.io/badge/HTTP--2-supported-brightgreen.svg)](#)
13
+ [![WebSocket](https://img.shields.io/badge/WebSocket-supported-brightgreen.svg)](#)
14
+ [![Async Views](https://img.shields.io/badge/Async-WSGI%2FASGI-blue.svg)](#)
15
+ [![Task Automation](https://img.shields.io/badge/Task-Automation-blueviolet.svg)](#)
16
+ [![Content Compression](https://img.shields.io/badge/Compression-gzip%2C%20brotli%2C%20deflate-blue.svg)](#)
17
+ [![SSL Auto-Renewal](https://img.shields.io/badge/SSL-Auto%20Renewal-brightgreen.svg)](#)
18
+ [![Resumable Downloads](https://img.shields.io/badge/Downloads-Resumable-orange.svg)](#)
19
+ [![Security](https://img.shields.io/badge/Security-DoS%2C%20SQLi%2C%20CmdInj-red.svg)](#)
20
+ [![DuckSight Hot Reload](https://img.shields.io/badge/HotReload-DuckSight-yellow.svg)](#)
21
+ [![Django Integration](https://img.shields.io/badge/Django-Integration-blue.svg)](#)
22
+ [![Monitoring](https://img.shields.io/badge/Monitoring-CPU%2FRAM%2FDisk%2FI%2FO-brightgreen.svg)](#)
23
+
24
+ **Duck** is a powerful, open-source, full-fledged Python-based **web server**, **framework**, and **reverse proxy** designed for building modern, customizable web applications β€” from small sites to large-scale platforms.
25
+
26
+ **It simplifies web development with:**
27
+
28
+ 1. **Built-in HTTPS support** for secure connections
29
+ 2. **Native HTTP/2 support** with **HTTP/1** backward compatibility [link](https://docs.duckframework.xyz/main/https-and-http2.html)
30
+ 3. Hassle-free **free SSL certificate generation** with **automatic renewal** [link](https://docs.duckframework.xyz/main/free-ssl-certificate.html)
31
+ 4. **Lively Component System** β€” with `VDom Diffing` (support for fast UI's)
32
+ 5. **WebSocket support** β€” modern websocket implementation with `per-message compression`.
33
+ 6. Built-in [task automation](/automations.html) β€” no need for [cron jobs](https://en.m.wikipedia.org/wiki/Cron)
34
+ 7. Automatic **content compression** using `gzip`, `deflate` or `brotli`
35
+ 8. Support for **chunked transfer encoding**
36
+ 9. Easy integration with existing **Django** projects using `django-add`
37
+ 10. Organized routing with **Duck** [`Blueprints`](https://docs.duckframework.xyz/main/blueprint.html)
38
+ 11. Full support for **async views** or asynchronous code even in `WSGI` environment
39
+ 12. Dynamic project generation with `makeproject` (`mini`, `normal`, or `full`)
40
+ 13. Runs on both `WSGI` and `ASGI` environments, can even run `async` protocols like `HTTP/2` or `WebSockets` on `WSGI`.
41
+ 14. High-performance with low-latency response times
42
+ 15. **Resumable downloads** for large files
43
+ 16. Protection against **DoS**, **SQL Injection**, **Command Injection**, and other threats
44
+ 17. **Auto-reload** in debug mode for rapid development
45
+ 18. **Free production SSL** β€” no certificate costs
46
+ 19. **Automatic SSL renewal** using `certbot` plus Duck automation system
47
+ 20. Comes with built-in web development tools and helpers
48
+ 21. Log management with `duck logs` and file-based logging by default
49
+ 22. Real-time system monitoring for CPU, RAM, Disk usage, and I/O activity with `duck monitor`
50
+ 23. Easily generate app sitemap using command [`duck sitemap`](https://docs.duckframework.xyz/main/sitemap.html) or just use
51
+ the builtin blueprint [`duck.etc.apps.essentials.blueprint.Sitemap`](https://docs.duckframework.xyz/main/sitemap.html) for dynamic cached sitemap serving.
52
+ 24. Highly **customizable** to fit any use case
53
+
54
+ And more β€” see [feature list](https://duckframework.xyz/features)
55
+
56
+ ## Upcoming Features
57
+
58
+ 1. **HTTP/3 with QUIC** – Faster, modern transport for improved performance.
59
+ 2. **QUIC WebTransport** – A next-gen alternative to WebSockets for real-time communication.
60
+ 3. **Component Pre-rendering System** – A system to preload components in the background thread to reduce initial load times of component trees.
61
+ 4. **Customizable Dashboards** – Tailor interfaces to your workflow and preferences.
62
+ 5. **MQTT (Message Queuing Telementry Transport) Integration** – Run your own broker and manage IoT devices with ease.
63
+ 6. **Duck WebApp to APK** – Easily convert a Duck web application to APK.
64
+ 7. **DuckSight Hot Reload** – Instead of full reload on file changes, implement **hot reload** for the **DuckSight Reloader**. This is faster and efficient than full reload.
65
+ 8. **Internal Updates** – Implement logic for listing and securely applying updates when available, utilizing cryptographic code signing (using standards like TUF) to verify GitHub-sourced updates, protecting against rollbacks, and man-in-the-middle exploits.
66
+ 9. ~~**Worker Processes** – Use of worker processes to utilize all available CPU cores for improved request handling.~~
67
+ 10. **Complete Reverse Proxy Server** – **Duck** only acts as reverse proxy for Django only. Need to make Duck a full-fledged reverse proxy server with optional sticky sessions.
68
+ 11. ~~**Component Mutation Observer** – Need to build an optional component mutation observer for keeping track of child changes for fastest re-render (approx. 75x fast on unchanged children).~~
69
+ 12. **MCP (Model Context Protocol) Server** – Need to make it easy for creating MCP servers for easy AI communication.
70
+ 13. **...and more** – [Request a feature](./feature_request.md)
71
+
72
+ ---
73
+
74
+ ## TODO:
75
+ - Need to cythonize some of the project parts for improved speed esp., components.
76
+ - Need to make **Duck** fully async, especially in component & templates (currently at 89% async compatible, need to enable strictness for component rendering in async mode).
77
+
78
+ ---
79
+
80
+ ## πŸ¦† Fun Facts
81
+
82
+ - The **Duck** official website is powered by the **Duck** framework itselfβ€”showcasing a true "dogfooding" approach!
83
+ - **Duck's Lively components** bring you a **Lively UI** that's exceptionally fast and responsive, eliminating slow page re-rendering for a seamless user experience.
84
+ - Also, **Duck** official site is hosted directly with `Duck` itself, no NGINX or a reverse proxy is behind it. **Duck** handles everything including renewing expired `SSL` certificate & handle `HTTP/2` protocol!
85
+
86
+ ---
87
+
88
+ ## Getting Started
89
+
90
+ It is recommended to use **uv** for installing **Duck**.
91
+
92
+ **Install Duck using `uv`:**
93
+
94
+ ```sh
95
+ uv pip install git+https://github.com/duckframework/duck.git
96
+ ```
97
+
98
+ **Or using original `pip`:**
99
+
100
+ ```sh
101
+ pip install git+https://github.com/duckframework/duck.git
102
+ ```
103
+
104
+ ---
105
+
106
+ ## Project Creation
107
+
108
+ ```sh
109
+ duck makeproject myproject
110
+ ```
111
+
112
+ This creates a `normal` project named `myproject`. You can also create other project types using:
113
+
114
+ - `--full` for a full-featured project
115
+ - `--mini` for a simplified starter project
116
+
117
+ ### Full Project
118
+
119
+ The full version includes everything **Duck** offers. Recommended for experienced developers.
120
+
121
+ ```sh
122
+ duck makeproject myproject --full
123
+ ```
124
+
125
+ ### Mini Project
126
+
127
+ Beginner-friendly. Lightweight version with essential functionality.
128
+
129
+ ```sh
130
+ duck makeproject myproject --mini
131
+ ```
132
+
133
+ ---
134
+
135
+ ## Simple Startup
136
+
137
+ ```sh
138
+ duck makeproject myproject
139
+ cd myproject
140
+ duck runserver # or: python3 web/main.py
141
+ ```
142
+
143
+ This starts the server at **http://localhost:8000**
144
+
145
+ **Duck** serves a basic site by default β€” explore more at [Documentation](https://docs.duckframework.xyz/main)
146
+
147
+ > By default, Duck compresses streaming responses (like large downloads or video).
148
+ > To disable this behavior, set `compress_streaming_responses` to `False`.
149
+
150
+ ---
151
+
152
+ ## Django Integration
153
+
154
+ If you have an existing **Django** project and want production features like **HTTPS**, **HTTP/2**, and **resumable downloads**, Duck makes it easy.
155
+
156
+ Unlike `nginx` setups, **Duck** simplifies this with a few commands.
157
+
158
+ ### Benefits
159
+
160
+ - Native HTTP/2 & HTTPS implementation.
161
+ - Extra built-in security middleware (DoS, SQLi, etc.)
162
+ - Duck and Django run in the same Python environment (faster communication)
163
+ - Auto-compressed responses
164
+ - Resumable large downloads
165
+ - Fast and Reactive Lively components - for beautiful & responsive UI.
166
+ - [Free SSL with renewal](https://docs.duckframework.xyz/main/free-ssl-certificate.html)
167
+ - and more
168
+
169
+ ### Usage
170
+
171
+ ```sh
172
+ duck makeproject myproject
173
+ cd myproject
174
+ duck django-add "path/to/your/django_project"
175
+ duck runserver -dj
176
+ ```
177
+
178
+ ### Notes:
179
+
180
+ - Follow instructions provided by `django-add` command carefully
181
+ - Make sure your Django project defines at least one `urlpattern`
182
+ - Once setup, you’re good to go!
183
+
184
+ ---
185
+
186
+ ## Duck Official Site
187
+
188
+ Visit: [https://duckframework.xyz](https://duckframework.xyz)
189
+ Docs: [https://docs.duckframework.xyz](https://docs.duckframework.xyz)
190
+
191
+ ---
192
+
193
+ ## πŸš€ Premium Duck Components Coming Soon!
194
+ >
195
+ > All our UI components are currently free and open source. Stay tuned for upcoming Pro Packs featuring advanced dashboards, e-commerce, and integrations!
196
+ >
197
+ > ⭐ Star this repo to get notified on release!
198
+
199
+
200
+ ## Contributing & Issues
201
+
202
+ **Duck** is open to all forms of contribution β€” financial or technical.
203
+
204
+ ### Sponsorship/Donations:
205
+
206
+ Support development at [Open Collective](https://opencollective.com/duckframework/contribute)
207
+
208
+ ### Report issues:
209
+
210
+ Use the [GitHub Issues page](https://github.com/duckframework/duck/issues)
211
+
212
+ ---
213
+
214
+ > **Duck is updated regularly** β€” check the repo for improvements and bug fixes.
@@ -0,0 +1,61 @@
1
+ """
2
+ **Duck** is a powerful, open-source, full-fledged Python-based **web server**, **framework**, and **reverse proxy** designed for building modern, customizable web applications β€” from small sites to large-scale platforms.
3
+
4
+ With **Duck**, developers can quickly deploy secure, high-performance applications with minimal
5
+ configuration. Ideal for creating scalable, secure, and customizable **web solutions**, **Duck**
6
+ streamlines the development process while ensuring top-notch security and performance.
7
+
8
+ > **Duck is not a small or mini web framework, it is a full-fledged framework which makes you do almost everything!**
9
+
10
+ ## Quick Start Example
11
+
12
+ To start using Duck, initialize an ``App`` instance with your desired port and address,
13
+ then run the application:
14
+
15
+ ```py
16
+ from duck.app import App
17
+
18
+ app = App(port=5000, addr='127.0.0.1', domain='localhost')
19
+
20
+ if __name__ == '__main__':
21
+ app.run()
22
+ ```
23
+ """
24
+ import sys
25
+ import pathlib
26
+
27
+ from duck.version import version
28
+ from duck.compat import apply_backward_compatibility
29
+ from duck.utils.threading.patch import patch_threading
30
+
31
+
32
+ __author__ = "Brian Musakwa"
33
+ __email__ = "digreatbrian@gmail.com"
34
+ __version__ = version
35
+
36
+
37
+ # Patch threading module to add more functionality like getting parent threads
38
+ patch_threading()
39
+
40
+ # Apply backward compatibility (if applicable)
41
+ apply_backward_compatibility()
42
+
43
+ # Add current directory or parent directory to pythonpath
44
+ # This is critical for resolving modules inside the project.
45
+ original_curdir = curdir = pathlib.Path(".").resolve()
46
+ original_curdir = str(original_curdir)
47
+ curdir_endswith_web = False
48
+
49
+ if curdir.parts[-1] == "web":
50
+ # Maybe we are inside `web` directory e.g. someapp/web so
51
+ # lets add the basedir/parent instead
52
+ curdir = curdir.parent
53
+ curdir_endswith_web = True
54
+
55
+ if curdir not in sys.path:
56
+ sys.path.insert(0, str(curdir))
57
+
58
+ if curdir_endswith_web and original_curdir not in sys.path:
59
+ # Also add the original directory as second to the stripped curdir
60
+ if original_curdir not in sys.path:
61
+ sys.path.insert(1, original_curdir)