Ask Your Question
1

Cannot create Django Project on Windows

asked 2021-10-27 17:43:00 -0600

Michael gravatar image

updated 2021-11-11 10:53:20 -0600

When trying to create a Django project on Windows, I get:

Expected django-admin does not exist: v:\bin\scripting\python\3.9.5\python-3.9.5.amd64\django-admin

I have a portable Python installation (winpython) which places the various package-specific executables/scripts under v:\bin\scripting\python\3.9.5\python-3.9.5.amd64\Scripts, also django-admin (seems to be standard to me). Up to now it was sufficient to include this directory in the path. But this does not work with Wings Django project setup.

edit retag flag offensive close merge delete

Comments

It looks like Wing looks for django-admin[.py] in the same directory as python.exe, which in the test installations I have is also in the Scripts dir. Is this different in portable Python?

Also, did you create a Python env or just use the base install? A possible work-around would be to create a pipenv from the second screen of the New Project dialog.

Wingware Support gravatar image Wingware Support  ( 2021-10-28 08:51:32 -0600 )edit

For winpython, python.exe is one level up in v:\bin\scripting\python\3.9.5\python-3.9.5.amd64.

create a pipenv

I would prefer to avoid this.

Michael gravatar image Michael  ( 2021-10-30 03:52:38 -0600 )edit

3 Answers

Sort by » oldest newest most voted
0

answered 2021-11-17 09:16:14 -0600

This was fixed in 8.1.1.

edit flag offensive delete link more
1

answered 2021-11-18 14:56:52 -0600

Michael gravatar image

I'm afraid, we are not yet finished. I have 8.1.1.0 (rev 0721a05fd121) installed now and during the django project generation, the following error appears:

Project creation failed with the following errors:

Could not find manage.py and settings in the source directory

Details:

Running v:\bin\scripting\python\3.9.5\python-3.9.5.amd64\python.exe v:\bin\scripting\python\3.9.5\python-3.9.5.amd64\Scripts\django-admin.py --version in v:\my\finance\av
3.2.9
v:\bin\scripting\python\3.9.5\python-3.9.5.amd64\Scripts\django-admin.py:17: RemovedInDjango40Warning: django-admin.py is deprecated in favor of django-admin.
  warnings.warn(
Could not find manage.py and settings in the source directory

Django version is 3.9.2, I have no idea what kind of deprecation handling for his next major version it is doing there. No files are created in v:\my\finance\av (the planned pre-existing source directory)

Michael

p.s. Wrote this as answer, because the formatting is better.

edit flag offensive delete link more

Comments

Indeed, we're failing to prefer django-admin.exe. I've fixed that for 8.1.1.1+. I'm not sure that's the problem, though. Could you provide info on how/where manage.py and settings are laid out in your project? And did you select your project directory that contains those (somewhere in the directory tree) during project creation? (I'm assuming you chose the Use Existing Directory option in the New Project dialog).

Wingware Support gravatar image Wingware Support  ( 2021-11-18 15:20:03 -0600 )edit

I'm assuming you chose the Use Existing Directory option in the New Project dialog

Yes. I checked in the meantime, it doesn't matter. Same error when creating the directory during the process.

Could you provide info on how/where manage.py and settings are laid out in your project?

I have no idea, what the meaning of this file / these settings is / are (also, Django is a whole new python tool stack for me). I'm simply trying to create a new Django project from Wing, with no preconditions.

Michael gravatar image Michael  ( 2021-11-18 17:10:32 -0600 )edit

I am seeing problems also now and am investigating.

Wingware Support gravatar image Wingware Support  ( 2021-11-19 13:31:24 -0600 )edit

Oops, no my problem was running a much older version of Wing. It's working for me with Wing 8.1.1 (without the above-mentioned fix for finding djanbgo-admin.exe) and Python 3.10 if I create a new directory on the first New Project screen and on the second New Project screen I either create a new pipenv or use an existing Python installation that already has Django installed into it. I'd strongly recommend setting up new environment using pipenv or virtualenv because then you don't have to worry about missing required modules. Django does not come with Python so needs to be installed separately unless you let Wing do that for you. If you don't know Django then you definitely also want to create a new project directory along with your Wing project because that sets up a Django development project on disk (a non-trivial ...(more)

Wingware Support gravatar image Wingware Support  ( 2021-11-19 13:52:44 -0600 )edit
0

answered 2021-11-01 14:21:29 -0600

Wing assumes that django-admin[.py] is in the same directory as python[.exe], which is apparently not the case in a portable Python base installation and possibly also with regular Python on Windows when not using a virtual environment of any kind. I'm marking this as a bug report and we'll try to fix it soon. Thanks for reporting this problem!

edit flag offensive delete link more

Comments

The fix will be in update 8.1.1.0, which should be out in the next week or so. Thanks again for reporting this problem! It looks like it affects any Django project setup on Windows if no environment is being created.

Wingware Support gravatar image Wingware Support  ( 2021-11-11 10:53:08 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2021-10-27 17:43:00 -0600

Seen: 44 times

Last updated: Nov 18