Python 如何在django中通过xsd生成models.py类?

Python 如何在django中通过xsd生成models.py类?,python,django,model,xsd,Python,Django,Model,Xsd,因此,我试图用django生成models.py类。我试着用gends_run_gen_django.py来做。我看了这个问题: 我正在尝试这个命令 gends_run_gen_django.py -f -p C:\Users\test\AppData\Local\Programs\Python\Python38-32\Scripts\generateDS.py C:\Users\test\Documents\Files\XMLSchemaPersonAdress.xsd 但是我得到了这个错

因此,我试图用django生成models.py类。我试着用gends_run_gen_django.py来做。我看了这个问题:

我正在尝试这个命令

gends_run_gen_django.py -f -p C:\Users\test\AppData\Local\Programs\Python\Python38-32\Scripts\generateDS.py  C:\Users\test\Documents\Files\XMLSchemaPersonAdress.xsd
但是我得到了这个错误:

   Traceback (most recent call last):
     File "C:\Users\test\AppData\Local\Programs\Python\Python38-32\Scripts\gends_run_gen_django.py", 
   line 201, in <module>
    main()
  File "C:\Users\test\AppData\Local\Programs\Python\Python38-32\Scripts\gends_run_gen_django.py", line 195, in main
    generate(options, schema_name)
  File "C:\Users\test\AppData\Local\Programs\Python\Python38-32\Scripts\gends_run_gen_django.py", line 91, in generate
    if not run_cmd(options, args):
  File "C:\Users\test\AppData\Local\Programs\Python\Python38-32\Scripts\gends_run_gen_django.py", line 118, in run_cmd
    process = Popen(args, stderr=PIPE, stdout=PIPE)
  File "c:\users\test\appdata\local\programs\python\python38-32\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "c:\users\test\appdata\local\programs\python\python38-32\lib\subprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
OSError: [WinError 193] %1 is not a valid Win32 application
回溯(最近一次呼叫最后一次):
文件“C:\Users\test\AppData\Local\Programs\Python 38-32\Scripts\gends\u run\u gen\u django.py”,
第201行,在
main()
文件“C:\Users\test\AppData\Local\Programs\Python 38-32\Scripts\gends\u run\u gen\u django.py”,主目录第195行
生成(选项、架构名称)
文件“C:\Users\test\AppData\Local\Programs\Python 38-32\Scripts\gends\u run\u gen\u django.py”,第91行,在generate中
如果未运行命令(选项、参数):
文件“C:\Users\test\AppData\Local\Programs\Python 38-32\Scripts\gends\u run\u gen\u django.py”,第118行,在run\u cmd中
进程=Popen(args,stderr=PIPE,stdout=PIPE)
文件“c:\users\test\appdata\local\programs\python38-32\lib\subprocess.py”,第854行,在uu init中__
self.\u execute\u child(参数、可执行文件、预执行文件、关闭文件、,
文件“c:\users\test\appdata\local\programs\python\python38-32\lib\subprocess.py”,第1307行,在执行子进程中
hp、ht、pid、tid=\u winapi.CreateProcess(可执行文件、参数、,
OSError:[WinError 193]%1不是有效的Win32应用程序

我需要做什么?

所以我联系了Dave Kuhlman,我们可以回答这个问题: