Django, mod_wsgi, pyvenv-3.4 - configurationDjango WSGI segfaults when importing setproctitle moduleRe: How...

Why is there an extra space when I type "ls" on the Desktop?

How to make sure I'm assertive enough in contact with subordinates?

What is the purpose of a disclaimer like "this is not legal advice"?

Rationale to prefer local variables over instance variables?

What would be the most expensive material to an intergalactic society?

Is the differential, dp, exact or not?

How to recover against Snake as a heavyweight character?

What exactly is the meaning of "fine wine"?

Where is the License file location for Identity Server in Sitecore 9.1?

Did Amazon pay $0 in taxes last year?

What does *dead* mean in *What do you mean, dead?*?

What is 'Log Memory' in Query Store 2017

Will the concrete slab in a partially heated shed conduct a lot of heat to the unconditioned area?

Why do we call complex numbers “numbers” but we don’t consider 2-vectors numbers?

Tabular environment - text vertically positions itself by bottom of tikz picture in adjacent cell

Should we avoid writing fiction about historical events without extensive research?

Why does a car's steering wheel get lighter with increasing speed

Ultrafilters as a double dual

Is it appropriate to ask a former professor to order a library book for me through ILL?

What is the orbit and expected lifetime of Crew Dragon trunk?

Do I need a return ticket to Canada if I'm a Japanese National?

Inorganic chemistry handbook with reaction lists

Was this cameo in Captain Marvel computer generated?

What the error in writing this equation by latex?



Django, mod_wsgi, pyvenv-3.4 - configuration


Django WSGI segfaults when importing setproctitle moduleRe: How can Django/WSGI and PHP share / on Apache?Setting environment variables in mod_wsgi for DjangoPython eggs are not imported for Apache2 mod_wsgiCannot run mod_wsgi on Apache 2.4 x64 WindowsDjango 1.10.3 Apache wsgi - ImportError: cannot import name signalsDjango with Apache and mod_wsgi: no system log unless setting Debug = TrueDjango site running in Apache 2.4.6 on Centos giving 503 server errorError when trying install mod_wsgi using pipGetting Mod_WSGI Error: Deploying Flask Application to ElasticBeanstlk













0















I'm trying to deploy my first, simple django website. I have an VPS with Ubuntu 14.07 Server, Apache 2.4.7 with mod_wsgi.
So, i added this vhost:



<VirtualHost *:80>
ServerName api.XXX.net
ServerAdmin webmaster@XXX.net
DocumentRoot /var/www/XXX.net/api
WSGIScriptAlias / /var/www/XXX.net/api/backgrounds-apps-server/XXX/index.wsgi

WSGIDaemonProcess api.XXX.net processes=2 threads=15 python-path=/var/www/XXX.net/api:/var/www/XXX.net/api/lib/python3.4/site-packages
WSGIProcessGroup api.XXX.net

<Directory /var/www/XXX.net/api/backgrounds-apps-server>
Order allow,deny
Allow from all
</Directory>

Alias /static/ /var/www/XXX.net/api/backgrounds-apps-server/XXX/static/
<Location "/static/">
Options -Indexes
</Location>

LogLevel info

ErrorLog ${APACHE_LOG_DIR}/api_XXX_error.log
CustomLog ${APACHE_LOG_DIR}/api_XXX_access.log combined
</VirtualHost>


and my index.wsgi:



import os, sys, site

# Add the site-packages of the chosen virtualenv to work with
site.addsitedir('/var/www/XXX.net/api/lib/python3.4/site-packages')

