我有这个项目:
.
├── 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
文件发送到我的virtualenv时,我明白了:
*.tar.gz
问题出在error: can't copy 'Django-mysetup/templates/stylesheets': doesn't exist or not a regular file
。
如何调整我的package_data
脚本,以便在我的虚拟环境中安装setup.py
和template-basket
目录及其所有内容? (最好是我不需要在这些目录中写下每个文件,只是顶部的dir名称。)