diff --git a/Pipfile b/Pipfile index a3f90af..cf7c9ce 100644 --- a/Pipfile +++ b/Pipfile @@ -8,6 +8,7 @@ pillow = "==10.0.0" argon2-cffi = "==23.1.0" whitenoise = "==6.6.0" redis = "==5.0.1" +beautifulsoup4 = "==4.12.3" celery = "==5.3.6" django = "==4.2.6" djangoql = "==0.17.1" diff --git a/Pipfile.lock b/Pipfile.lock index ae0bf66..403bec1 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "50d61ddb0f3abaccdafb5046892468f6a0dbaf5e8a6544a535e88467c6c37e55" + "sha256": "f7eaea9dba25a601c70a711e0b46fefbee0f7beb7b750012fbd55c55e9bf857f" }, "pipfile-spec": 6, "requires": { @@ -183,6 +183,15 @@ "markers": "python_version >= '3.7'", "version": "==23.2.0" }, + "beautifulsoup4": { + "hashes": [ + "sha256:74e3d1928edc070d21748185c46e3fb33490f22f52a3addee9aee0f4f7781051", + "sha256:b80878c9f40111313e55da8ba20bdba06d8fa3969fc68304167741bbf9e082ed" + ], + "index": "pypi", + "markers": "python_full_version >= '3.6.0'", + "version": "==4.12.3" + }, "billiard": { "hashes": [ "sha256:07aa978b308f334ff8282bd4a746e681b3513db5c9a514cbdd810cbbdc19714d", @@ -702,69 +711,69 @@ }, "grpcio": { "hashes": [ - "sha256:073f959c6f570797272f4ee9464a9997eaf1e98c27cb680225b82b53390d61e6", - "sha256:0fd3b3968ffe7643144580f260f04d39d869fcc2cddb745deef078b09fd2b328", - "sha256:1434ca77d6fed4ea312901122dc8da6c4389738bf5788f43efb19a838ac03ead", - "sha256:1c30bb23a41df95109db130a6cc1b974844300ae2e5d68dd4947aacba5985aa5", - "sha256:20e7a4f7ded59097c84059d28230907cd97130fa74f4a8bfd1d8e5ba18c81491", - "sha256:2199165a1affb666aa24adf0c97436686d0a61bc5fc113c037701fb7c7fceb96", - "sha256:297eef542156d6b15174a1231c2493ea9ea54af8d016b8ca7d5d9cc65cfcc444", - "sha256:2aef56e85901c2397bd557c5ba514f84de1f0ae5dd132f5d5fed042858115951", - "sha256:30943b9530fe3620e3b195c03130396cd0ee3a0d10a66c1bee715d1819001eaf", - "sha256:3b36a2c6d4920ba88fa98075fdd58ff94ebeb8acc1215ae07d01a418af4c0253", - "sha256:428d699c8553c27e98f4d29fdc0f0edc50e9a8a7590bfd294d2edb0da7be3629", - "sha256:43e636dc2ce9ece583b3e2ca41df5c983f4302eabc6d5f9cd04f0562ee8ec1ae", - "sha256:452ca5b4afed30e7274445dd9b441a35ece656ec1600b77fff8c216fdf07df43", - "sha256:467a7d31554892eed2aa6c2d47ded1079fc40ea0b9601d9f79204afa8902274b", - "sha256:4b44d7e39964e808b071714666a812049765b26b3ea48c4434a3b317bac82f14", - "sha256:4c86343cf9ff7b2514dd229bdd88ebba760bd8973dac192ae687ff75e39ebfab", - "sha256:5208a57eae445ae84a219dfd8b56e04313445d146873117b5fa75f3245bc1390", - "sha256:5ff21e000ff2f658430bde5288cb1ac440ff15c0d7d18b5fb222f941b46cb0d2", - "sha256:675997222f2e2f22928fbba640824aebd43791116034f62006e19730715166c0", - "sha256:676e4a44e740deaba0f4d95ba1d8c5c89a2fcc43d02c39f69450b1fa19d39590", - "sha256:6e306b97966369b889985a562ede9d99180def39ad42c8014628dd3cc343f508", - "sha256:6fd9584bf1bccdfff1512719316efa77be235469e1e3295dce64538c4773840b", - "sha256:705a68a973c4c76db5d369ed573fec3367d7d196673fa86614b33d8c8e9ebb08", - "sha256:74d7d9fa97809c5b892449b28a65ec2bfa458a4735ddad46074f9f7d9550ad13", - "sha256:77c8a317f0fd5a0a2be8ed5cbe5341537d5c00bb79b3bb27ba7c5378ba77dbca", - "sha256:79a050889eb8d57a93ed21d9585bb63fca881666fc709f5d9f7f9372f5e7fd03", - "sha256:7db16dd4ea1b05ada504f08d0dca1cd9b926bed3770f50e715d087c6f00ad748", - "sha256:83f2292ae292ed5a47cdcb9821039ca8e88902923198f2193f13959360c01860", - "sha256:87c9224acba0ad8bacddf427a1c2772e17ce50b3042a789547af27099c5f751d", - "sha256:8a97a681e82bc11a42d4372fe57898d270a2707f36c45c6676e49ce0d5c41353", - "sha256:9073513ec380434eb8d21970e1ab3161041de121f4018bbed3146839451a6d8e", - "sha256:90bdd76b3f04bdb21de5398b8a7c629676c81dfac290f5f19883857e9371d28c", - "sha256:91229d7203f1ef0ab420c9b53fe2ca5c1fbeb34f69b3bc1b5089466237a4a134", - "sha256:92f88ca1b956eb8427a11bb8b4a0c0b2b03377235fc5102cb05e533b8693a415", - "sha256:95ae3e8e2c1b9bf671817f86f155c5da7d49a2289c5cf27a319458c3e025c320", - "sha256:9e30be89a75ee66aec7f9e60086fadb37ff8c0ba49a022887c28c134341f7179", - "sha256:a48edde788b99214613e440fce495bbe2b1e142a7f214cce9e0832146c41e324", - "sha256:a7152fa6e597c20cb97923407cf0934e14224af42c2b8d915f48bc3ad2d9ac18", - "sha256:a9c7b71211f066908e518a2ef7a5e211670761651039f0d6a80d8d40054047df", - "sha256:b0571a5aef36ba9177e262dc88a9240c866d903a62799e44fd4aae3f9a2ec17e", - "sha256:b0fb2d4801546598ac5cd18e3ec79c1a9af8b8f2a86283c55a5337c5aeca4b1b", - "sha256:b10241250cb77657ab315270b064a6c7f1add58af94befa20687e7c8d8603ae6", - "sha256:b87efe4a380887425bb15f220079aa8336276398dc33fce38c64d278164f963d", - "sha256:b98f43fcdb16172dec5f4b49f2fece4b16a99fd284d81c6bbac1b3b69fcbe0ff", - "sha256:c193109ca4070cdcaa6eff00fdb5a56233dc7610216d58fb81638f89f02e4968", - "sha256:c826f93050c73e7769806f92e601e0efdb83ec8d7c76ddf45d514fee54e8e619", - "sha256:d020cfa595d1f8f5c6b343530cd3ca16ae5aefdd1e832b777f9f0eb105f5b139", - "sha256:d6a478581b1a1a8fdf3318ecb5f4d0cda41cacdffe2b527c23707c9c1b8fdb55", - "sha256:de2ad69c9a094bf37c1102b5744c9aec6cf74d2b635558b779085d0263166454", - "sha256:e278eafb406f7e1b1b637c2cf51d3ad45883bb5bd1ca56bc05e4fc135dfdaa65", - "sha256:e381fe0c2aa6c03b056ad8f52f8efca7be29fb4d9ae2f8873520843b6039612a", - "sha256:e61e76020e0c332a98290323ecfec721c9544f5b739fab925b6e8cbe1944cf19", - "sha256:f897c3b127532e6befdcf961c415c97f320d45614daf84deba0a54e64ea2457b", - "sha256:fb464479934778d7cc5baf463d959d361954d6533ad34c3a4f1d267e86ee25fd" - ], - "version": "==1.60.0" + "sha256:0250a7a70b14000fa311de04b169cc7480be6c1a769b190769d347939d3232a8", + "sha256:069fe2aeee02dfd2135d562d0663fe70fbb69d5eed6eb3389042a7e963b54de8", + "sha256:082081e6a36b6eb5cf0fd9a897fe777dbb3802176ffd08e3ec6567edd85bc104", + "sha256:0c5807e9152eff15f1d48f6b9ad3749196f79a4a050469d99eecb679be592acc", + "sha256:14e8f2c84c0832773fb3958240c69def72357bc11392571f87b2d7b91e0bb092", + "sha256:2a6087f234cb570008a6041c8ffd1b7d657b397fdd6d26e83d72283dae3527b1", + "sha256:2bb2a2911b028f01c8c64d126f6b632fcd8a9ac975aa1b3855766c94e4107180", + "sha256:2f44c32aef186bbba254129cea1df08a20be414144ac3bdf0e84b24e3f3b2e05", + "sha256:30e980cd6db1088c144b92fe376747328d5554bc7960ce583ec7b7d81cd47287", + "sha256:33aed0a431f5befeffd9d346b0fa44b2c01aa4aeae5ea5b2c03d3e25e0071216", + "sha256:33bdea30dcfd4f87b045d404388469eb48a48c33a6195a043d116ed1b9a0196c", + "sha256:39aa848794b887120b1d35b1b994e445cc028ff602ef267f87c38122c1add50d", + "sha256:4216e67ad9a4769117433814956031cb300f85edc855252a645a9a724b3b6594", + "sha256:49c9b6a510e3ed8df5f6f4f3c34d7fbf2d2cae048ee90a45cd7415abab72912c", + "sha256:4eec8b8c1c2c9b7125508ff7c89d5701bf933c99d3910e446ed531cd16ad5d87", + "sha256:50d56280b482875d1f9128ce596e59031a226a8b84bec88cb2bf76c289f5d0de", + "sha256:53b69e79d00f78c81eecfb38f4516080dc7f36a198b6b37b928f1c13b3c063e9", + "sha256:55ccb7db5a665079d68b5c7c86359ebd5ebf31a19bc1a91c982fd622f1e31ff2", + "sha256:5a1ebbae7e2214f51b1f23b57bf98eeed2cf1ba84e4d523c48c36d5b2f8829ff", + "sha256:61b7199cd2a55e62e45bfb629a35b71fc2c0cb88f686a047f25b1112d3810904", + "sha256:660fc6b9c2a9ea3bb2a7e64ba878c98339abaf1811edca904ac85e9e662f1d73", + "sha256:6d140bdeb26cad8b93c1455fa00573c05592793c32053d6e0016ce05ba267549", + "sha256:6e490fa5f7f5326222cb9f0b78f207a2b218a14edf39602e083d5f617354306f", + "sha256:6ecf21d20d02d1733e9c820fb5c114c749d888704a7ec824b545c12e78734d1c", + "sha256:70c83bb530572917be20c21f3b6be92cd86b9aecb44b0c18b1d3b2cc3ae47df0", + "sha256:72153a0d2e425f45b884540a61c6639436ddafa1829a42056aa5764b84108b8e", + "sha256:73e14acd3d4247169955fae8fb103a2b900cfad21d0c35f0dcd0fdd54cd60367", + "sha256:76eaaba891083fcbe167aa0f03363311a9f12da975b025d30e94b93ac7a765fc", + "sha256:79ae0dc785504cb1e1788758c588c711f4e4a0195d70dff53db203c95a0bd303", + "sha256:7d142bcd604166417929b071cd396aa13c565749a4c840d6c702727a59d835eb", + "sha256:8c9554ca8e26241dabe7951aa1fa03a1ba0856688ecd7e7bdbdd286ebc272e4c", + "sha256:8d488fbdbf04283f0d20742b64968d44825617aa6717b07c006168ed16488804", + "sha256:91422ba785a8e7a18725b1dc40fbd88f08a5bb4c7f1b3e8739cab24b04fa8a03", + "sha256:9a66f4d2a005bc78e61d805ed95dedfcb35efa84b7bba0403c6d60d13a3de2d6", + "sha256:9b106bc52e7f28170e624ba61cc7dc6829566e535a6ec68528f8e1afbed1c41f", + "sha256:9b54577032d4f235452f77a83169b6527bf4b77d73aeada97d45b2aaf1bf5ce0", + "sha256:a09506eb48fa5493c58f946c46754ef22f3ec0df64f2b5149373ff31fb67f3dd", + "sha256:a212e5dea1a4182e40cd3e4067ee46be9d10418092ce3627475e995cca95de21", + "sha256:a731ac5cffc34dac62053e0da90f0c0b8560396a19f69d9703e88240c8f05858", + "sha256:af5ef6cfaf0d023c00002ba25d0751e5995fa0e4c9eec6cd263c30352662cbce", + "sha256:b58b855d0071575ea9c7bc0d84a06d2edfbfccec52e9657864386381a7ce1ae9", + "sha256:bc808924470643b82b14fe121923c30ec211d8c693e747eba8a7414bc4351a23", + "sha256:c557e94e91a983e5b1e9c60076a8fd79fea1e7e06848eb2e48d0ccfb30f6e073", + "sha256:c71be3f86d67d8d1311c6076a4ba3b75ba5703c0b856b4e691c9097f9b1e8bd2", + "sha256:c8754c75f55781515a3005063d9a05878b2cfb3cb7e41d5401ad0cf19de14872", + "sha256:cb0af13433dbbd1c806e671d81ec75bd324af6ef75171fd7815ca3074fe32bfe", + "sha256:cba6209c96828711cb7c8fcb45ecef8c8859238baf15119daa1bef0f6c84bfe7", + "sha256:cf77f8cf2a651fbd869fbdcb4a1931464189cd210abc4cfad357f1cacc8642a6", + "sha256:d7404cebcdb11bb5bd40bf94131faf7e9a7c10a6c60358580fe83913f360f929", + "sha256:dd1d3a8d1d2e50ad9b59e10aa7f07c7d1be2b367f3f2d33c5fade96ed5460962", + "sha256:e5d97c65ea7e097056f3d1ead77040ebc236feaf7f71489383d20f3b4c28412a", + "sha256:f1c3dc536b3ee124e8b24feb7533e5c70b9f2ef833e3b2e5513b2897fd46763a", + "sha256:f2212796593ad1d0235068c79836861f2201fc7137a99aa2fea7beeb3b101177", + "sha256:fead980fbc68512dfd4e0c7b1f5754c2a8e5015a04dea454b9cada54a8423525" + ], + "version": "==1.60.1" }, "grpcio-status": { "hashes": [ - "sha256:7d383fa36e59c1e61d380d91350badd4d12ac56e4de2c2b831b050362c3c572e", - "sha256:f10e0b6db3adc0fdc244b71962814ee982996ef06186446b5695b9fa635aa1ab" + "sha256:3034fdb239185b6e0f3169d08c268c4507481e4b8a434c21311a03d9eb5889a0", + "sha256:61b5aab8989498e8aa142c20b88829ea5d90d18c18c853b9f9e6d407d37bf8b4" ], - "version": "==1.60.0" + "version": "==1.60.1" }, "gunicorn": { "hashes": [ @@ -882,19 +891,19 @@ }, "langchain-community": { "hashes": [ - "sha256:0f1dfc1a6205ce8d39931d3515974a208a9f69c16157c649f83490a7cc830b73", - "sha256:c06512a93013a06fba7679cd5a1254ff8b927cddd2d1fbe0cc444bf7bbdf0b8c" + "sha256:ab957b34a562e0199b2ecf050bdc987c4fe889b2ac9f22b75a9fac8b9e30f53a", + "sha256:d503491bbfb691d1b3d10d74f7a69840cee3caf9b58a9a76f053ff925ea76733" ], "markers": "python_version < '4.0' and python_full_version >= '3.8.1'", - "version": "==0.0.16" + "version": "==0.0.17" }, "langchain-core": { "hashes": [ - "sha256:026155cf97867bde410ab1834799ab4c5ba64c39380f2a4328bcf9c78623ca64", - "sha256:59016e457cd6a1708d83a3a454acc97cf02c2a2c3af95626d13f83894fd4e777" + "sha256:5a60dc3c391b33834fb9c8b072abd7a0df4cbba8ce88eb1bcb288844000ab759", + "sha256:ad470b21cdfdc75e829cd91c8d8eb7e0438ab8ddb5b50828125ff7ada121ee7b" ], "markers": "python_version < '4.0' and python_full_version >= '3.8.1'", - "version": "==0.1.17" + "version": "==0.1.18" }, "langchain-experimental": { "hashes": [ @@ -1681,6 +1690,14 @@ "markers": "python_version >= '3.7'", "version": "==1.3.0" }, + "soupsieve": { + "hashes": [ + "sha256:5663d5a7b3bfaeee0bc4372e7fc48f9cff4940b3eec54a6451cc5299f1097690", + "sha256:eaa337ff55a1579b6549dc679565eac1e3d000563bcb1c8ab0d0fefbc0c2cdc7" + ], + "markers": "python_version >= '3.8'", + "version": "==2.5" + }, "sqlalchemy": { "hashes": [ "sha256:0d3cab3076af2e4aa5693f89622bef7fa770c6fec967143e4da7508b3dceb9b9", @@ -1839,7 +1856,7 @@ "sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84", "sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e" ], - "markers": "python_version >= '3.6'", + "markers": "python_version >= '3.7'", "version": "==2.0.7" }, "vine": { diff --git a/compose/local/django/Dockerfile b/compose/local/django/Dockerfile index adfc02a..a4d2882 100644 --- a/compose/local/django/Dockerfile +++ b/compose/local/django/Dockerfile @@ -8,6 +8,8 @@ FROM python as python-build-stage ARG BUILD_ENVIRONMENT=local +ENV PATH /venv/bin:$PATH + # Install apt packages RUN apt-get update && apt-get install --no-install-recommends -y \ # dependencies for building Python packages diff --git a/compose/production/django/Dockerfile b/compose/production/django/Dockerfile index 165933d..cc860b4 100644 --- a/compose/production/django/Dockerfile +++ b/compose/production/django/Dockerfile @@ -8,6 +8,8 @@ FROM python as python-build-stage ARG BUILD_ENVIRONMENT=production +ENV PATH /venv/bin:$PATH + # Install apt packages RUN apt-get update && apt-get install --no-install-recommends -y \ # dependencies for building Python packages diff --git a/compose/production/django/entrypoint b/compose/production/django/entrypoint index 599841e..e61c71a 100644 --- a/compose/production/django/entrypoint +++ b/compose/production/django/entrypoint @@ -20,17 +20,12 @@ postgres_ready() { python << END import sys -import psycopg2 +import psycopg try: - psycopg2.connect( - dbname="${POSTGRES_DB}", - user="${POSTGRES_USER}", - password="${POSTGRES_PASSWORD}", - host="${POSTGRES_HOST}", - port="${POSTGRES_PORT}", - ) -except psycopg2.OperationalError: + psycopg.connect(conninfo="${DATABASE_URL}") +except psycopg.OperationalError as e: + print(e) sys.exit(-1) sys.exit(0) diff --git a/compose/production/django/start b/compose/production/django/start index 460415c..db8314e 100644 --- a/compose/production/django/start +++ b/compose/production/django/start @@ -10,4 +10,4 @@ fi python /app/manage.py collectstatic --noinput python /app/manage.py migrate -/usr/local/bin/gunicorn core.wsgi --bind 0.0.0.0:5000 --timeout 180 --chdir=/app +gunicorn core.wsgi --bind 0.0.0.0:5000 --timeout 180 --chdir=/app