mitsuhiko / platter

A useful helper for wheel deployments.
Other
335 stars 52 forks source link

How to platter a django project? #35

Open musicformellons opened 8 years ago

musicformellons commented 8 years ago

Maybe I should read up on setuptools, packaging, requirements etc. for another day or so, but I was hoping someone could guide me somewhat.

I can run platter etc fine and it indeed makes a nice tarball but I am pretty sure it is not 'everything I need/ would like'. I was hoping to package (preferably in one tarball or otherwise two separate ones): 1) my Django project/app 2) the 'virtualenv' with all requirements of my project under 1.

This would be an easy way to deploy the project and make me "pypi independent" (can still deploy even when pypi is 'down' etc.). Actually this would be nice compared to setting up Docker etc.

I use this simple setup.py script:

from setuptools import setup, find_packages

setup(
    packages=find_packages(),  # include all packages under src
    # package_dir={'': 'src'},  # tell distutils packages are under src
    # include_package_data=True,  # include everything in source control
    # ...but exclude README.txt from all packages
    exclude_package_data={'': ['README.txt']},
)

I tried putting it in my django project root; and also tried putting in the root of my virtual environment. In both cases it does platter something but I do not think it packs all my requirements...

I could continue with specifying my 'requirements' in my setup.py file but I am not sure whether you can specify versions etc and whether this is the way to go.

My questions: 1) Does platter suit a Django project deployment including all (pip) requirements? 2) If yes how to go about?

musicformellons commented 8 years ago

As I read this: http://python-packaging-user-guide.readthedocs.org/en/latest/requirements/

it says: "It is not considered best practice to use install_requires to pin dependencies to specific versions", however it seems me the most logic way for me to proceed. Please comment.