# Add the app's directory to the PYTHONPATH
sys.path.append('/var/www/XXX.net/api/backgrounds-apps-server')
sys.path.append('/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "movies_wallpaper.settings")

#Activate your virtual environment

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()


But when I'm trying to load the page I'm getting 500 Error. In apache log we can see this:



[Mon Oct 06 16:27:42.625220 2014] [:info] [pid 3050] mod_wsgi (pid=3050): Adding '/var/www/XXX.net/api' to path.
[Mon Oct 06 16:27:42.625433 2014] [:info] [pid 3050] mod_wsgi (pid=3050): Adding '/var/www/XXX.net/api/lib/python3.4/site-packages' to path.
[Mon Oct 06 16:27:42.626344 2014] [:info] [pid 3050] [remote 188.121.29.164:61055] mod_wsgi (pid=3050, process='api.XXX.net', application='api.XXX.net|'): Loading WSGI script '/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/index.wsgi'.
[Mon Oct 06 14:27:43.418048 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] mod_wsgi (pid=3050): Target WSGI script '/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/index.wsgi' cannot be loaded as Python module.
[Mon Oct 06 14:27:43.418082 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] mod_wsgi (pid=3050): Exception occurred processing WSGI script '/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/index.wsgi'.
[Mon Oct 06 14:27:43.418106 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] Traceback (most recent call last):
[Mon Oct 06 14:27:43.418128 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/index.wsgi", line 14, in <module>
[Mon Oct 06 14:27:43.418189 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] application = get_wsgi_application()
[Mon Oct 06 14:27:43.418201 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
[Mon Oct 06 14:27:43.418243 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] django.setup()
[Mon Oct 06 14:27:43.418254 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/django/__init__.py", line 21, in setup
[Mon Oct 06 14:27:43.418295 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] apps.populate(settings.INSTALLED_APPS)
[Mon Oct 06 14:27:43.418307 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/django/apps/registry.py", line 108, in populate
[Mon Oct 06 14:27:43.418444 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] app_config.import_models(all_models)
[Mon Oct 06 14:27:43.418457 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/django/apps/config.py", line 197, in import_models
[Mon Oct 06 14:27:43.418552 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] self.models_module = import_module(models_module_name)
[Mon Oct 06 14:27:43.418564 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
[Mon Oct 06 14:27:43.418611 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] __import__(name)
[Mon Oct 06 14:27:43.418621 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/movies/models.py", line 6, in <module>
[Mon Oct 06 14:27:43.418682 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] from easy_thumbnails.fields import ThumbnailerImageField
[Mon Oct 06 14:27:43.418694 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/easy_thumbnails/fields.py", line 2, in <module>
[Mon Oct 06 14:27:43.418759 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] from easy_thumbnails import files
[Mon Oct 06 14:27:43.418783 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/easy_thumbnails/files.py", line 14, in <module>
[Mon Oct 06 14:27:43.419070 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] from easy_thumbnails import engine, exceptions, models, utils, signals, storage
[Mon Oct 06 14:27:43.419086 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/easy_thumbnails/engine.py", line 10, in <module>
[Mon Oct 06 14:27:43.419155 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] import Image
[Mon Oct 06 14:27:43.419176 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] ImportError: No module named Image


Pillow is installed in virtual environment (pyvenv-3.4) and under idle python3.4 works fine.



Can someone tell me what is wrong with my configuration?










share|improve this question
















bumped to the homepage by Community 9 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    0















    I'm trying to deploy my first, simple django website. I have an VPS with Ubuntu 14.07 Server, Apache 2.4.7 with mod_wsgi.
    So, i added this vhost:



    <VirtualHost *:80>
    ServerName api.XXX.net
    ServerAdmin webmaster@XXX.net
    DocumentRoot /var/www/XXX.net/api
    WSGIScriptAlias / /var/www/XXX.net/api/backgrounds-apps-server/XXX/index.wsgi

    WSGIDaemonProcess api.XXX.net processes=2 threads=15 python-path=/var/www/XXX.net/api:/var/www/XXX.net/api/lib/python3.4/site-packages
    WSGIProcessGroup api.XXX.net

    <Directory /var/www/XXX.net/api/backgrounds-apps-server>
    Order allow,deny
    Allow from all
    </Directory>

    Alias /static/ /var/www/XXX.net/api/backgrounds-apps-server/XXX/static/
    <Location "/static/">
    Options -Indexes
    </Location>

    LogLevel info

    ErrorLog ${APACHE_LOG_DIR}/api_XXX_error.log
    CustomLog ${APACHE_LOG_DIR}/api_XXX_access.log combined
    </VirtualHost>


    and my index.wsgi:



    import os, sys, site

    # Add the site-packages of the chosen virtualenv to work with
    site.addsitedir('/var/www/XXX.net/api/lib/python3.4/site-packages')

    # Add the app's directory to the PYTHONPATH
    sys.path.append('/var/www/XXX.net/api/backgrounds-apps-server')
    sys.path.append('/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper')
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "movies_wallpaper.settings")

    #Activate your virtual environment

    from django.core.wsgi import get_wsgi_application
    application = get_wsgi_application()


    But when I'm trying to load the page I'm getting 500 Error. In apache log we can see this:



    [Mon Oct 06 16:27:42.625220 2014] [:info] [pid 3050] mod_wsgi (pid=3050): Adding '/var/www/XXX.net/api' to path.
    [Mon Oct 06 16:27:42.625433 2014] [:info] [pid 3050] mod_wsgi (pid=3050): Adding '/var/www/XXX.net/api/lib/python3.4/site-packages' to path.
    [Mon Oct 06 16:27:42.626344 2014] [:info] [pid 3050] [remote 188.121.29.164:61055] mod_wsgi (pid=3050, process='api.XXX.net', application='api.XXX.net|'): Loading WSGI script '/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/index.wsgi'.
    [Mon Oct 06 14:27:43.418048 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] mod_wsgi (pid=3050): Target WSGI script '/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/index.wsgi' cannot be loaded as Python module.
    [Mon Oct 06 14:27:43.418082 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] mod_wsgi (pid=3050): Exception occurred processing WSGI script '/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/index.wsgi'.
    [Mon Oct 06 14:27:43.418106 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] Traceback (most recent call last):
    [Mon Oct 06 14:27:43.418128 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/index.wsgi", line 14, in <module>
    [Mon Oct 06 14:27:43.418189 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] application = get_wsgi_application()
    [Mon Oct 06 14:27:43.418201 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
    [Mon Oct 06 14:27:43.418243 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] django.setup()
    [Mon Oct 06 14:27:43.418254 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/django/__init__.py", line 21, in setup
    [Mon Oct 06 14:27:43.418295 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] apps.populate(settings.INSTALLED_APPS)
    [Mon Oct 06 14:27:43.418307 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/django/apps/registry.py", line 108, in populate
    [Mon Oct 06 14:27:43.418444 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] app_config.import_models(all_models)
    [Mon Oct 06 14:27:43.418457 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/django/apps/config.py", line 197, in import_models
    [Mon Oct 06 14:27:43.418552 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] self.models_module = import_module(models_module_name)
    [Mon Oct 06 14:27:43.418564 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    [Mon Oct 06 14:27:43.418611 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] __import__(name)
    [Mon Oct 06 14:27:43.418621 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/movies/models.py", line 6, in <module>
    [Mon Oct 06 14:27:43.418682 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] from easy_thumbnails.fields import ThumbnailerImageField
    [Mon Oct 06 14:27:43.418694 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/easy_thumbnails/fields.py", line 2, in <module>
    [Mon Oct 06 14:27:43.418759 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] from easy_thumbnails import files
    [Mon Oct 06 14:27:43.418783 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/easy_thumbnails/files.py", line 14, in <module>
    [Mon Oct 06 14:27:43.419070 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] from easy_thumbnails import engine, exceptions, models, utils, signals, storage
    [Mon Oct 06 14:27:43.419086 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/easy_thumbnails/engine.py", line 10, in <module>
    [Mon Oct 06 14:27:43.419155 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] import Image
    [Mon Oct 06 14:27:43.419176 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] ImportError: No module named Image


    Pillow is installed in virtual environment (pyvenv-3.4) and under idle python3.4 works fine.



    Can someone tell me what is wrong with my configuration?










    share|improve this question
















    bumped to the homepage by Community 9 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      I'm trying to deploy my first, simple django website. I have an VPS with Ubuntu 14.07 Server, Apache 2.4.7 with mod_wsgi.
      So, i added this vhost:



      <VirtualHost *:80>
      ServerName api.XXX.net
      ServerAdmin webmaster@XXX.net
      DocumentRoot /var/www/XXX.net/api
      WSGIScriptAlias / /var/www/XXX.net/api/backgrounds-apps-server/XXX/index.wsgi

      WSGIDaemonProcess api.XXX.net processes=2 threads=15 python-path=/var/www/XXX.net/api:/var/www/XXX.net/api/lib/python3.4/site-packages
      WSGIProcessGroup api.XXX.net

      <Directory /var/www/XXX.net/api/backgrounds-apps-server>
      Order allow,deny
      Allow from all
      </Directory>

      Alias /static/ /var/www/XXX.net/api/backgrounds-apps-server/XXX/static/
      <Location "/static/">
      Options -Indexes
      </Location>

      LogLevel info

      ErrorLog ${APACHE_LOG_DIR}/api_XXX_error.log
      CustomLog ${APACHE_LOG_DIR}/api_XXX_access.log combined
      </VirtualHost>


      and my index.wsgi:



      import os, sys, site

      # Add the site-packages of the chosen virtualenv to work with
      site.addsitedir('/var/www/XXX.net/api/lib/python3.4/site-packages')

      # Add the app's directory to the PYTHONPATH
      sys.path.append('/var/www/XXX.net/api/backgrounds-apps-server')
      sys.path.append('/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper')
      os.environ.setdefault("DJANGO_SETTINGS_MODULE", "movies_wallpaper.settings")

      #Activate your virtual environment

      from django.core.wsgi import get_wsgi_application
      application = get_wsgi_application()


      But when I'm trying to load the page I'm getting 500 Error. In apache log we can see this:



      [Mon Oct 06 16:27:42.625220 2014] [:info] [pid 3050] mod_wsgi (pid=3050): Adding '/var/www/XXX.net/api' to path.
      [Mon Oct 06 16:27:42.625433 2014] [:info] [pid 3050] mod_wsgi (pid=3050): Adding '/var/www/XXX.net/api/lib/python3.4/site-packages' to path.
      [Mon Oct 06 16:27:42.626344 2014] [:info] [pid 3050] [remote 188.121.29.164:61055] mod_wsgi (pid=3050, process='api.XXX.net', application='api.XXX.net|'): Loading WSGI script '/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/index.wsgi'.
      [Mon Oct 06 14:27:43.418048 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] mod_wsgi (pid=3050): Target WSGI script '/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/index.wsgi' cannot be loaded as Python module.
      [Mon Oct 06 14:27:43.418082 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] mod_wsgi (pid=3050): Exception occurred processing WSGI script '/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/index.wsgi'.
      [Mon Oct 06 14:27:43.418106 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] Traceback (most recent call last):
      [Mon Oct 06 14:27:43.418128 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/index.wsgi", line 14, in <module>
      [Mon Oct 06 14:27:43.418189 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] application = get_wsgi_application()
      [Mon Oct 06 14:27:43.418201 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
      [Mon Oct 06 14:27:43.418243 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] django.setup()
      [Mon Oct 06 14:27:43.418254 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/django/__init__.py", line 21, in setup
      [Mon Oct 06 14:27:43.418295 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] apps.populate(settings.INSTALLED_APPS)
      [Mon Oct 06 14:27:43.418307 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/django/apps/registry.py", line 108, in populate
      [Mon Oct 06 14:27:43.418444 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] app_config.import_models(all_models)
      [Mon Oct 06 14:27:43.418457 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/django/apps/config.py", line 197, in import_models
      [Mon Oct 06 14:27:43.418552 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] self.models_module = import_module(models_module_name)
      [Mon Oct 06 14:27:43.418564 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
      [Mon Oct 06 14:27:43.418611 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] __import__(name)
      [Mon Oct 06 14:27:43.418621 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/movies/models.py", line 6, in <module>
      [Mon Oct 06 14:27:43.418682 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] from easy_thumbnails.fields import ThumbnailerImageField
      [Mon Oct 06 14:27:43.418694 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/easy_thumbnails/fields.py", line 2, in <module>
      [Mon Oct 06 14:27:43.418759 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] from easy_thumbnails import files
      [Mon Oct 06 14:27:43.418783 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/easy_thumbnails/files.py", line 14, in <module>
      [Mon Oct 06 14:27:43.419070 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] from easy_thumbnails import engine, exceptions, models, utils, signals, storage
      [Mon Oct 06 14:27:43.419086 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/easy_thumbnails/engine.py", line 10, in <module>
      [Mon Oct 06 14:27:43.419155 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] import Image
      [Mon Oct 06 14:27:43.419176 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] ImportError: No module named Image


      Pillow is installed in virtual environment (pyvenv-3.4) and under idle python3.4 works fine.



      Can someone tell me what is wrong with my configuration?










      share|improve this question
















      I'm trying to deploy my first, simple django website. I have an VPS with Ubuntu 14.07 Server, Apache 2.4.7 with mod_wsgi.
      So, i added this vhost:



      <VirtualHost *:80>
      ServerName api.XXX.net
      ServerAdmin webmaster@XXX.net
      DocumentRoot /var/www/XXX.net/api
      WSGIScriptAlias / /var/www/XXX.net/api/backgrounds-apps-server/XXX/index.wsgi

      WSGIDaemonProcess api.XXX.net processes=2 threads=15 python-path=/var/www/XXX.net/api:/var/www/XXX.net/api/lib/python3.4/site-packages
      WSGIProcessGroup api.XXX.net

      <Directory /var/www/XXX.net/api/backgrounds-apps-server>
      Order allow,deny
      Allow from all
      </Directory>

      Alias /static/ /var/www/XXX.net/api/backgrounds-apps-server/XXX/static/
      <Location "/static/">
      Options -Indexes
      </Location>

      LogLevel info

      ErrorLog ${APACHE_LOG_DIR}/api_XXX_error.log
      CustomLog ${APACHE_LOG_DIR}/api_XXX_access.log combined
      </VirtualHost>


      and my index.wsgi:



      import os, sys, site

      # Add the site-packages of the chosen virtualenv to work with
      site.addsitedir('/var/www/XXX.net/api/lib/python3.4/site-packages')

      # Add the app's directory to the PYTHONPATH
      sys.path.append('/var/www/XXX.net/api/backgrounds-apps-server')
      sys.path.append('/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper')
      os.environ.setdefault("DJANGO_SETTINGS_MODULE", "movies_wallpaper.settings")

      #Activate your virtual environment

      from django.core.wsgi import get_wsgi_application
      application = get_wsgi_application()


      But when I'm trying to load the page I'm getting 500 Error. In apache log we can see this:



      [Mon Oct 06 16:27:42.625220 2014] [:info] [pid 3050] mod_wsgi (pid=3050): Adding '/var/www/XXX.net/api' to path.
      [Mon Oct 06 16:27:42.625433 2014] [:info] [pid 3050] mod_wsgi (pid=3050): Adding '/var/www/XXX.net/api/lib/python3.4/site-packages' to path.
      [Mon Oct 06 16:27:42.626344 2014] [:info] [pid 3050] [remote 188.121.29.164:61055] mod_wsgi (pid=3050, process='api.XXX.net', application='api.XXX.net|'): Loading WSGI script '/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/index.wsgi'.
      [Mon Oct 06 14:27:43.418048 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] mod_wsgi (pid=3050): Target WSGI script '/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/index.wsgi' cannot be loaded as Python module.
      [Mon Oct 06 14:27:43.418082 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] mod_wsgi (pid=3050): Exception occurred processing WSGI script '/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/index.wsgi'.
      [Mon Oct 06 14:27:43.418106 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] Traceback (most recent call last):
      [Mon Oct 06 14:27:43.418128 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/index.wsgi", line 14, in <module>
      [Mon Oct 06 14:27:43.418189 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] application = get_wsgi_application()
      [Mon Oct 06 14:27:43.418201 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
      [Mon Oct 06 14:27:43.418243 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] django.setup()
      [Mon Oct 06 14:27:43.418254 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/django/__init__.py", line 21, in setup
      [Mon Oct 06 14:27:43.418295 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] apps.populate(settings.INSTALLED_APPS)
      [Mon Oct 06 14:27:43.418307 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/django/apps/registry.py", line 108, in populate
      [Mon Oct 06 14:27:43.418444 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] app_config.import_models(all_models)
      [Mon Oct 06 14:27:43.418457 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/django/apps/config.py", line 197, in import_models
      [Mon Oct 06 14:27:43.418552 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] self.models_module = import_module(models_module_name)
      [Mon Oct 06 14:27:43.418564 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
      [Mon Oct 06 14:27:43.418611 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] __import__(name)
      [Mon Oct 06 14:27:43.418621 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/backgrounds-apps-server/movies_wallpaper/movies/models.py", line 6, in <module>
      [Mon Oct 06 14:27:43.418682 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] from easy_thumbnails.fields import ThumbnailerImageField
      [Mon Oct 06 14:27:43.418694 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/easy_thumbnails/fields.py", line 2, in <module>
      [Mon Oct 06 14:27:43.418759 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] from easy_thumbnails import files
      [Mon Oct 06 14:27:43.418783 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/easy_thumbnails/files.py", line 14, in <module>
      [Mon Oct 06 14:27:43.419070 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] from easy_thumbnails import engine, exceptions, models, utils, signals, storage
      [Mon Oct 06 14:27:43.419086 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] File "/var/www/XXX.net/api/lib/python3.4/site-packages/easy_thumbnails/engine.py", line 10, in <module>
      [Mon Oct 06 14:27:43.419155 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] import Image
      [Mon Oct 06 14:27:43.419176 2014] [:error] [pid 3050] [remote 188.121.29.164:61055] ImportError: No module named Image


      Pillow is installed in virtual environment (pyvenv-3.4) and under idle python3.4 works fine.



      Can someone tell me what is wrong with my configuration?







      python django apache-2.4 mod-wsgi






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 6 '14 at 15:51







      brylcio16

















      asked Oct 6 '14 at 14:47









      brylcio16brylcio16

      85




      85





      bumped to the homepage by Community 9 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 9 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I figure it out by myself - I just installed wrong module. After I installed libapache2-mod-wsgi-py3 it worked ;)






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "2"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f633881%2fdjango-mod-wsgi-pyvenv-3-4-configuration%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I figure it out by myself - I just installed wrong module. After I installed libapache2-mod-wsgi-py3 it worked ;)






            share|improve this answer




























              0














              I figure it out by myself - I just installed wrong module. After I installed libapache2-mod-wsgi-py3 it worked ;)






              share|improve this answer


























                0












                0








                0







                I figure it out by myself - I just installed wrong module. After I installed libapache2-mod-wsgi-py3 it worked ;)






                share|improve this answer













                I figure it out by myself - I just installed wrong module. After I installed libapache2-mod-wsgi-py3 it worked ;)







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Oct 6 '14 at 16:46









                brylcio16brylcio16

                85




                85






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Server Fault!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f633881%2fdjango-mod-wsgi-pyvenv-3-4-configuration%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

                    Список ссавців Італії Природоохоронні статуси | Список |...

                    Українські прізвища Зміст Історичні відомості |...