简体   繁体   English

要在我的浏览器中成功运行一个执行Python脚本的网站,我需要什么?

[英]What do I need to successfully run a website in my browser that executes Python scripts?

I currently simply have a local website on my Mac. 我目前在Mac上仅拥有一个本地网站。 I can view the webpage's HTMl and CSS and run the javascript functions in browser on my computer, but the next step I want to take is incorporating python scripts for accessing a MySQL database and returning results. 我可以查看网页的HTMl和CSS并在计算机上的浏览器中运行javascript函数,但是下一步,我要合并的是python脚本,用于访问MySQL数据库并返回结果。

I am clearly new to this, and would love some guidance. 我显然对此并不陌生,并且希望获得一些指导。 Right now, on my computer, I have MySQL installed and I can run it in the terminal just fine. 现在,在我的计算机上,我已经安装了MySQL,并且可以在终端上运行它。 What else do I need as far as database and server equipment – if anything – to get some dynamic website running locally? 我还需要什么数据库和服务器设备(如果有)来使一些动态网站在本地运行? My current, albeit incredibly limited, understanding is that I have a MySQL database stored on my machine that can be accessed through a Python script – also on my machine – and a link to this script in the HTML file. 我目前的理解(尽管有非常有限的理解)是,我在我的计算机上存储了一个MySQL数据库,可以通过Python脚本(也可以在我的计算机上)访问该数据库,并在HTML文件中链接到该脚本。 Is this even right, or do you recommend certain tutorials to fill in the gaps or teach me from the ground up? 这是否正确,还是您推荐某些教程来填补空白或从头开始教我?

I am sorry I am asking a lot; 对不起,我问了很多。 the few tutorials I have found have seemed to cover what I am hoping to do. 我发现的一些教程似乎涵盖了我希望做的事情。 Many thanks in advance. 提前谢谢了。

Here you go. 干得好。 https://docs.djangoproject.com/en/1.4/intro/install/ https://docs.djangoproject.com/en/1.4/intro/install/
Just follow the installation guide, and you'll be up and running in no time. 只需按照安装指南进行操作,即可立即启动并运行。

If you have MySQL installed on your machine along with Python, get a version of MySQLDb library for Python and have fun with it. 如果您在计算机上安装了MySQL以及Python,请获取适用于Python的MySQLDb库版本,并从中获得乐趣。 Moreover, you can do almost any data operation with these combinations. 此外,使用这些组合几乎可以执行任何数据操作。 If you want your website to go live (and do not wish to go through web frameworks) just look for a hosting plan that gives you a Python installed server access. 如果您希望您的网站上线(并且不希望使用Web框架),只需寻找一个托管计划即可为您提供Python安装的服务器访问权限。

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

相关问题 我需要配置什么才能在浏览器上运行 Python? - What do I need to configure to run Python on a browser? 如何将Python脚本合并到我的网站中? 我需要一个框架吗? - How can I incorporate Python scripts into my website? Do I need a framework? 当我的 Flask 网站在 VPS 上运行时,如何自动运行 Python 脚本? - How do I run Python scripts automatically, while my Flask website is running on a VPS? Python:要在Unittest中运行Selenium,我需要在程序目录中包括哪些模块? - Python: What modules do I need to include in the directory of my program to run Selenium with Unittest? WebHost 运行 Python 2.4 并且我需要 Python 2.6+ 来运行我使用 SQLite3 的脚本 - WebHost runs Python 2.4 & I need Python 2.6+ to run my scripts that use SQLite3 如何在不使用像flask和django这样的框架的情况下在html网站上运行小型python脚本? - How do I run small python scripts in a html website without using frameworks like flask, and django? 我需要对我的python代码做什么才能让它成为一个模块? - What do I need to do to my python code to get it to be a module? 如何持久运行Python脚本? - How do I run Python scripts persistently? 从网站运行python脚本 - Run python scripts from website 在网站中使用脚本python,django是我想要的吗? - Using scripts python in website, is django what I want?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM