Created
March 27, 2019 09:51
-
-
Save akmamun/52d8d3b5c34691e070bd5b2d62f1380d to your computer and use it in GitHub Desktop.
Protecting Python and Flask App Sources With Cython
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from distutils.core import setup | |
from distutils.extension import Extension | |
from Cython.Distutils import build_ext | |
from Cython.Build import cythonize | |
ext_modules = [ | |
Extension("test", ["test.py"]), | |
] | |
setup( | |
name='Test Compile', | |
cmdclass={'build_ext': build_ext}, | |
ext_modules=cythonize(ext_modules, | |
compiler_directives={'always_allow_keywords': True}, # 'always_allow_keywords' for avoid flask error | |
) | |
) | |
# than call | |
# add a main.py where flask app is call and run main.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment