我有这个项目:
.
├── django_mysetup
│ ├── __init__.py
│ ├── template-basket
│ │ └── apple
│ │ ├── app_template
│ │ │ ├── forms.py
│ │ │ ├── __init__.py
│ │ │ ├── models.py
│ │ │ ├── tests.py
│ │ │ └── views.py
│ │ └── project_template
│ │ ├── manage.py
│ │ └── project_name
│ │ ├── __init__.py
│ │ ├── settings.py
│ │ ├── urls.py
│ │ └── wsgi.py
│ └── templates
│ ├── example_direct.html
│ ├── example.html
│ └── stylesheets
│ ├── base.css
│ ├── layout.css
│ └── skeleton.css
├── MANIFEST.in
├── README.rst
└── setup.py
这是setup.py
文件:
from distutils.core import setup
setup(
name='Django_mysetup',
py_modules=['django_mysetup'],
entry_points={
'console_scripts': ['django_mysetup = django_mysetup:main', ],},
description='A Personalised Django startproject and startapp setup script.',
long_description=open('README.rst').read(),
packages=['django_mysetup'],
package_data={'django_mysetup': ['templates/*', 'templates/stylesheets/*',
'template-basket/apple/app_template/*',
'template-basket/apple/project_template/*',
'template-basket/apple/project_template/project_name/*',
'template-basket/apple/project_template/manage.py'
]}
)
这是MANIFEST.in
文件(MANIFEST
生成模板)
include README.rst
recursive-include template-basket *
recursive-include templates *
当我这样做python setup.py sdist
并将文件发送到我pip install
的*.tar.gz
virtualenv 时,我得到了这个:
error: can't copy 'Django-mysetup/templates/stylesheets': doesn't exist or not a regular file
所以问题出在package_data
.
如何调整我的setup.py
脚本,以便在我的虚拟环境中安装template-basket
和templates
目录及其所有内容?(最好以一种我不需要在这些目录中写入每个文件的方式,只需要顶部的目录名称。)