简体   繁体   English

将 django 项目作为完整安装文件 (setup.exe) 交付以方便用户且不泄露整个脚本的最佳方式是什么?

[英]What is the best way to deliver django project as a full installation file (setup.exe) to be user-friendly and not revealing your whole scripts?

I have a django project which is working fine.我有一个运行良好的 django 项目。 However, this question can be related to any django project.但是,这个问题可能与任何 django 项目有关。 Django works in a way that after running python manage.py runserver the project is accessible at localhost:8000 . Django 的工作方式是在运行python manage.py runserver后,可以在localhost:8000访问项目。 But when you deliver the project to the customer you cannot expect them to open command windows every time, then run python manage.py runserver , then open a browser, then type localhost:8000 and etc. I have heard docker might be a solution to this.但是当您将项目交付给客户时,您不能指望他们每次都打开命令 windows,然后运行python manage.py runserver ,然后打开浏览器,然后输入localhost:8000等。我听说docker可能是 158 到 BFC 解决方案这个。 But docker will need the scripts available in the local machine.但是 docker 将需要本地计算机中可用的脚本。 I am talking about making a full installation file like when you buy a video game and the scripts are not accessible easily (seems there are binary files).我说的是制作完整的安装文件,就像您购买视频游戏时一样,并且脚本不容易访问(似乎有二进制文件)。

The real question is how can we protect our code and scripts and be sure they cannot be accessed easily after we have installed them in a customer's computer?真正的问题是,我们如何保护我们的代码和脚本,并确保在我们将它们安装到客户的计算机后不能轻易访问它们?

Edit: My client is the service provider who will host the project for its own clients.编辑:我的客户是将为其自己的客户托管项目的服务提供商。 That is why I am seeking to deliver the project in a way that is at least different from just copying and pasting everything.这就是为什么我寻求以一种至少不同于复制和粘贴所有内容的方式交付项目的原因。

I would suggest to create a docker image as suggested here then whoever needs to run it on local computer or as website application can freely just run a docker image locally or deploy it as docker image.我建议按照此处的建议创建 docker 映像,然后需要在本地计算机上运行它或作为网站应用程序运行的人可以自由地在本地运行 docker 映像或将其部署为 Z05B6053C41A2130AFD6FC3B158BDA46 映像。

https://docs.docker.com/compose/django/ https://docs.docker.com/compose/django/

Django is webdevelopment framework. Django 是 web 开发框架。 So it enables you to make web applications, not native apps (like the video games you've mentioned).因此,它使您能够制作 web 应用程序,而不是本机应用程序(如您提到的视频游戏)。

Once you feel you have a releasable product (build with django) and you would like your customers to acces your django website/application you should deploy it to a public server/host.一旦您觉得您有一个可发布的产品(使用 django 构建)并且您希望您的客户访问您的 django 网站/应用程序,您应该将其部署到公共服务器/主机。 That way your customers only need to open there browsers and go to your application.这样您的客户只需要打开浏览器和 go 到您的应用程序。

You can do this a 100 different ways with a 1000 different setups, depending on the usage and complexity of your (web)application.您可以使用 1000 种不同的设置以 100 种不同的方式执行此操作,具体取决于您的(Web)应用程序的使用和复杂性。 To do this you need to know a little bit about system administration.为此,您需要对系统管理有所了解。 There are a ton of tutorials online on how to deploy django projects.网上有大量关于如何部署 django 项目的教程。

Most important for you to learn is that you build a webapplications with Django wich can be taken in production by publishing it on the web and not by downloading some.exe file.对您来说最重要的是要学习使用 Django 构建 Web 应用程序,可以通过在 web 上发布它而不是通过下载 some.exe 文件来将其投入生产。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python - 检查缺失库依赖项的用户友好方式的最佳实践? - Python - Best practice for user-friendly way of checking for missing library dependencies? 用于用户友好的任意字节字符串的配置文件格式是什么? - What config file format to use for user-friendly strings of arbitrary bytes? 设置用户友好和显式标志值的最 Pythonic 方式? - Most Pythonic way of setting user-friendly and explicit flag values? 整合Django专案首页的最佳方法 - Best way to integrate your Django project homepage 使 Spotipy 程序用户友好 - Making Spotipy program user-friendly Python 中的用户友好时间格式? - User-friendly time format in Python? 有没有办法将输入以预测 function 转换为分类数据,以便用户友好? - Is there a way to convert input to predict function into categorical data so it is user-friendly? 在Django项目中构造模板的最佳实践是什么? - What is the best practice in structuring templates in your Django project? 配置django项目的最佳方法是什么 - What is the best way to configure a django project 在aws上运行django项目的最佳方法是什么? - What is the best way to run a django project on aws?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM