mod-wsgi

Django JWT Authentication behavior different between local & mod_wsgi servers with Django REST framework

霸气de小男生 提交于 2019-12-04 03:17:14
I am trying to determine why authentication for protected resources using the Authorization: header behaves properly when using a local development server but not on my deployed apache 2.2 w/mod_wsgi implementation. I am using django 1.8 with django-rest-framework and the django-rest-framework-jwt lib for JWT based authentication. The apache server is ver 2.2 with mod_wsgi. This is all running on an ubuntu 12.04 instance (python 2.7). Working case with manage.py runserver on localhost: # manage.py runserver is running curl -s -X POST \ -d '{"username":"test@test.com", "password":}' \ http:/

Flask, mod_wsgi, and Apache: ImportError

一曲冷凌霜 提交于 2019-12-04 03:11:56
I'm getting this in my error logs: ImportError: No module named flask It looks exactly like in Django + mod_wsgi + apache: ImportError at / No module named djproj.urls , but I tried that solution, and it doesn't seem to work... I am correctly inserting the app home and parent folder into the system path, but this error is still coming up. Navigating to my page still brings up the 500 page. More information: I'm using Amazon EC2 free tier, with Apache in the form of httpd. Everything is installed correctly, I'm pretty sure... Here's my stuff (app name badassery and app home folder name hatemail

Can't load mod_wsgi compiled for Python 3

℡╲_俬逩灬. 提交于 2019-12-04 02:13:26
问题 I'm on CentOS and trying to configure Apache to use mod_wsgi compiled against Anaconda Python 3.5. Compiling mod_wsgi seems to go OK: sudo yum install httpd-devel sudo ./configure --with-python=/opt/anaconda/anaconda3/bin/python sudo make ls -l /etc/httpd/modules/mod_wsgi.so -rwxr-xr-x. 1 root root 702205 Mar 2 23:12 /etc/httpd/modules/mod_wsgi.so But when I start the web server it can't seem to find its libraries: sudo service httpd start Starting httpd: httpd: Syntax error on line 221 of

Deploying Django on Apache2 with mod_wsgi - Correct location for Django project?

天大地大妈咪最大 提交于 2019-12-03 21:29:05
I am trying to deploy my first Django project on my webserver. I am both new to server configuration and Django so I have a hard time finding my errors. In most tutorials I have seen online, the Django project on the production server is created in /var/www/myproject - however, the Django documentation recommends putting the code outside of /var/www/ for security reasons (see: https://docs.djangoproject.com/en/1.9/intro/tutorial01/ ). So, I put my Django project in a subdirectory of my home folder, which is not accessible to Apache. I added no file to /var/www as no tutorial mentions that this

Variable will be instantiated more than once

爷,独闯天下 提交于 2019-12-03 17:17:59
I got something unusual when developing a small web server using Python2.7+Apache+mod_wsgi . The main usage of this server is: Receiving regular requests from another server(server A), and put the request body into DB. Using some background threads to parse the request body in DB and send the parsed information to a third server(server B). Apache is configured as Windows 'winnt' MPM mode. Code of dispatch.py, which is the entry point, is like below: from urlparse import parse_qs pool = MyThreadClass() # A customized thread class to parse request body in DB pool.start() def application(environ,

webapp2 under Apache (= without Google App Engine)

痞子三分冷 提交于 2019-12-03 16:46:11
I am trying to run webapp2 under Python with Apache and mod_wsgi - specifically: Wampserver for Windows 7 with Apache 2.2.22. So far, I have failed miserably. :-( I used the following example from https://developers.google.com/appengine/docs/python/gettingstartedpython27/usingwebapp : import webapp2 class MainPage(webapp2.RequestHandler): def get(self): self.response.headers['Content-Type'] = 'text/plain' self.response.out.write('Hello, webapp World!') app = webapp2.WSGIApplication([('/', MainPage)], debug=True) When I save this file as c:wamp\www\Python\hello.py , and browse to localhost

django file upload: [Errno 13] Permission denied: '/static'

こ雲淡風輕ζ 提交于 2019-12-03 14:31:42
I am trying to upload several files in django. On my local maching where I use the djangos build in server everything works fine but on my productivity server I get this error: [Errno 13] Permission denied: '/static' There are many questions about this issue but nothing I found worked for me. In my case it has nothing to do with file permissions. I found out that the problem is that django want save the files in the root folder of my filesystem and not in the root folder of my website. If I create the folder in '/static' the files will be created there but images for example are not shown on

mod_wsgi.so for windows 7 64 bit?

拟墨画扇 提交于 2019-12-03 14:02:38
问题 Where can I get mod_wsgi.so for windows 7 64 bit? I have researched around and all point me to http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi But there is no mod_wsgi.so I found another link https://code.google.com/p/modwsgi/downloads/detail?name=mod_wsgi-win32-ap22py27-3.3.so But I am not sure whether it can be trusted or not. Besides it seems that it is for 32 bit. Any ideas? 回答1: If you had read the Google Code page and followed the link you would have found this, which includes

Django + WSGI: Refreshing Issues?

痴心易碎 提交于 2019-12-03 13:39:54
I'm developing a Django site. I'm making all my changes on the live server, just because it's easier that way. The problem is, every now and then it seems to like to cache one of the *.py files I'm working on. Sometimes if I hit refresh a lot, it will switch back and forth between an older version of the page, and a newer version. My set up is more or less like what's described in the Django tutorials: http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/#howto-deployment-modwsgi I'm guessing it's doing this because it's firing up multiple instances of of the WSGI handler, and

Code change monitoring malfunctioning with Django 1.7 on mod-wsgi

ぃ、小莉子 提交于 2019-12-03 13:10:44
问题 This is an issue that I've encountered on all my sites that are running Django 1.7 in mod_wsgi. The nub of the issue is that if, while developing locally, I introduce a fatal error into the codebase, and then subsequently correct it, the code monitoring script doesn't detect the correction. I use Graham Dumpleton's monitor.py script to detect changes to the codebase when I'm developing locally (I use apache rather than the Django development server). It always used to work in Django <= 1.6,