Member-only story
Ditch requirements.txt
: Elevate Your Django Projects with Poetry! 🚀
If you’re still managing dependencies with requirements.txt, it's time for an upgrade. While pip and virtualenv have served Django developers well for years, Poetry is a modern dependency management tool that simplifies the process and offers more control.
In this guide, you’ll learn how to set it up poetry for your Django project, and the best practices to streamline your workflow.
Setting Up Poetry for Your Django Project
1️. Install Poetry
Before using Poetry, you need to install it.
For Mac & Linux, run:
curl -sSL https://install.python-poetry.org | python3 -
For Windows, use:
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
After installation, verify that Poetry is installed:
poetry --version
2. Create a New Django Project with Poetry
Instead of manually creating a virtual environment and installing dependencies, use Poetry to set up everything in one command:
poetry new my_django_project
cd my_django_project