Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(#22): add django models #29

Merged
merged 1 commit into from
Jul 1, 2024
Merged

Feat(#22): add django models #29

merged 1 commit into from
Jul 1, 2024

Conversation

mari1912
Copy link
Collaborator

Description

  • Add django models
  • Add connection to database, it needs to be running on the background
  • fix backend pre-commit
  • todo: connect the database to docker-compose

Related Issues

How to test it

  • Add a .env file by running a cp .env.example .env
  • Fill the values with kcidb user/password
  • Run kcidb_playground in the background
  • Try to run poetry run python3 manage.py inspectdb to check if the app can get the db values
  • Run poetry run python3 manage.py shell and inside the shell
from kernelCI_app.models import Issues
x = Issues.objects.all()
print(x)

and check if there is any issue object

@mari1912 mari1912 self-assigned this Jun 27, 2024
@mari1912 mari1912 force-pushed the feat/add-django-models branch from 6f34a0e to a434760 Compare June 28, 2024 17:02
@@ -27,6 +29,8 @@

ALLOWED_HOSTS = []

env = environ.Env(DEBUG=(bool, False))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@lfjnascimento lfjnascimento Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just rebase your branch and you can use get_json_env_var

@@ -27,6 +29,8 @@

ALLOWED_HOSTS = []

env = environ.Env(DEBUG=(bool, False))
environ.Env.read_env(os.path.join(BASE_DIR, '.env'))
Copy link
Member

@barbieri barbieri Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is never to be used from within the code, but rather from some external env loader. Be it a source .env in the shell that calls the server, https://pypi.org/project/python-dotenv/ with a forced import before it runs...

anyway, never to be done/called-directly in the project code

@mari1912 mari1912 force-pushed the feat/add-django-models branch from a434760 to eaa5df9 Compare July 1, 2024 12:49
@mari1912 mari1912 force-pushed the feat/add-django-models branch from eaa5df9 to 9e83c79 Compare July 1, 2024 13:00
@mari1912 mari1912 merged commit c86c665 into main Jul 1, 2024
4 checks passed
@mari1912 mari1912 deleted the feat/add-django-models branch July 1, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Model all data required for TMLP and create entities in the ORM
3 participants