2016-05-16 9 views
2

私はDjangoアプリケーションを作成しており、フレームワークとPythonには非常に新しいです。私はここでチュートリアルを以下午前:https://docs.djangoproject.com/en/1.9/intro/reusable-apps/およびパッケージで、現在だと、このチュートリアルから作成されたアプリケーションをインストールする:https://docs.djangoproject.com/en/1.9/intro/tutorial01/pip install djangoプロジェクトでインストール時に子ディレクトリを無視する

これは、Pythonを使用して私の最初のDjangoアプリケーションと私の最初の時間です。

現在、私のsetup.pyファイルには、次のようになります。

import os 
from setuptools import find_packages, setup 

with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: 
    README = readme.read() 

# allow setup.py to be run from any path 
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) 

setup(
    name= 'django-polls', 
    version='0.1', 
    packages=find_packages(), 
    include_package_date=True, 
    license='BSD License', #example license 
    description = 'A simple Django app to conduct Web-based polls.', 
    long_description = README, 
    url='https://www.example.com', 
    author='Your Name', 
    author_email='[email protected]', 
    classifiers=[ 
     'Environment :: Web Environment', 
     'Framework :: Django', 
     'Framework :: Django :: 1.9.6', # replace "X.Y" as appropriate 
     'Intended Audience :: Developers', 
     'License :: OSI Approved :: BSD License', # example license 
     'Operating System :: OS Independent', 
     'Programming Language :: Python', 
     # Replace these appropriately if you are stuck on Python 2. 
     'Programming Language :: Python :: 3', 
     'Programming Language :: Python :: 3.4', 
     'Programming Language :: Python :: 3.5', 
     'Topic :: Internet :: WWW/HTTP', 
     'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 
    ], 
) 

私MANIFEST.inファイルは次のようになります。

include LICENSE 
include README.rst 
recursive-include polls/static * 
recursive-include polls/templates * 
recursive-include docs * 

私のファイルのディレクトリは次のとおりです。

|polls 
    |__init.py__ 
    |admin.py 
    |apps.py 
    |models.py 
    |tests.py 
    |urls.py 
    |views.py 
    |__pychache__ 
    |# pycachestuff 
    |migrations 
    |# migrations stuff 
    |static 
    |polls 
     |images 
     |background.gif 
     |style.css 
    |templates 
    |polls 
     |detail.html 
     |index.html 
     |results.html 
    |docs 
    | 

セットアップを実行すると、生成された.zipがうまく動作し、すべてのディレクトリが含まれます。私はそれ

pip install C:\Path\To\dist\django-polls-0.1.zip -t C:\Path\To\Package 

を実行したときしかし、唯一は、主にポーリングディレクトリおよび移行のすぐ下にあるものをインストールします。サブディレクトリの静的およびテンプレートは無視されます。また、ドキュメントは無視されますが、フォルダが空であり、チュートリアルで空のディレクトリが無視されたと私は考えています。

私はこれをどのように修正できるか知っていますか?私が見たいくつかの答えは、package_dataやdata_filesを使うことを示唆していますが、私はPythonには新しく、文法を正しく理解できないようです(あるいはそれらの答えは間違っています)。

は、私がthisthis oneは、あなたが探しているものですと仮定し、あなたの時間

答えて

0

いただきありがとうございます。

関連する問題