Skip to content

Instantly share code, notes, and snippets.

@kevinah95
Last active February 21, 2023 03:51
Show Gist options
  • Save kevinah95/28881712af4a89203e48d8270f79c9d8 to your computer and use it in GitHub Desktop.
Save kevinah95/28881712af4a89203e48d8270f79c9d8 to your computer and use it in GitHub Desktop.

Add dev dependencies

$ poetry add --group dev black

Export dependencies to requirements.txt

$ poetry export --without-hashes --without-urls -f requirements.txt --output requirements.txt
$ mkdir helloworld && cd helloworld
$ poetry init
$ poetry config virtualenvs.in-project true
$ poetry add django
$ poetry shell
$ django-admin startproject config .
$ python manage.py migrate
$ python manage.py runserver

Create an app

$ python manage.py startapp <app-name>
  • Install pyenv with: https://github.com/pyenv/pyenv-installer
  • Install a version of python 3:
    • pyenv install 3.11.2
    • pyenv global 3.11.2
  • Install poetry with: https://python-poetry.org/
  • Config virtual-envs in project (👉 More info):
    • poetry config settings.virtualenvs.in-project true
    • You can config this setting in current project: poetry config --local virtualenvs.in-project true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment