简体   繁体   中英

Particular local Django deployment. Fabric?

I had developed a classic Python Django web application on my local enviroment. Then, I used Cython to compile some my app's modules as dynamic library (*.so files) to "protect" the source code. Now, I need to distribute my Django app to one customer (for testing purpose) and I want to provide you all my Django app (with its files) but without some specific files and folders (ex: .git folder, *.pyc, *.py, javascript unobfuscated sources, etc...).

I would like to have some bash command (ex: python setup.py local_deploy) to automatic copy entire app's folder to another folder (ex: build) and remove a specific list of folders or file patterns.

Do you have any suggestion to do that?

I recommend you package your application for deployment, as you said, by running python setup.py sdist or another setuptools script command .

You can specify which package/modules/data to include and/or use a MANIFEST.in file to include/exclude files/directories matching specified patterns.

NB if you need to perform additional steps (besides selecting the correct files and packaging them), you may also add a custom command to setup.py . Though personally, I'd use a bash script / fabric to perform those, outside of packaging..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM