If you use:

    pip install -U 
https://github.com/GrahamDumpleton/mod_wsgi/archive/develop.zip 
<https://github.com/GrahamDumpleton/mod_wsgi/archive/develop.zip>

it will tell me if that corrects things for Django 1.7.

Thanks.

Graham

> On 17 Dec 2016, at 2:27 PM, Graham Dumpleton <graham.dumple...@gmail.com> 
> wrote:
> 
> It is because I am idiot and can’t write code:
> 
> diff --git a/src/server/management/commands/runmodwsgi.py 
> b/src/server/management/commands/runmodwsgi.py
> index 74eaf13..fe182d6 100644
> --- a/src/server/management/commands/runmodwsgi.py
> +++ b/src/server/management/commands/runmodwsgi.py
> @@ -18,7 +18,7 @@ class Command(BaseCommand):
>      args = ''
>      help = 'Starts Apache/mod_wsgi web server.'
> 
> -    if hasattr('BaseCommand', 'option_list'):
> +    if hasattr(BaseCommand, 'option_list'):
>          # Used prior to Django 1.10.
> 
>          option_list = BaseCommand.option_list + mod_wsgi.server.option_list
> 
> 
> Am not even sure why it was working for 1.8-1.9.
> 
> Will try and make a release later.
> 
> Graham
> 
>> On 17 Dec 2016, at 10:38 AM, Graham Dumpleton <graham.dumple...@gmail.com 
>> <mailto:graham.dumple...@gmail.com>> wrote:
>> 
>> I'll try and look at Django 1.7 this weekend. Was too busy last few days 
>> finishing up stuff before holidays.
>> 
>> Graham
>> 
>> On 17 Dec 2016, at 10:10, Peter Andrews <pandr...@alumni.brown.edu 
>> <mailto:pandr...@alumni.brown.edu>> wrote:
>> 
>>> Thank you for your response.
>>> 
>>> Adding an extra dirname to BASE_DIR did get it to work with Django 1.8. 
>>> Gives us an incentive to upgrade (I just joined the project...)
>>> 
>>> I still do not know how to get it to work with Django 1.7.x (I tried with 
>>> the final 1.7.x, 1.7.11) -- it is still getting keyError['host']
>>> 
>>> On Thu, Dec 15, 2016 at 9:07 PM, Graham Dumpleton 
>>> <graham.dumple...@gmail.com <mailto:graham.dumple...@gmail.com>> wrote:
>>> Do you have a BASE_DIR setting in your Django settings file?
>>> 
>>> If you have come from an old Django version you may not have it.
>>> 
>>> When it isn’t present then runmodwsgi has to make some guesses about where 
>>> your project root is and that can be wrong if you have reorganised your 
>>> settings file to be more than the normal single level as you appear to have 
>>> done.
>>> 
>>> Add to your Django settings module:
>>> 
>>> import os
>>> BASE_DIR = os.path.dirname(os.path.dirname(__file__))
>>> 
>>> but change it so that BASE_DIR works out as the directory above that 
>>> containing your project such that importing the package for the project 
>>> will work.
>>> 
>>> Likely you want:
>>> 
>>> import os
>>> BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
>>> 
>>> Graham
>>> 
>>> 
>>>> On 16 Dec 2016, at 1:01 PM, Peter Andrews <pandr...@alumni.brown.edu 
>>>> <mailto:pandr...@alumni.brown.edu>> wrote:
>>>> 
>>>> As you suspected it gets further with Django 1.8 (upgraded temporariliy 
>>>> for testing) but still has a problem. It is possible that this is an 
>>>> artifact of the upgrade. Tomorrow at work I will uninstall and reinstall 
>>>> the mod_wsgi-httpd and mod_wsgi with Django 1.8 already installed in case 
>>>> it makes a difference.
>>>> 
>>>> (venv) vagrant@production24:/rmove/server$ python manage.py runmodwsgi 
>>>> --log-to-terminal --settings mobilesurvey.settings.dev_pca
>>>> /rmove/venv/lib/python2.7/site-packages/crispy_forms/utils.py:25: 
>>>> RemovedInDjango19Warning: memoize wrapper is deprecated and will be 
>>>> removed in Django 1.9. Use django.utils.lru_cache instead.
>>>>   default_field_template = memoize(default_field_template, {}, 1)
>>>> 
>>>> Successfully ran command.
>>>> Server URL         : http://localhost:8000/ <http://localhost:8000/>
>>>> Server Root        : /tmp/mod_wsgi-localhost:8000:1000
>>>> Server Conf        : /tmp/mod_wsgi-localhost:8000:1000/httpd.conf
>>>> Error Log File     : /dev/stderr (warn)
>>>> Request Capacity   : 5 (1 process * 5 threads)
>>>> Request Timeout    : 60 (seconds)
>>>> Startup Timeout    : 15 (seconds)
>>>> Queue Backlog      : 100 (connections)
>>>> Queue Timeout      : 45 (seconds)
>>>> Server Capacity    : 20 (event/worker), 20 (prefork)
>>>> Server Backlog     : 500 (connections)
>>>> Locale Setting     : en_US.UTF-8
>>>> [Fri Dec 16 01:47:23.868572 2016] [mpm_event:notice] [pid 5603:tid 
>>>> 140388886972224] AH00489: Apache/2.4.23 (Unix) mod_wsgi/4.5.10 Python/2.7 
>>>> configured -- resuming normal operations
>>>> [Fri Dec 16 01:47:23.869383 2016] [core:notice] [pid 5603:tid 
>>>> 140388886972224] AH00094: Command line: 'httpd (mod_wsgi-express)   -f 
>>>> /tmp/mod_wsgi-localhost:8000:1000/httpd.conf -D 
>>>> MOD_WSGI_MPM_ENABLE_EVENT_MODULE -D MOD_WSGI_MPM_EXISTS_EVENT_MODULE -D 
>>>> MOD_WSGI_MPM_EXISTS_WORKER_MODULE -D MOD_WSGI_MPM_EXISTS_PREFORK_MODULE -D 
>>>> FOREGROUND'
>>>> [Fri Dec 16 01:47:26.770793 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224] mod_wsgi (pid=5612): Target WSGI script 
>>>> '/tmp/mod_wsgi-localhost:8000:1000/handler.wsgi' cannot be loaded as 
>>>> Python module.
>>>> [Fri Dec 16 01:47:26.771892 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224] mod_wsgi (pid=5612): Exception occurred processing WSGI 
>>>> script '/tmp/mod_wsgi-localhost:8000:1000/handler.wsgi'.
>>>> [Fri Dec 16 01:47:26.772134 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224] Traceback (most recent call last):
>>>> [Fri Dec 16 01:47:26.772377 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]   File "/tmp/mod_wsgi-localhost:8000:1000/handler.wsgi", 
>>>> line 94, in <module>
>>>> [Fri Dec 16 01:47:26.772636 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]     recorder_directory=recorder_directory)
>>>> [Fri Dec 16 01:47:26.772852 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]   File 
>>>> "/rmove/venv/lib/python2.7/site-packages/mod_wsgi/server/__init__.py", 
>>>> line 1390, in __init__
>>>> [Fri Dec 16 01:47:26.777427 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]     exec(code, self.module.__dict__)
>>>> [Fri Dec 16 01:47:26.777703 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]   File "/rmove/server/conf/2_4/wsgi.py", line 15, in 
>>>> <module>
>>>> [Fri Dec 16 01:47:26.779935 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]     application = get_wsgi_application()
>>>> [Fri Dec 16 01:47:26.780138 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]   File 
>>>> "/rmove/venv/lib/python2.7/site-packages/django/core/wsgi.py", line 14, in 
>>>> get_wsgi_application
>>>> [Fri Dec 16 01:47:26.782617 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]     django.setup()
>>>> [Fri Dec 16 01:47:26.782860 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]   File 
>>>> "/rmove/venv/lib/python2.7/site-packages/django/__init__.py", line 17, in 
>>>> setup
>>>> [Fri Dec 16 01:47:26.784929 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]     configure_logging(settings.LOGGING_CONFIG, 
>>>> settings.LOGGING)
>>>> [Fri Dec 16 01:47:26.785208 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]   File 
>>>> "/rmove/venv/lib/python2.7/site-packages/django/conf/__init__.py", line 
>>>> 48, in __getattr__
>>>> [Fri Dec 16 01:47:26.788301 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]     self._setup(name)
>>>> [Fri Dec 16 01:47:26.788556 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]   File 
>>>> "/rmove/venv/lib/python2.7/site-packages/django/conf/__init__.py", line 
>>>> 44, in _setup
>>>> [Fri Dec 16 01:47:26.789697 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]     self._wrapped = Settings(settings_module)
>>>> [Fri Dec 16 01:47:26.789995 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]   File 
>>>> "/rmove/venv/lib/python2.7/site-packages/django/conf/__init__.py", line 
>>>> 92, in __init__
>>>> [Fri Dec 16 01:47:26.791282 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]     mod = importlib.import_module(self.SETTINGS_MODULE)
>>>> [Fri Dec 16 01:47:26.791535 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]   File "/usr/lib/python2.7/importlib/__init__.py", line 
>>>> 37, in import_module
>>>> [Fri Dec 16 01:47:26.791824 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224]     __import__(name)
>>>> [Fri Dec 16 01:47:26.792094 2016] [wsgi:error] [pid 5612:tid 
>>>> 140388886972224] ImportError: No module named mobilesurvey.settings.dev_pca
>>>> 
>>>> 
>>>> On Thu, Dec 15, 2016 at 6:44 PM, Graham Dumpleton 
>>>> <graham.dumple...@gmail.com <mailto:graham.dumple...@gmail.com>> wrote:
>>>> I’ll have to do some tests. I haven’t ever tested with such an old Django 
>>>> version.
>>>> 
>>>> Graham
>>>> 
>>>>> On 16 Dec 2016, at 10:30 AM, Peter Andrews <pandr...@alumni.brown.edu 
>>>>> <mailto:pandr...@alumni.brown.edu>> wrote:
>>>>> 
>>>>> Graham - thanks for providing such great tools!
>>>>> 
>>>>> I am running Vagrant on Windows 10.
>>>>> 
>>>>> I have an existing Python Django 1.7 application which works fine on a 
>>>>> server-level apache instance or via manage.py runserver
>>>>> 
>>>>> I followed instructions from Graham's post: 
>>>>> http://blog.dscpl.com.au/2015/04/integrating-modwsgi-express-as-django.html
>>>>>  
>>>>> <http://blog.dscpl.com.au/2015/04/integrating-modwsgi-express-as-django.html>
>>>>>  and installed mod_wsgi-httpd and then mod_wsgi within my activated 
>>>>> virtual environment
>>>>> 
>>>>> My modules:
>>>>> 
>>>>> $ pip freeze
>>>>> Django==1.7.1
>>>>> django-crispy-forms==1.4.0
>>>>> django-debug-toolbar==1.4
>>>>> django-reversion==1.10.0
>>>>> EasyProcess==0.2.2
>>>>> funcsigs==1.0.2
>>>>> mock==2.0.0
>>>>> mod-wsgi==4.5.10
>>>>> mod-wsgi-httpd==2.4.23.2
>>>>> pbr==1.10.0
>>>>> psycopg2==2.5.4
>>>>> pytz==2015.2
>>>>> PyVirtualDisplay==0.2
>>>>> PyYAML==3.11
>>>>> selenium==2.53.6
>>>>> six==1.10.0
>>>>> sqlparse==0.1.19
>>>>> ua-parser==0.3.6
>>>>> user-agents==0.3.2
>>>>> (venv) vagrant@production24:/rmove/server$
>>>>> 
>>>>> I get this error:
>>>>> 
>>>>> (venv) vagrant@production24:/rmove/server$ python manage.py runmodwsgi
>>>>> Successfully ran command.
>>>>> Traceback (most recent call last):
>>>>>   File "manage.py", line 10, in <module>
>>>>>     execute_from_command_line(sys.argv)
>>>>>   File 
>>>>> "/rmove/venv/lib/python2.7/site-packages/django/core/management/__init__.py",
>>>>>  line 385, in execute_from_command_line
>>>>>     utility.execute()
>>>>>   File 
>>>>> "/rmove/venv/lib/python2.7/site-packages/django/core/management/__init__.py",
>>>>>  line 377, in execute
>>>>>     self.fetch_command(subcommand).run_from_argv(self.argv)
>>>>>   File 
>>>>> "/rmove/venv/lib/python2.7/site-packages/django/core/management/base.py", 
>>>>> line 288, in run_from_argv
>>>>>     self.execute(*args, **options.__dict__)
>>>>>   File 
>>>>> "/rmove/venv/lib/python2.7/site-packages/django/core/management/base.py", 
>>>>> line 338, in execute
>>>>>     output = self.handle(*args, **options)
>>>>>   File 
>>>>> "/rmove/venv/lib/python2.7/site-packages/mod_wsgi/server/management/commands/runmodwsgi.py",
>>>>>  line 108, in handle
>>>>>     'start-server', args, options)
>>>>>   File 
>>>>> "/rmove/venv/lib/python2.7/site-packages/mod_wsgi/server/__init__.py", 
>>>>> line 2587, in _cmd_setup_server
>>>>>     if not options['host']:
>>>>> KeyError: 'host'
>>>>> 
>>>>> 
>>>>> mod_wsgi-express is in high spirits: 'My web site runs on Malt Whiskey(:'
>>>>> (venv) vagrant@production24:/rmove/server$ mod_wsgi-express start-server
>>>>> Server URL         : http://localhost:8000/ <http://localhost:8000/>
>>>>> Server Root        : /tmp/mod_wsgi-localhost:8000:1000
>>>>> Server Conf        : /tmp/mod_wsgi-localhost:8000:1000/httpd.conf
>>>>> Error Log File     : /tmp/mod_wsgi-localhost:8000:1000/error_log (warn)
>>>>> Request Capacity   : 5 (1 process * 5 threads)
>>>>> Request Timeout    : 60 (seconds)
>>>>> Startup Timeout    : 15 (seconds)
>>>>> Queue Backlog      : 100 (connections)
>>>>> Queue Timeout      : 45 (seconds)
>>>>> Server Capacity    : 20 (event/worker), 20 (prefork)
>>>>> Server Backlog     : 500 (connections)
>>>>> Locale Setting     : en_US.UTF-8
>>>>> 
>>>>> 
>>>>> Thanks for any help you can provide.
>>>>> 
>>>>> 
>>>>> 
>>>>> -- 
>>>>> You received this message because you are subscribed to the Google Groups 
>>>>> "modwsgi" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>>>> email to modwsgi+unsubscr...@googlegroups.com 
>>>>> <mailto:modwsgi+unsubscr...@googlegroups.com>.
>>>>> To post to this group, send email to modwsgi@googlegroups.com 
>>>>> <mailto:modwsgi@googlegroups.com>.
>>>>> Visit this group at https://groups.google.com/group/modwsgi 
>>>>> <https://groups.google.com/group/modwsgi>.
>>>>> For more options, visit https://groups.google.com/d/optout 
>>>>> <https://groups.google.com/d/optout>.
>>>> 
>>>> 
>>>> -- 
>>>> You received this message because you are subscribed to the Google Groups 
>>>> "modwsgi" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>>> email to modwsgi+unsubscr...@googlegroups.com 
>>>> <mailto:modwsgi+unsubscr...@googlegroups.com>.
>>>> To post to this group, send email to modwsgi@googlegroups.com 
>>>> <mailto:modwsgi@googlegroups.com>.
>>>> Visit this group at https://groups.google.com/group/modwsgi 
>>>> <https://groups.google.com/group/modwsgi>.
>>>> For more options, visit https://groups.google.com/d/optout 
>>>> <https://groups.google.com/d/optout>.
>>>> 
>>>> 
>>>> -- 
>>>> You received this message because you are subscribed to the Google Groups 
>>>> "modwsgi" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>>> email to modwsgi+unsubscr...@googlegroups.com 
>>>> <mailto:modwsgi+unsubscr...@googlegroups.com>.
>>>> To post to this group, send email to modwsgi@googlegroups.com 
>>>> <mailto:modwsgi@googlegroups.com>.
>>>> Visit this group at https://groups.google.com/group/modwsgi 
>>>> <https://groups.google.com/group/modwsgi>.
>>>> For more options, visit https://groups.google.com/d/optout 
>>>> <https://groups.google.com/d/optout>.
>>> 
>>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "modwsgi" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to modwsgi+unsubscr...@googlegroups.com 
>>> <mailto:modwsgi+unsubscr...@googlegroups.com>.
>>> To post to this group, send email to modwsgi@googlegroups.com 
>>> <mailto:modwsgi@googlegroups.com>.
>>> Visit this group at https://groups.google.com/group/modwsgi 
>>> <https://groups.google.com/group/modwsgi>.
>>> For more options, visit https://groups.google.com/d/optout 
>>> <https://groups.google.com/d/optout>.
>>> 
>>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "modwsgi" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to modwsgi+unsubscr...@googlegroups.com 
>>> <mailto:modwsgi+unsubscr...@googlegroups.com>.
>>> To post to this group, send email to modwsgi@googlegroups.com 
>>> <mailto:modwsgi@googlegroups.com>.
>>> Visit this group at https://groups.google.com/group/modwsgi 
>>> <https://groups.google.com/group/modwsgi>.
>>> For more options, visit https://groups.google.com/d/optout 
>>> <https://groups.google.com/d/optout>.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to