From 8a354bd8c852ce7c393f7b0abde8097b17a99624 Mon Sep 17 00:00:00 2001 From: tyboro2002 Date: Sat, 6 Apr 2024 14:20:28 +0200 Subject: [PATCH] chore: try adding the seeder lib --- backend/poetry.lock | 48 +++++++++++++++++++++++++++++++++---- backend/pyproject.toml | 4 +++- backend/ypovoli/settings.py | 1 + 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/backend/poetry.lock b/backend/poetry.lock index d2d6ad5d..df20168f 100644 --- a/backend/poetry.lock +++ b/backend/poetry.lock @@ -376,13 +376,13 @@ files = [ [[package]] name = "django" -version = "5.0.3" +version = "5.0.4" description = "A high-level Python web framework that encourages rapid development and clean, pragmatic design." optional = false python-versions = ">=3.10" files = [ - {file = "Django-5.0.3-py3-none-any.whl", hash = "sha256:5c7d748ad113a81b2d44750ccc41edc14e933f56581683db548c9257e078cc83"}, - {file = "Django-5.0.3.tar.gz", hash = "sha256:5fb37580dcf4a262f9258c1f4373819aacca906431f505e4688e37f3a99195df"}, + {file = "Django-5.0.4-py3-none-any.whl", hash = "sha256:916423499d75d62da7aa038d19aef23d23498d8df229775eb0a6309ee1013775"}, + {file = "Django-5.0.4.tar.gz", hash = "sha256:4bd01a8c830bb77a8a3b0e7d8b25b887e536ad17a81ba2dce5476135c73312bd"}, ] [package.dependencies] @@ -429,6 +429,21 @@ djangorestframework = ">=3.5.4" openapi-codec = ">=1.3.1" simplejson = "*" +[[package]] +name = "django-seed" +version = "0.3.1" +description = "Seed your Django project with fake data" +optional = false +python-versions = "*" +files = [ + {file = "django-seed-0.3.1.tar.gz", hash = "sha256:93e65d2c10449c464b83e9031be02763ec10e786aa064d649c4dd5ad06fa0eea"}, +] + +[package.dependencies] +django = ">=1.11" +Faker = ">=0.7.7" +toposort = ">=1.5" + [[package]] name = "django-sslserver" version = "0.22" @@ -504,6 +519,20 @@ uritemplate = ">=3.0.0" coreapi = ["coreapi (>=2.3.3)", "coreschema (>=0.0.4)"] validation = ["swagger-spec-validator (>=2.1.0)"] +[[package]] +name = "faker" +version = "24.7.1" +description = "Faker is a Python package that generates fake data for you." +optional = false +python-versions = ">=3.8" +files = [ + {file = "Faker-24.7.1-py3-none-any.whl", hash = "sha256:73f2bd886e8ce751e660c7d37a6c0a128aab5e1551359335bb79cfea0f4fabfc"}, + {file = "Faker-24.7.1.tar.gz", hash = "sha256:39d34c63f0d62ed574161e23fe32008917b923d18098ce94c2650fe16463b7d5"}, +] + +[package.dependencies] +python-dateutil = ">=2.4" + [[package]] name = "filelock" version = "3.13.3" @@ -1220,6 +1249,17 @@ dev = ["build", "flake8"] doc = ["sphinx"] test = ["pytest", "pytest-cov"] +[[package]] +name = "toposort" +version = "1.10" +description = "Implements a topological sort algorithm." +optional = false +python-versions = "*" +files = [ + {file = "toposort-1.10-py3-none-any.whl", hash = "sha256:cbdbc0d0bee4d2695ab2ceec97fe0679e9c10eab4b2a87a9372b929e70563a87"}, + {file = "toposort-1.10.tar.gz", hash = "sha256:bfbb479c53d0a696ea7402601f4e693c97b0367837c8898bc6471adfca37a6bd"}, +] + [[package]] name = "tox" version = "4.14.2" @@ -1355,4 +1395,4 @@ brotli = ["Brotli"] [metadata] lock-version = "2.0" python-versions = "^3.11.4" -content-hash = "2341567194c05d05a9617a1b812d26c63366ba3cc07ae842859102d9eadac972" +content-hash = "fc72c38f240e3a93e01f87850a6c16277b594999fd49891fc71107bd9e5ceeaf" diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 4dcfceac..7cd91ced 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -23,8 +23,10 @@ gunicorn = "^21.2.0" whitenoise = "^6.6.0" flake8 = "^7.0.0" celery-types = "^0.22.0" +faker = "^24.7.1" +django-seed = "^0.3.1" [build-system] -requires = ["poetry-core"] +requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" diff --git a/backend/ypovoli/settings.py b/backend/ypovoli/settings.py index 27d287c9..71b15063 100644 --- a/backend/ypovoli/settings.py +++ b/backend/ypovoli/settings.py @@ -49,6 +49,7 @@ "authentication", # Ypovoli authentication "api", # Ypovoli logic of the base application "notifications", # Ypovoli notifications + "django_seed", # seeding the database ] MIDDLEWARE = [