Run wsgi with apache and django in anaconda environment
I am trying to run a django application with wsgi_mod and apache2. But for some strange reason it cannot import django.
# /etc/apache2/apache2.conf
WSGIDaemonProcess django_apps python-home=/home/swacker/miniconda3/envs/django/
WSGIProcessGroup django_apps
WSGIScriptAlias /koala /var/www/production/Koala/Koala/wsgi.py process-group=django_apps
<Directory /var/www/production/Koala/>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
The application sits in /var/www/production/Koala.
My conda enviromnent is installed in /home/user/miniconda3/envs/django.
I installed wsgi inside the conda environment.
I tried different things, but nothing worked. This is what I did to get wsgi running.
sudo apt-get install libapache2-mod-wsgi
pip install mod_wsgi
conda install -c https://conda.binstar.org/travis uwsgi
It looks like wsgi is just not working with conda environments and I have to use virtualenv?? Wsgi works, I can render a test file just fine.
Though, when I go to localhost/koala
the /var/log/apache2/error.log
shows:
from django.core.wsgi import get_wsgi_application
ImportError: No module named 'django'
I searched a lot, but could not find an answer that addresses this properly.
python django apache2 mod-wsgi
add a comment |
I am trying to run a django application with wsgi_mod and apache2. But for some strange reason it cannot import django.
# /etc/apache2/apache2.conf
WSGIDaemonProcess django_apps python-home=/home/swacker/miniconda3/envs/django/
WSGIProcessGroup django_apps
WSGIScriptAlias /koala /var/www/production/Koala/Koala/wsgi.py process-group=django_apps
<Directory /var/www/production/Koala/>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
The application sits in /var/www/production/Koala.
My conda enviromnent is installed in /home/user/miniconda3/envs/django.
I installed wsgi inside the conda environment.
I tried different things, but nothing worked. This is what I did to get wsgi running.
sudo apt-get install libapache2-mod-wsgi
pip install mod_wsgi
conda install -c https://conda.binstar.org/travis uwsgi
It looks like wsgi is just not working with conda environments and I have to use virtualenv?? Wsgi works, I can render a test file just fine.
Though, when I go to localhost/koala
the /var/log/apache2/error.log
shows:
from django.core.wsgi import get_wsgi_application
ImportError: No module named 'django'
I searched a lot, but could not find an answer that addresses this properly.
python django apache2 mod-wsgi
You should not be installing system mod_wsgi package. Usepip
method only. See correct way to configure existing Apache to usepip
installed version in pypi.org/project/mod_wsgi You also don't need uwsgi, that is something different again.
– Graham Dumpleton
Nov 29 '18 at 5:46
So Apache is actually not needed? I find the documentations are not very clear.
– Sören
Nov 29 '18 at 20:13
I can use it but the page looks pretty broken.
– Sören
Nov 29 '18 at 20:29
You don't needlibapache2-mod-wsgi
but you still need the Apache package itself. If you have it running and have separate issue, create a new question.
– Graham Dumpleton
Nov 29 '18 at 22:58
I leave this question open though. It is still not answered. Running the wsgi stuff with apache is the first way mentioned in the django manual, so I am sure other people are running into this as well.
– Sören
Nov 30 '18 at 0:01
add a comment |
I am trying to run a django application with wsgi_mod and apache2. But for some strange reason it cannot import django.
# /etc/apache2/apache2.conf
WSGIDaemonProcess django_apps python-home=/home/swacker/miniconda3/envs/django/
WSGIProcessGroup django_apps
WSGIScriptAlias /koala /var/www/production/Koala/Koala/wsgi.py process-group=django_apps
<Directory /var/www/production/Koala/>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
The application sits in /var/www/production/Koala.
My conda enviromnent is installed in /home/user/miniconda3/envs/django.
I installed wsgi inside the conda environment.
I tried different things, but nothing worked. This is what I did to get wsgi running.
sudo apt-get install libapache2-mod-wsgi
pip install mod_wsgi
conda install -c https://conda.binstar.org/travis uwsgi
It looks like wsgi is just not working with conda environments and I have to use virtualenv?? Wsgi works, I can render a test file just fine.
Though, when I go to localhost/koala
the /var/log/apache2/error.log
shows:
from django.core.wsgi import get_wsgi_application
ImportError: No module named 'django'
I searched a lot, but could not find an answer that addresses this properly.
python django apache2 mod-wsgi
I am trying to run a django application with wsgi_mod and apache2. But for some strange reason it cannot import django.
# /etc/apache2/apache2.conf
WSGIDaemonProcess django_apps python-home=/home/swacker/miniconda3/envs/django/
WSGIProcessGroup django_apps
WSGIScriptAlias /koala /var/www/production/Koala/Koala/wsgi.py process-group=django_apps
<Directory /var/www/production/Koala/>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
The application sits in /var/www/production/Koala.
My conda enviromnent is installed in /home/user/miniconda3/envs/django.
I installed wsgi inside the conda environment.
I tried different things, but nothing worked. This is what I did to get wsgi running.
sudo apt-get install libapache2-mod-wsgi
pip install mod_wsgi
conda install -c https://conda.binstar.org/travis uwsgi
It looks like wsgi is just not working with conda environments and I have to use virtualenv?? Wsgi works, I can render a test file just fine.
Though, when I go to localhost/koala
the /var/log/apache2/error.log
shows:
from django.core.wsgi import get_wsgi_application
ImportError: No module named 'django'
I searched a lot, but could not find an answer that addresses this properly.
python django apache2 mod-wsgi
python django apache2 mod-wsgi
edited Nov 28 '18 at 23:10
Sören
asked Nov 28 '18 at 23:01
SörenSören
1,40041629
1,40041629
You should not be installing system mod_wsgi package. Usepip
method only. See correct way to configure existing Apache to usepip
installed version in pypi.org/project/mod_wsgi You also don't need uwsgi, that is something different again.
– Graham Dumpleton
Nov 29 '18 at 5:46
So Apache is actually not needed? I find the documentations are not very clear.
– Sören
Nov 29 '18 at 20:13
I can use it but the page looks pretty broken.
– Sören
Nov 29 '18 at 20:29
You don't needlibapache2-mod-wsgi
but you still need the Apache package itself. If you have it running and have separate issue, create a new question.
– Graham Dumpleton
Nov 29 '18 at 22:58
I leave this question open though. It is still not answered. Running the wsgi stuff with apache is the first way mentioned in the django manual, so I am sure other people are running into this as well.
– Sören
Nov 30 '18 at 0:01
add a comment |
You should not be installing system mod_wsgi package. Usepip
method only. See correct way to configure existing Apache to usepip
installed version in pypi.org/project/mod_wsgi You also don't need uwsgi, that is something different again.
– Graham Dumpleton
Nov 29 '18 at 5:46
So Apache is actually not needed? I find the documentations are not very clear.
– Sören
Nov 29 '18 at 20:13
I can use it but the page looks pretty broken.
– Sören
Nov 29 '18 at 20:29
You don't needlibapache2-mod-wsgi
but you still need the Apache package itself. If you have it running and have separate issue, create a new question.
– Graham Dumpleton
Nov 29 '18 at 22:58
I leave this question open though. It is still not answered. Running the wsgi stuff with apache is the first way mentioned in the django manual, so I am sure other people are running into this as well.
– Sören
Nov 30 '18 at 0:01
You should not be installing system mod_wsgi package. Use
pip
method only. See correct way to configure existing Apache to use pip
installed version in pypi.org/project/mod_wsgi You also don't need uwsgi, that is something different again.– Graham Dumpleton
Nov 29 '18 at 5:46
You should not be installing system mod_wsgi package. Use
pip
method only. See correct way to configure existing Apache to use pip
installed version in pypi.org/project/mod_wsgi You also don't need uwsgi, that is something different again.– Graham Dumpleton
Nov 29 '18 at 5:46
So Apache is actually not needed? I find the documentations are not very clear.
– Sören
Nov 29 '18 at 20:13
So Apache is actually not needed? I find the documentations are not very clear.
– Sören
Nov 29 '18 at 20:13
I can use it but the page looks pretty broken.
– Sören
Nov 29 '18 at 20:29
I can use it but the page looks pretty broken.
– Sören
Nov 29 '18 at 20:29
You don't need
libapache2-mod-wsgi
but you still need the Apache package itself. If you have it running and have separate issue, create a new question.– Graham Dumpleton
Nov 29 '18 at 22:58
You don't need
libapache2-mod-wsgi
but you still need the Apache package itself. If you have it running and have separate issue, create a new question.– Graham Dumpleton
Nov 29 '18 at 22:58
I leave this question open though. It is still not answered. Running the wsgi stuff with apache is the first way mentioned in the django manual, so I am sure other people are running into this as well.
– Sören
Nov 30 '18 at 0:01
I leave this question open though. It is still not answered. Running the wsgi stuff with apache is the first way mentioned in the django manual, so I am sure other people are running into this as well.
– Sören
Nov 30 '18 at 0:01
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53529405%2frun-wsgi-with-apache-and-django-in-anaconda-environment%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- 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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53529405%2frun-wsgi-with-apache-and-django-in-anaconda-environment%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
You should not be installing system mod_wsgi package. Use
pip
method only. See correct way to configure existing Apache to usepip
installed version in pypi.org/project/mod_wsgi You also don't need uwsgi, that is something different again.– Graham Dumpleton
Nov 29 '18 at 5:46
So Apache is actually not needed? I find the documentations are not very clear.
– Sören
Nov 29 '18 at 20:13
I can use it but the page looks pretty broken.
– Sören
Nov 29 '18 at 20:29
You don't need
libapache2-mod-wsgi
but you still need the Apache package itself. If you have it running and have separate issue, create a new question.– Graham Dumpleton
Nov 29 '18 at 22:58
I leave this question open though. It is still not answered. Running the wsgi stuff with apache is the first way mentioned in the django manual, so I am sure other people are running into this as well.
– Sören
Nov 30 '18 at 0:01