Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions test-django-asgi-upload/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[project]
name = "test-django-asgi-upload"
version = "0"
requires-python = ">=3.12"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python version pin mismatch

Medium Severity

The new requires-python = ">=3.12" conflicts with the existing .python-version file still pinned to 3.11. uv run in this directory can pick 3.11 from pyenv while the project metadata requires 3.12+, so dependency sync or startup fails after the migration.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit cf956fc. Configure here.


dependencies = [
"channels>=4.2.0",
"daphne>=4.1.2",
"django>=5.2",
"django-debug-toolbar>=5.0.1",
"ipdb>=0.13.13",
"psycopg>=3.2.6",
"sentry-sdk[django]",
"strawberry-graphql>=0.243.0",
"strawberry-graphql-django>=0.51.1",
]

[tool.uv.sources]
sentry-sdk = { path = "../../sentry-python", editable = true }
13 changes: 0 additions & 13 deletions test-django-asgi-upload/requirements.txt

This file was deleted.

21 changes: 5 additions & 16 deletions test-django-asgi-upload/run.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail

# exit on first error
set -xe

# create and activate virtual environment
python -m venv .venv
source .venv/bin/activate

# Install (or update) requirements
python -m pip install -r requirements.txt
if ! command -v uv &> /dev/null; then
curl -LsSf https://astral.sh/uv/install.sh | sh
fi

cd mysite

Comment on lines +4 to 9

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The script installs uv if it's not present but fails to update the PATH for the current session, causing the subsequent uv command to fail.
Severity: HIGH

Suggested Fix

After installing uv, update the PATH for the current shell session. You can do this by adding export PATH="$HOME/.local/bin:$PATH" immediately after the installation command within the if block. This will make the uv binary available to the rest of the script.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: test-django-asgi-upload/run.sh#L4-L9

Potential issue: When `uv` is not pre-installed, the script attempts to install it using
the `astral.sh` installer. This installer updates shell profile files to add the
binary's location to the `PATH`, but these changes only take effect in new shell
sessions. The current script's environment is not updated. Consequently, the subsequent
call to `uv run daphne mysite.asgi:application` fails with a "command not found" error.
Since the script is configured with `set -euo pipefail`, this error will cause the
script to terminate prematurely.

Did we get this right? 👍 / 👎 to inform future reviews.

# run migrations
# ./manage.py migrate

# Run Django application on localhost:8000
daphne mysite.asgi:application
# ./manage.py runserver 0.0.0.0:8000
#gunicorn movie_search.project.asgi:application -k uvicorn.workers.UvicornWorker
uv run daphne mysite.asgi:application
Loading