i am trying to run some CGI scripts in python. For this i need apache server so, I installed XAMPP. Now my apache server is running.
I want to know what changes i need to make and in which file to link python with Apache server and to run my CGI scripts.
I am novice to python and that's why I have little knowledge about this.
I followed this link "http://jerryoem.wordpress.com/2008/03/31/how-to-run-python-cgi-script-under-windows-apache-server/" and made changes to xampplite/htdocs. Earlier my Xampp was running apache server but after the changes it is showing error as:
Error: Apache service not started [-1]
Please suggest me the steps to work on it.
Related
I'm new to web development and deployment however I developed a web site using Python 2.7 and Flask. I can't get the site to load when the user hits the site. When testing on the server using SSH the program starts like it did on my development PC but does not render the first template and shows this error: WARNING: Do not use the development server in a production environment. Use a production WSGI server instead.
In researching that error I found an article that says Flask is not meant for a multi-user public web environment. Further investigation said: If you want to run Flask in production, be sure to use a production-ready web server like Nginx, and let your app be handled by a WSGI application server like Gunicorn.
I think what this is telling me is:
Find a provider that supports Nginx.
Install Gunicorn and then configure it to run on that host.
Doing that should allow my program to run on the host server and be accessible to the world.
Would folks with experience with Python/Flask web apps please confirm the direction I should be heading as I can't afford to go down the wrong path again.
I am learning python and Django now. I have a question related to deploying Django project on windows 7. I know how to start the test server in django and see the project. But I have to do start the server manually every time I restart the PC. Also I have to keep the terminal window open.
Consider the below scenario for php projects.
We copy and paste the php files in htdocs or www folder in apache server and access them using the respected url. Web Server is running in the background. We dont have to start the server on windows restart.
Is something similar possible with Django on apache or any other server?
If yes, how should I go about it?
Thanks in advance.
For anyone stumbling around for an answer to a similar problem with deploying Django on a Windows server, here is a guide
Deploy Django with Apache and mod_wsgi on Windows Server 2019
To have Apache24 service automatically run on startup, make the changes in Windows Services dialog.
Is there a way to run PHP scripts in django? I have a plugin in TinyMCE that runs PHP scripts, and it is able to work using XAMPP's Apache. However, Django does support running of PHP script and therefore the plugin is not able to work. I would like to know if there is a way to configure Django to run PHP scripts.
Any help or pointers appreciated. Many Thanks!
Django isn't a HTTP server. You need a HTTP server like Apache, Nginx, etc along with the correct php module to run your PHP script.
Then you can configure Django to run on the same server. Here's an howto for running Django with Apache https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/. Then you can configure your PHP script to run on the same server.
After that, how your PHP script interacts with Django project is implementation specific.
Well, there's Django-php which lets you run PHP in Django templates - http://animuchan.net/django_php/
Though I'd draw your attention to the FAQ section of that website.
Essentially,
I am doing some of the development for my Django app straight on my shared server rather than on a local machine (I know that initially is the problem) however regardless, I would like to know if there is a way to restart the apache server on my shared hosted server (Bluehost) for when I modify any of the python files.
I'm not sure how the Django framework is setup, maybe restarting the webserver is not needed?
THanks!
How is the apache configured to run python codes? are you using fcgi, wsgi or something else?
What i do is, i use a fcgi process and restart fcgi process without the need to restart the webserver. In my case web server is nginx but it should be same in apache if you are using fcgi.
I've got a ubuntu vps and apache mod wsgi installed and serving my django sites.
however i have to restart all of apache rather than the site i have amended and its going to be a bit shonky if i tell clients that i have restarted their site cos i updated another site.
is there a tutorial somewhere to teach me how to configure this? i couldnt find one in googles keywords soup.
I'm already using virtualenvs if it helps.
Assuming you use mod_wsgi in daemon mode on UNIX/Apache 2.X system to run Django and have shell access to your machine all you need to do is touch the wsgi configuration for your project.
touch your_project.wsgi
See mod_wsgi documentation on Reloading Source Code and Django - mod_wsgi wiki for more references.