Skip to content

Commit

Permalink
Adds gunicorn and python-dotenv dependencies
Browse files Browse the repository at this point in the history
* Adds gunicorn as a dependency as well as a VSCode launch config for running it locally
  in cases where we want to run local tests with a more production-like performance load.
* Removes unused import.
  • Loading branch information
afred committed Nov 2, 2023
1 parent 26a77ee commit 8eeea36
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 7 deletions.
28 changes: 25 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"inputs": [
{
"id": "numWorkers",
"type": "promptString",
"default": "4",
"description": "Number of Gunicorn workers to run"
}
],
"configurations": [
{
"name": "Python: Django",
"name": "OV Wagtail - Django dev server",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
Expand All @@ -18,7 +26,21 @@
"justMyCode": false
},
{
"name": "Python: Django Migrations",
"name": "OV Wagtail - Gunicorn",
"type": "python",
"request": "launch",
"program": "gunicorn",
// "python": "${workspaceFolder}/venv/bin/python",
"args": [
"-w ${input:numWorkers}",
"-b 127.0.0.1:4000",
"ov-wag.wsgi:applications",
],
"django": true,
"justMyCode": false
},
{
"name": "Run Migrations",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
Expand All @@ -31,7 +53,7 @@
"justMyCode": false
},
{
"name": "Python: Django Tests",
"name": "Run Tests",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
Expand Down
3 changes: 1 addition & 2 deletions ov_wag/tests/test_env.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from unittest import TestCase
from os import environ, system, path
from pprint import pp
from os import environ, path


class EnvTests(TestCase):
Expand Down
35 changes: 34 additions & 1 deletion pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
[project]
# PEP 621 project metadata
# See https://www.python.org/dev/peps/pep-0621/
dependencies = ["Django<4.2,>=4.1.1", "wagtail<4.1,>=4.0.4", "wagtail-factories<3.2,>=3.1.0", "pydantic<2.0,>=1.10.2", "psycopg2<2.10,>=2.9.3"]
dependencies = [
"Django<4.2,>=4.1.1",
"wagtail<4.1,>=4.0.4",
"wagtail-factories<3.2,>=3.1.0",
"pydantic<2.0,>=1.10.2",
"psycopg2<2.10,>=2.9.3",
"python-dotenv>=1.0.0,< 2.0",
"gunicorn>=21.2.0",
]
requires-python = ">=3.11"

[build-system]
Expand Down

0 comments on commit 8eeea36

Please sign in to comment.