InterviewSolution
| 1. |
Deploy Flask application with Setuptools. |
|
Answer» Setuptools is a Python extension library for distributing Python libraries and extensions. It enhances distutils, a rudimentary module installation system included with Python, to include a number of more complicated operations that make it easier to distribute larger applications:
Setuptools or distutils are used to distribute Flask and all of the libraries available on PyPI. If you have already installed Flask, then you ALSO have setuptools available on your system because Flask is dependable on setuptools. A Flask application's basic setup.py FILE looks like this: from setuptools import setup[Text Wrapping Break][Text Wrapping Break]setup([Text Wrapping Break] name='Your Application',[Text Wrapping Break] version='1.0',[Text Wrapping Break] long_description=__doc__,[Text Wrapping Break] packages=['yourapplication'],[Text Wrapping Break] include_package_data=True,[Text Wrapping Break] zip_safe=False,[Text Wrapping Break] install_requires=['Flask'][Text Wrapping Break])Please keep in mind that you MUST explicitly list subpackages. You can use the find packages method to have setuptools hunt up the packages for you automatically: from setuptools import setup, find_packages[Text Wrapping Break][Text Wrapping Break]setup([Text Wrapping Break] ...[Text Wrapping Break] packages=find_packages()[Text Wrapping Break]) |
|