Active5 years, 8 months ago

Feb 17, 2015  How to config cgi python apache2 Windows 7 Windows 8 Windows 10 you must have python and wamp or just apache2 installing on your pc Link Wamp Windows Apache Mysql PHP. Now, the apache web server needs to be restarted. You can do this either via the Apache service located in the services control panel or via the Start - All Programs - Apache. Control Apache Server menu option. Run a test Python page. You can use the EditRocket hello world Python sample web page template for a test Python page. Linux, Apache, MySQL and Perl/PHP/Python is a solution stack that is most commonly referred to using its acronym 'LAMP.' It is an open source development platform for creating and managing Web applications. Linux serves as the backend operating system (OS).

I've just installed the last apache release httpd-2.4.7, next I istalled the last python 3.3.3 release, then I added mod_wsgi and restarted apache - so, at this point everything is ok. At the next stage I downloaded the last release of django 1.6.1 and also installed it (python setup.py install). Now I want to connect mysql (the version does not really matter for me) and python, but do not now how and do not know if it is possible. The catch is, I want not only to connect python and mysql, but also django and mysql (I heard, it is possible to have python and mysql connected, but django and mysql disconnected). So, I need two simplest instructions: 1) How to connect python and mysql 2) How to connect django and mysql - the simplest example would be enough.

Windows/Apache/MySQL/PHP, Python, PERL (WAMP) is a set of web applications combined with Microsoft Windows OS to be used in web environments constituting a server. It is an open source development platform for creating and managing Web applications. Linux serves as the backend operating system (OS). Apache is the Web server, MySQL is the database, and one of PHP, Perl, Python is the scripting language. PHP is the most popular of the three scripting languages. I was really wondering for a long time why Python development on windows was such a pita - until I installed activestate python. I am not affiliated with them. It is just the plain truth. Write it on every wall: Python development on Windows = ActiveState! You then just pypm install mysql-python and everything works smoothly.

JacobianJacobian
2,62314 gold badges64 silver badges143 bronze badges

closed as off-topic by Szymon, Lajos Veres, Jurian Sluiman, falsetru, Mike SzyndelJan 3 '14 at 9:24

This question appears to be off-topic. The users who voted to close gave this specific reason:

Mysql
  • 'Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist' – Szymon, Lajos Veres, Jurian Sluiman, falsetru, Mike Szyndel
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

MySQLdb (the native driver for MySQL) is not compatible with Python3 yet; but the driver from Oracle for MySQL, called MySQL Connector/Python is compatible with Python 3.

You should use the Oracle driver. django works with both.

Once you have the driver installed, follow the connection section in the documentation.

Burhan KhalidBurhan Khalid
130k16 gold badges171 silver badges227 bronze badges

Not the answer you're looking for? Browse other questions tagged pythonmysqldjangowindowsapache or ask your own question.

Active10 years, 8 months ago

I want to get a simple Python 'hello world' web page script to run on Windows Vista/ Apache but hit different walls. I'm using WAMP. I've installed mod_python and the module shows, but I'm not quite sure what I'm supposed to do in e.g. http.conf (things like AddHandler mod_python .py either bring me to a file not found, or a forbidden, or module not found errors when accessing http://localhost/myfolder/index.py). I can get mod_python.publisher to work but do I 'want' this/ need this?

Serial Criminal Cereal Box Project Assessment Rubric Category 5 3-4 2 1 0 Front of Box Contains name of serial criminal; is decorated w/ slogans/symbols; has a creative Title, graphics of serial criminal or pertaining to serial criminal are included; Artistic style or theme is eye-catching. Contains name of serial criminal; is decorated w/ a. Serial Killer Cereal Box Project. Serial murder is neither a new phenomenon, nor is it uniquely American. Dating back to ancient times, serial murderers have been chronicled around the world. In 19th century Europe, Dr. Richard von Krafft-Ebing conducted some of the first documented research on violent, sexual offenders and the crimes they. Cereal Box Serial Killer Project For your project, you will research a serial killer and construct a cereal box advertising a cereal that is related to your serial killer. Just as a cereal box has six sides, your project will have six “sides”. You will share your cereal box (15 oz. Serial killer cereal box project. Research and analyze an infamous serial killer in history. Demonstrate knowledge of the basic profile of serial killers. Identify early behavior traits of past serial killers. Organize information in a creative and visually appealing manner. Cover a cereal box with “quick facts” about a. Serial Criminal Cereal Box Project Assessment DUE DATE: January 14th, 2016 Purpose: Research and analyze a serial criminal (serial killer, mass killer, spree killers, serial arsonists). Gather information about your serial killer from multiple sources. Demonstrate knowledge of how we profile serial criminals.

Can anyone help?

Thanks!

Philipp LenssenPhilipp Lenssen
3,7019 gold badges41 silver badges58 bronze badges

3 Answers

Stay away from mod_python. One common misleading idea is that mod_python is like mod_php, but for python. That is not true. Wsgi is the standard to run python web applications, defined by PEP 333. So use mod_wsgi instead.

Or alternatively, use some web framework that has a server. Cherrypy's one is particulary good. You will be able to run your application both standalone and through mod_wsgi.

An example of Hello World application using cherrypy:

Very easy huh? Running this application directly on python will start a webserver. Configuring mod_wsgi to it will make it run inside apache.

nosklonosklo
165k46 gold badges259 silver badges277 bronze badges

You do not NEED mod_python to run Python code on the web, you could use simple CGI programming to run your python code, with the instructions in the following link: http://www.imladris.com/Scripts/PythonForWindows.html

That should give you some of the configuration options you need to enable Python with CGI, and a google search should give you reams of other info on how to program in it and such.

Mod_python is useful if you want a slightly more 'friendly' interface, or more control over the request itself. You can use it to create request filters and other things for the Apache server, and with the publisher handler you get a simpler way of handling webpage requests via python.

Sims 2 create a sim download. Is your sim hungry? But it is awfully late! This may sound dull, but once you get to play it, you’re practically hooked.A great deal of the fun is time management, and making the right decisions. Send him into the kitchen and have him prepare a meal. Maybe he’ll just have a snack, that way he can get a good rest and be in top shape for work tomorrow.

The publisher handler works by mapping URLs to Python objects/functions. This means you can define a function named 'foo' in your python file, and any request to http://localhost/foo would call that function automatically. More info here: http://www.modpython.org/live/current/doc-html/hand-pub-alg-trav.html

Windows Apache Mysql Python

As for the Apache config to make things work, something like this should serve you well

If you have /var/www/html/ set up as your web server's root and have a file called index.py in the python/ directory in there, then any request to http://localhost/python/foo should call the foo() function in index.py, or fail with a 404 if it doesn't exist.

Daniel BruceDaniel Bruce
9,4194 gold badges24 silver badges28 bronze badges

Windows Apache Mysql Python Server

AddHandler mod_python .py

Have you set 'PythonHandler'?

Python Mysql Client Windows

These days, consider using WSGI instead of native mod-python interfaces for more wide-ranging deployment options. Either through mod-python's WSGI support, or, maybe better, mod-wsgi. (CGI via eg. wsgiref will also work fine and is easy to get set up on a development environment where you don't care about its rubbish performance.)

Python Mysql Client

bobince

Windows Apache Mysql Python Command

bobince

Windows Apache Mysql Python Tutorial

460k91 gold badges593 silver badges783 bronze badges

Windows Install Mysql Python

Not the answer you're looking for? Browse other questions tagged pythonwampmod-python or ask your own question.