View the main page when an error occurs

The application consists of only one page. Instead of error pages it should simple display the main site. How should I implement the error handles for that?You can do that with the help of error handlers i.e) @app.errorhandler(404) def page_not_found

Apache / Django: ImportError: no module named 'my_project'

Trying to get my django project hosted using apache2 and mod_wsgi. I've tried various configurations, but keep getting import errors when hitting the site in a browser such as: Traceback (most recent call last): File "/home/user/projects/my_projectMa

Pyramid: how to set SCRIPT_NAME in request.environ

I have a Pyramid app proxied behind nginx for which I'm trying to set SCRIPT_NAME in request.environ. I've tried: exporting it in the shell pserve is running in exporting it in the shell nginx is running in defining it in the Pyramid configuration fi

Streaming video on raspberry pi using server apache2 wsgi flask

I have used flask app for straming video via raspberrypi camera. The code i used for flask app is here: https://blog.miguelgrinberg.com/post/video-streaming-with-flask In local server it is doing video stream but not on my website. I am using apache2

Run a Python 2.7 Script on a Web Page

I have a couple of Python 2.7 scripts I need to have them run from a webpage. I've never done this before, although I'm comfortable coding in Python and well versed in Linux, Apache, Nginx. I see many different frameworks like the old CGI, WSGI, Djan

Reusing python bottle code on several different sites

I have a setup where I will have having around 50 sites using the same code, configured slightly differently. Rather than deploy the same code over and over again, duplicated across different folders and repositories, is there any way in Flask to cen

How to access the request in Flask MIddleware

I want to access request.url in middleware. Flask app - test.py from flask import Flask from middleware import TestMiddleware app = Flask(__name__) app.wsgi_app = TestMiddleware(app.wsgi_app) @app.route('/') def hello_world(): return 'Hello World!' i

How to get the version of wsgi_mod used by apache?

I am using ubuntu 12.041 and installed apache through apt-get. I don't know what version of mod_wsgi i am using albeit I google about it. All I found is you can use apachctl to restart you apache and you would get something like "Apache/2.2.2 (Unix)

Google App Engine app cache

In google app engine i have created my own user API appropriately called user so it doesn't interfere with the google app engine API users. Like most multiuser websites, two "versions" of the site are available to the user depending on whether o

Django + Apache - wsgi problem

I've been working with Django locally and now I'm trying to push some code to a production Apache environment on an Ubuntu server I have running (http://www.youtube.com/watch?v=hBMVVruB9Vs). However, I just get a list of files in the directory and no

Django Gunicorn Debug

Initially I had a Django app with the included testing server. To debug this setup, I can just add a import pdb; pdb.set_trace() anywhere in the code and have a breaking point that throws me into an interactive debugger in Terminal (on command-line).

Keep simple servers even on syntax errors

Is there a way to configure the simple-server that Flask uses to not exit on every single syntax error? app = Flask(__name__) app.run(host='0.0.0.0', debug=True, use_debugger=True, passthrough_errors=False); Currently I'm using this setup for the sim

Can WSGI load multiple vials?

In WSGI file, we would import a py file as from <pyFile> import app as application but is it possible to load several py file into a single wsgi file by doing something like this: from <pyFile1> import app1 as application from <pyFile2>

Flask debug = True does not work when you go through uWSGI

I call app.run(debug=True) in my flask file. and I have it deployed with uWSGI and nginx (I followed these instructions) uwsgi -s /tmp/uwsgi.sock -w flask_file_name:app -H /path/to/virtual/env --chmod-socket 666 But when I get an error, I don't get a

python website development

I need to create a simple website, the server is gonna running on Amazon EC2 web service. But I haven't done web development before. It seems like I need to learn a lot of stuff, javascript, html, css, web framework, WSGI, apache web server, etc. And

Deciding on WSGI or Django for a new web application

I'm in the process of setting up a new web app and deciding whether to just do it with WSGI or go the full framework route with Django. The app's foremost requirements: 1) The app has no UI what so ever and all of the data is exposed to clients via a

Portable Python - running Django on Apache?

I am using Windows 7, Apache 2.28 and Web Developer Server Suite for my server. All files are stored under C:/www/vhosts I downloaded Portable Python 2.7 from http://www.portablepython.com/ and have installed it to C:/www/portablepython I'm trying to

python + django: can not find the module with Popen

I use subprocess.Popen in one of the my views: path = os.path.join(os.path.dirname(__file__), 'foo/bar.py') subprocess.Popen(["python",path]) In my wsgi file, I have import os import sys ppath = '/home/socialsense/ss/src' if ppath not in sys.pat

AppEngine confusion - CGI, WSGI-compliant?

I'm confused. If AppEngine is supposed to allow running of WSGI-employing apps .. # somewhere in a webapp.RequestHandler env = dict(os.environ.items()) for key, value in env.items(): self.response.out.write(key+': '+value+'<br/>') req_uri = wsgiref.

Threading inside the application vs. process. Server

I have a site which sometimes takes particularly long to process a request (and that's not a defect). 99% of the time it's pretty quick because it almost doesn't do any processing. I want to show a message that says "Loading" when the site takes

WSGI Middleware for OAuth Authentication

I have build a very small web application using Flask. Now I would like to add very basic authentication to the site (I don't need authorization). As Flask does not support auth&auth out of the box, I'd like to plug in a WSGI middleware doing this jo

Calling a python function on the web using AJAX?

I want to send a string to a python function I have written and want to display the return value of that function on a web page. After some initial research, WSGI sounds like the way to go. Preferably, I don't want to use any fancy frameworks. I'm pr

Can not compile uwsgi under centos (fc10) with python2.6

it`s normally build with python 2.5 BUT i need 2.6! 2.6 normally installed in /opt/python26 and successfully run as python2.6 in console. but python2.6 uwsgiconfig.py --build give me *** uWSGI linking *** /usr/bin/ld: cannot find -lpython2.6 collect2

web framework compatible with python 3.1 and py-postgresql

I have started learning Python by writing a small application using Python 3.1 and py-postgresql. Now I want to turn it into a web application. But it seems that most frameworks such as web-py, django, zope are still based on Python 2.x. Unfortunatel

WSGI authentication: Homegrown, Authkit, OpenID, and hellip;

I want basic authentication for a very minimal site, all I personally need is a single superuser. While hard-coding a password and username in one of my source files is awfully tempting, especially since I'm hosting the site on my own server, I feel