π¦ Package Management β
π¦ Package Management with requirements β
π§ TODO
You can help here!
π¦ Package Management with Poetry β
Requirements:
- Check the requirements for the chapter π¦ Creating my first project using D-JΓ Vue
- Poetry installed
Let's recreate the twitterclone like it was done in the π¦ Creating my first project using D-JΓ Vue but now choosing Poetry
INFO
π This step has less details due to the links above has more information.
Run the cookiecutter command against the D-JΓ Vue repositoty. You'll be prompted for some values. Provide them based on your needs and choose 'Poetry' for the 'package_manager':
cookiecutter https://github.com/evolutio/djavue3
cookiecutter https://github.com/evolutio/djavue3
Answer the prompts with your own desired flavours. For example:
β― cookiecutter https://github.com/evolutio/djavue3
[1/27] project_name (My Todo List): Twitter Clone
[2/27] project_slug (twitterclone):
[3/27] description (The Ultimate Django and Vue Template): My first Djavue template using Poetry
[4/27] app_name (core): posts
[5/27] model (Tasks): Tweets
[6/27] model_lower (tweets):
...
[10/27] Select package_manager
1 - requirements.txt
2 - pip-tools
3 - poetry
Choose from [1/2/3] (1): 3 π
...
[14/27] use_sqlite_local_env (no): yes
...
[21/27] Select docker_usage
1 - π³ use docker by default
2 - π¦ use venv npm by default π
Choose from [1/2] (1): 2
...
[SUCCESS]: π Your Django API backend is created! (root) β¨ π° β¨
[SUCCESS]: π° Your Vue 3 frontend is created! (frontend folder) β¨ π° β¨
...
β― cookiecutter https://github.com/evolutio/djavue3
[1/27] project_name (My Todo List): Twitter Clone
[2/27] project_slug (twitterclone):
[3/27] description (The Ultimate Django and Vue Template): My first Djavue template using Poetry
[4/27] app_name (core): posts
[5/27] model (Tasks): Tweets
[6/27] model_lower (tweets):
...
[10/27] Select package_manager
1 - requirements.txt
2 - pip-tools
3 - poetry
Choose from [1/2/3] (1): 3 π
...
[14/27] use_sqlite_local_env (no): yes
...
[21/27] Select docker_usage
1 - π³ use docker by default
2 - π¦ use venv npm by default π
Choose from [1/2] (1): 2
...
[SUCCESS]: π Your Django API backend is created! (root) β¨ π° β¨
[SUCCESS]: π° Your Vue 3 frontend is created! (frontend folder) β¨ π° β¨
...
DONE!! ππ The project structure is created! You can open the folder twitterclone
and check it out!
cd twitterclone/
cd twitterclone/
Then let's tell Poetry to create the virtual environment inside de project:
poetry config virtualenvs.in-project true
poetry config virtualenvs.in-project true
Then install de project dependencies using Poetry:
poetry install
poetry install
INFO
π Differently from virtualenv, Poetry will create and install the dependencies inside the virtual environment whitout it being active.
To run the backend, it will be necessary to active the environment using the following command:
poetry shell
poetry shell
Now the environment is ready and it's possible to execute the migrations and the run server. Check more details following the steps over the chapter π¦ Creating my first project using D-JΓ Vue
Other things that you can do at this point:
- Use
poetry env info
,poetry env info -p
andpoetry env list
to check more details about the virtual environment created by Poetry - Use
poetry add [some-python-lib]
to install and add it to thepyproject.toml
- Use
deactivate
to exit the poetry environment activated by thepoetry shell
- Use
poetry run flake8
to run something without activating the environment - Use
poetry show --tree
to show the dependencies and its internal dependencies too - Use
poetry show --latest
to show libs that can be updated
π¦ Package Management with Pip-tools β
π§ TODO
You can help here!