[英]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.