Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start a new Django project using poetry?

How to start a new Django project using poetry?

With virtualenv it is simple:

virtualenv -p python3 env_name --no-site-packages
source env_name/bin/activate
pip install django
django-admin.py startproject demo
pip freeze > requirements.txt

What will be equivalent to this using Poetry?

like image 387
12735961238 Avatar asked Feb 16 '20 18:02

12735961238


People also ask

What is the command to start a new Django project called my project?

$ django-admin startproject myproject .


Video Answer


1 Answers

Create a new project folder and step in:

$ mkdir djangodemo
$ cd djangodemo

Create a basic pyproject.toml with django as dependency:

$ poetry init --no-interaction --dependency django

Create venv with all dependencies needed:

$ poetry install

Init your demo-project

$ poetry run django-admin.py startproject djangodemo
like image 53
finswimmer Avatar answered Oct 17 '22 03:10

finswimmer