mod-python

Django logs: any tutorial to log to a file

拥有回忆 提交于 2019-12-06 08:31:35
I am working with a django project, I haven't started. The developed working on the project left. During the knowledge transfer, it was told to me that all the events are logged to the database. I don't find the database interface useful to search for logs and sometimes they don't even log(I might be wrong). I want to know, if there is an easy tutorial that explains how to enable logging in Django with minimal configuration changes. Thank you Bala If you are talking about the Django admin log (the one that shows on the right side of the main page of the admin interface), you could just enable

Access-Control-Allow-Origin: * not working?

浪尽此生 提交于 2019-12-06 08:25:37
问题 Classic "Origin ... is not allowed by Access-Control-Allow-Origin" problem. Two machines serve contents for the same website. When machine A does a $('#main').load('link_to_resource_on_B') via jquery, machine B serves up the content with mod_python, adding Access-Control-Allow-Origin: * header. But for some reason, this still does not work. I tested this on Chrome, Safari, and Internet Explorer. And I tested via command line to check the response header, it seems Access-Control-Allow-Origin:

deploying a WSGI application on mod_python

杀马特。学长 韩版系。学妹 提交于 2019-12-05 11:12:46
I wrote a WSGI application which I need to deploy to a server, however I've been given a server that already has mod_python installed. I am not allowed to remove mod_python since there are some mod_python applications running on it already. One option I considered was installing mod_wsgi alongside mod_python, however I went through sources and found that was a bad idea. Apparently mod_wsgi and mod_python don't mix well. Another option I considered was installing mod_fastcgi and deploying it using fastcgi. I would love to hear if someone has a better idea which doesn't break the current mod

django request.POST contains <could not parse>

社会主义新天地 提交于 2019-12-05 10:54:05
I am having a django form to get the username,password. when the user posts data, i see that the post dictionary contains the following(traceback), Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py", line 111, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python2.4/site-packages/django/views/decorators/csrf.py", line 39, in wrapped_view resp = view_func(*args, **kwargs) File "/usr/lib/python2.4/site-packages/django/views/decorators/csrf.py", line 52, in wrapped_view return view_func(*args, *

Get the version of Django for application

◇◆丶佛笑我妖孽 提交于 2019-12-05 10:04:38
问题 I am starting a new (actually very old) project which I know is in Django. I am getting lost knowing the exact version of Django it has been build upon. Is there a way I can know the version of Django my application is running? 回答1: The only way is to take a guess. I would start by looking at the created date of the settings.py file (or other base project files) Release dates for versions: 1.0: September 2008. (?) 1.1: July 29, 2009 [1] 1.2: May 17, 2010 [2] 1.3: March 23, 2011 [3] Having in

Restarting a Django application running on Apache + mod_python

删除回忆录丶 提交于 2019-12-05 04:08:57
I'm running a Django app on Apache + mod_python. When I make some changes to the code, sometimes they have effect immediately, other times they don't, until I restart Apache. However I don't really want to do that since it's a production server running other stuff too. Is there some other way to force that? Just to make it clear, since I see some people get it wrong, I'm talking about a production environment. For development I'm using Django's development server, of course. If possible, you should switch to mod_wsgi. This is now the recommended way to serve Django anyway, and is much more

A good multithreaded python webserver?

笑着哭i 提交于 2019-12-04 18:07:25
问题 I am looking for a python webserver which is multithreaded instead of being multi-process (as in case of mod_python for apache). I want it to be multithreaded because I want to have an in memory object cache that will be used by various http threads. My webserver does a lot of expensive stuff and computes some large arrays which needs to be cached in memory for future use to avoid recomputing. This is not possible in a multi-process web server environment. Storing this information in memcache

Deploying django app on Apache mod_python

落爺英雄遲暮 提交于 2019-12-04 14:45:40
问题 I've finished making a site in django called 'kazbah', and I'm trying to deploy. All the code for the kazbah site is in /home/git/DjangoProjects/kazbah and my httpd.conf looks like: <Location "/"> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE kazbah.settings PythonDebug On PythonPath "['/home/git/DjangoProjects'] + sys.path" </Location> I get the following error though: ImportError: Could not import settings 'kazbah.settings' (Is it on

Access-Control-Allow-Origin: * not working?

那年仲夏 提交于 2019-12-04 14:39:00
Classic "Origin ... is not allowed by Access-Control-Allow-Origin" problem. Two machines serve contents for the same website. When machine A does a $('#main').load('link_to_resource_on_B') via jquery, machine B serves up the content with mod_python, adding Access-Control-Allow-Origin: * header. But for some reason, this still does not work. I tested this on Chrome, Safari, and Internet Explorer. And I tested via command line to check the response header, it seems Access-Control-Allow-Origin: * is successfully in the header from B. See below. What could i be missing? $ telnet localhost 80

Why can't I disable .htaccess in Apache?

大憨熊 提交于 2019-12-04 08:59:43
This is the opposite problem from most about which I have read. I am running Ubuntu 8.04 on an Amazon instance with Apache 2.2.8 and I can't figure out why setting AllowOverride to None for root doesn't stop my .htaccess file from being included. I have a sub-directory with hello.py in it and an .htaccess file. When I browse to the file, it works fine with modpython serving the file. If I put some garbage in .htaccess I get a server error, so I know the .htaccess file is being used. Also if I delete the .htaccess file, hello.py is no longer server by modpython - instead the browser tries to