skip to Main Content

I have ran published default django project and it was working fine, I was able to access it with domain name then I just replaced the details for saleor and now I am getting 404 not found. Here is my conf file:

<VirtualHost *:80>

    ServerAdmin [email protected]
    DocumentRoot /home/ubuntu/ecom

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined


    Alias /static /home/ubuntu/ecom/saleor/saleor/static
    <Directory /home/ubuntu/ecom/saleor/saleor/static>
        Require all granted
    </Directory>

    <Directory /home/ubuntu/ecom/saleor/saleor/wsgi>
        <Files __init__.py>
            Require all granted
        </Files>
    </Directory>

    WSGIDaemonProcess myproject2 python-home=/home/ubuntu/ecom/ecom python-path=/home/ubuntu/ecom
    WSGIProcessGroup myproject2
    WSGIScriptAlias / /home/ubuntu/ecom/saleor/saleor/wsgi/__init__.py
</VirtualHost>

Here /home/ubuntu/ecom is my project main dir and it contains ecom (virtual env) and saleor folders.
I have added glintwear.com my domain in settings.py file of saleor project

EDIT
Here is error from error.log file:

[Wed Aug 15 01:09:17.240064 2018] [wsgi:error] [pid 14328:tid 140275526600448] [remote 39.53.22.238:27753] mod_wsgi (pid=14328): Target WSGI script '/home/ubuntu/ecom/$
[Wed Aug 15 01:09:17.240110 2018] [wsgi:error] [pid 14328:tid 140275526600448] [remote 39.53.22.238:27753] mod_wsgi (pid=14328): Exception occurred processing WSGI scr$
[Wed Aug 15 01:09:17.240269 2018] [wsgi:error] [pid 14328:tid 140275526600448] [remote 39.53.22.238:27753] Traceback (most recent call last):
[Wed Aug 15 01:09:17.240291 2018] [wsgi:error] [pid 14328:tid 140275526600448] [remote 39.53.22.238:27753]   File "/home/ubuntu/ecom/saleor/saleor/wsgi/__init__.py", l$
[Wed Aug 15 01:09:17.240296 2018] [wsgi:error] [pid 14328:tid 140275526600448] [remote 39.53.22.238:27753]     from django.core.wsgi import get_wsgi_application  # noqa
[Wed Aug 15 01:09:17.240310 2018] [wsgi:error] [pid 14328:tid 140275526600448] [remote 39.53.22.238:27753] ImportError: No module named 'django'

2

Answers


  1. Chosen as BEST ANSWER

    So I am answering this question if someone else has a problem. This project was on hold and that is why I am updating it this late. Anyways the issue is that python-home should point to your root directory where your manage.py is located. And python-path should point to your virtualenv folder. Thats is.

    <VirtualHost *:80>
    
        ServerAdmin [email protected]
        DocumentRoot /home/ubuntu/ecom
    
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    
    
        Alias /static /home/ubuntu/ecom/saleor/saleor/static
        <Directory /home/ubuntu/ecom/saleor/saleor/static>
            Require all granted
        </Directory>
    
        <Directory /home/ubuntu/ecom/saleor/saleor/wsgi>
            <Files __init__.py>
                Require all granted
            </Files>
        </Directory>
    
        WSGIDaemonProcess myproject2 python-home=/home/ubuntu/ecom/ecom/saleor python-path=/home/ubuntu/ecom/env
        WSGIProcessGroup myproject2
        WSGIScriptAlias / /home/ubuntu/ecom/saleor/saleor/wsgi/__init__.py
    </VirtualHost>
    

  2. EDIT:

    As pointed out by @Graham Dumpleton you have to change your

    python-home=/home/ubuntu/ecom/ecom
    

    Which is not the path to your virtual enviroment.

    Check that directory given to python-home is the same as sys.prefix
    for the virtual environment.

    So you should have something like this:

    python-home=/home/ubuntu/ecom/venv
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search