The error seems to be that the path to the python executable in the virtual environment is mangled, it should be: "env\Scripts\python.exe" instead of "\env\ \Scripts\python.exe"

For some reason, in Python projects created from scratch, the path to the python executable in the virtual environment is an absolute path at this point, and all is well. However, in PTVS DJango projects created via the "From Existing Python Code"
option, it seems to use a mangled relative path where the name of the folder containing the virtual environment has an extra pair of backslashes surrounding it.

Thus far, I have found no work-around. This bug presents massive problems for importing other people's Django projects. From all my testing, it seems that PTVS is currently not a valid option for anyone hoping to deploy existing DJango websites to Azure.

file attachments

comments

The workaround for this should be to edit your pyproj file and change the ProjectHome property to "." (I think it is empty right now).

Another possibility is to wait for PTVS 2.1 Alpha, which should be out this week. We've really focused on web this time, and while it is only alpha quality, it should be at least as good as 2.0 in this area. (Also, we'd love feedback from people who know what
they're doing - that's the point of releasing early, after all :) )

Yes you're right, modifying the raw .pyproj file with the text editor and changing the line:

<ProjectHome />

to:

<ProjectHome>.</ProjectHome>

seems to do the trick as a work-around. There's still an extra pair of backslashes surrounding the name of the virtual environment (env) when the command runs, but it doesn't seem to be causing any issues when the path is absolute.

("cases where it may" was a bit vague. I'm referring to edge cases, where the actual path may be 258 characters long, but the extra ".\" puts it over the limit and things will crash, even though it really shouldn't. In normal usage,
there should not be any problems at all :) )