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

build: 🎉 Set up start of a Poetry-managed Django app #43

Merged
merged 3 commits into from
Dec 22, 2023

Conversation

lwjohnst86
Copy link
Member

@lwjohnst86 lwjohnst86 commented Dec 21, 2023

  • Setting up poetry: poetry init
  • Add Django: poetry add django=4.2.8
  • Set up Django: poetry run django-admin startproject seedcase_sprout .
  • Add Django app: poetry run django-admin startapp app while in the seedcase_sprout directory
  • To run the Django project: First poetry run python manage.py migrate to make the migration files (we'll learn more about them later) and the poetry run python manage.py runserver which will start running the server with the Django contents.

Poetry creates:

  • pyproject.toml: This file contains the metadata that Python uses to recognize the project is a Package type setup. It is also used by Poetry to track package dependencies.
  • poetry.lock: Contains the Python packages and versions that Poetry uses to build a virtual environment (like Docker, but Python-style).

Django creates:

  • The seedcase_sprout/ folder that has the standard files used by Django. We'll learn about what each file does as we go along.
  • manage.py: This script is what we use to orchestrate/manage/modify the Django project. Running poetry run python manage.py will bring up a list of commands available to use.

Related to #38

Add files for poetry to use.
Used `poetry run django-admin startproject seedcase_sprout .`

Related to #38
Used `poetry run django-admin startapp app` while in the `seedcase_sprout` directory

Related to #38
@lwjohnst86 lwjohnst86 requested a review from a team as a code owner December 21, 2023 11:50
@philter87 philter87 self-requested a review December 21, 2023 13:37
@K-Beicher
Copy link
Contributor

Is this something that we should all play around with, or will one person setting it up and merging it into sprout send it to the rest?

@lwjohnst86
Copy link
Member Author

@K-Beicher I'm not sure I understand. Are you asking if everyone needs to run these commands? No, they don't, because we already did this yesterday, that's what this PR is for. What do you mean about sending it around? Once this is merged in, we can build the Django project in anyone's computer.

@K-Beicher
Copy link
Contributor

You are very good at interpreting my pre-coffee ramblings, yes, that was exactly what I was wondering. That because you've done this once (yesterday), once it is merged and part of sprout, then we can play with the Django app on our local machines :-)

@lwjohnst86 lwjohnst86 merged commit 55e2b1b into main Dec 22, 2023
1 check passed
@lwjohnst86 lwjohnst86 deleted the feat/project-setup branch December 22, 2023 13:08
@lwjohnst86 lwjohnst86 mentioned this pull request Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants