I'm having issues with mod_wsgi + Django + ApacheDoes Python have a ternary conditional operator?Does Python have a string 'contains' substring method?Running Django tutorial example with mod_wsgi?deploying django application on Apache using mod_wsgiError in deploying django with Apache and mod_wsgiImportError with Django mod_wsgiApache, Django and Mod_WSGI Issue500 Error when starting Django on Apache with mod_wsgiDeploying django(python) project with mod_wsgiDjango won't run on Apache with mod_wsgi
Does a return economy-class seat between London and San Francisco release 5.28 tonnes of CO2 equivalents?
How to get a character's limb regrown at 3rd level?
How do I tell the reader that my character is autistic in Fantasy?
Prime parity peregrination
Can a nowhere continuous function have a connected graph?
Is there a legal way for US presidents to extend their terms beyond two terms of four years?
Do home values typically rise and fall at a consistent percent?
Losing queen and then winning the game
I hit a pipe with a mower and now it won't turn
Why would anyone even use a Portkey?
Bin Packing with Relational Penalization
If two black hole event horizons overlap (touch) can they ever separate again?
What do you call a notepad used to keep a record?
What is "override advice"?
Why does the recording about Twin Pines Mall not change the same way the newspapers and photographs change?
Sacrifice blocking creature before damage is dealt no longer working (MtG Arena)?
How can I deal with extreme temperatures in a hotel room?
Is it okay to fade a human face just to create some space to place important content over it?
Do the 26 richest billionaires own as much wealth as the poorest 3.8 billion people?
Can one use the present progressive or gerund like an adjective?
Is Cyclic Ether oxidised by periodic acid
Using the ArcGIS 'select by location' tool in ModelBuilder?
Why was Mal so quick to drop Bester in favour of Kaylee?
What are good ways to spray paint a QR code on a footpath?
I'm having issues with mod_wsgi + Django + Apache
Does Python have a ternary conditional operator?Does Python have a string 'contains' substring method?Running Django tutorial example with mod_wsgi?deploying django application on Apache using mod_wsgiError in deploying django with Apache and mod_wsgiImportError with Django mod_wsgiApache, Django and Mod_WSGI Issue500 Error when starting Django on Apache with mod_wsgiDeploying django(python) project with mod_wsgiDjango won't run on Apache with mod_wsgi
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
We deployed a Python 3 application in Django 2.1.2 in a Debian Stretch server. If we run /usr/bin/python3 manage.py runserver 0:8000
into the application directory, it works correctly.
Then, we are trying to serve the application using mod_wsgi for Apache. We aren't using a virtualenv. The version of mod_wsgi we are using is 4.6.5 and the version of Apache is 2.4. But mod_wsgi + Apache is not using Django, so the index.html seems to be like this:
% if user.is_authenticated % Hello user.first_name
instead of the page with css styles, images and so on
My /etc/apache2/sites-available/myapp.conf
content is:
<VirtualHost *:80>
Servername myapp
DocumentRoot /home/project/myapp/myapp/templates/myapp
WSGIScriptAlias /myapp /home/project/myapp/myapp/wsgi.py
WSGIDaemonProcess myapp
WSGIProcessGroup myapp
<Directory /home/project/myapp>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
python django apache mod-wsgi
add a comment |
We deployed a Python 3 application in Django 2.1.2 in a Debian Stretch server. If we run /usr/bin/python3 manage.py runserver 0:8000
into the application directory, it works correctly.
Then, we are trying to serve the application using mod_wsgi for Apache. We aren't using a virtualenv. The version of mod_wsgi we are using is 4.6.5 and the version of Apache is 2.4. But mod_wsgi + Apache is not using Django, so the index.html seems to be like this:
% if user.is_authenticated % Hello user.first_name
instead of the page with css styles, images and so on
My /etc/apache2/sites-available/myapp.conf
content is:
<VirtualHost *:80>
Servername myapp
DocumentRoot /home/project/myapp/myapp/templates/myapp
WSGIScriptAlias /myapp /home/project/myapp/myapp/wsgi.py
WSGIDaemonProcess myapp
WSGIProcessGroup myapp
<Directory /home/project/myapp>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
python django apache mod-wsgi
add a comment |
We deployed a Python 3 application in Django 2.1.2 in a Debian Stretch server. If we run /usr/bin/python3 manage.py runserver 0:8000
into the application directory, it works correctly.
Then, we are trying to serve the application using mod_wsgi for Apache. We aren't using a virtualenv. The version of mod_wsgi we are using is 4.6.5 and the version of Apache is 2.4. But mod_wsgi + Apache is not using Django, so the index.html seems to be like this:
% if user.is_authenticated % Hello user.first_name
instead of the page with css styles, images and so on
My /etc/apache2/sites-available/myapp.conf
content is:
<VirtualHost *:80>
Servername myapp
DocumentRoot /home/project/myapp/myapp/templates/myapp
WSGIScriptAlias /myapp /home/project/myapp/myapp/wsgi.py
WSGIDaemonProcess myapp
WSGIProcessGroup myapp
<Directory /home/project/myapp>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
python django apache mod-wsgi
We deployed a Python 3 application in Django 2.1.2 in a Debian Stretch server. If we run /usr/bin/python3 manage.py runserver 0:8000
into the application directory, it works correctly.
Then, we are trying to serve the application using mod_wsgi for Apache. We aren't using a virtualenv. The version of mod_wsgi we are using is 4.6.5 and the version of Apache is 2.4. But mod_wsgi + Apache is not using Django, so the index.html seems to be like this:
% if user.is_authenticated % Hello user.first_name
instead of the page with css styles, images and so on
My /etc/apache2/sites-available/myapp.conf
content is:
<VirtualHost *:80>
Servername myapp
DocumentRoot /home/project/myapp/myapp/templates/myapp
WSGIScriptAlias /myapp /home/project/myapp/myapp/wsgi.py
WSGIDaemonProcess myapp
WSGIProcessGroup myapp
<Directory /home/project/myapp>
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
python django apache mod-wsgi
python django apache mod-wsgi
edited Mar 25 at 14:16
baduker
1,2234 gold badges11 silver badges21 bronze badges
1,2234 gold badges11 silver badges21 bronze badges
asked Mar 25 at 13:58
stuckonflowstuckonflow
1
1
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
There are a couple of errors here.
Firstly, you should absolutely not set your DocumentRoot to the templates directory. In fact, you should not set it at all; delete that line.
Secondly, you have set your app to serve on the prefix "myapp". I doubt you wanted to do that; it sounds like you just want your app to serve on the root. So remove that from the alias:
WSGIScriptAlias / /home/project/myapp/myapp/wsgi.py
I tried that, then restarted Apache. With that Apache configuration in the sites-available file, I get this error in /var/log/apache/error.log:[Wed Mar 27 07:05:52.609215 2019] [wsgi:error] [pid 12936:tid 140276901172992] [remote 10.52.127.195:51266] ImportError: No module named 'myapp'
The whole error log in: pastebin.com/dJJJTUBS And, when I open the servers URL, I get a HTTP 500 Internal Server Error.
– stuckonflow
Mar 27 at 8:49
add a comment |
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%2f55339502%2fim-having-issues-with-mod-wsgi-django-apache%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
There are a couple of errors here.
Firstly, you should absolutely not set your DocumentRoot to the templates directory. In fact, you should not set it at all; delete that line.
Secondly, you have set your app to serve on the prefix "myapp". I doubt you wanted to do that; it sounds like you just want your app to serve on the root. So remove that from the alias:
WSGIScriptAlias / /home/project/myapp/myapp/wsgi.py
I tried that, then restarted Apache. With that Apache configuration in the sites-available file, I get this error in /var/log/apache/error.log:[Wed Mar 27 07:05:52.609215 2019] [wsgi:error] [pid 12936:tid 140276901172992] [remote 10.52.127.195:51266] ImportError: No module named 'myapp'
The whole error log in: pastebin.com/dJJJTUBS And, when I open the servers URL, I get a HTTP 500 Internal Server Error.
– stuckonflow
Mar 27 at 8:49
add a comment |
There are a couple of errors here.
Firstly, you should absolutely not set your DocumentRoot to the templates directory. In fact, you should not set it at all; delete that line.
Secondly, you have set your app to serve on the prefix "myapp". I doubt you wanted to do that; it sounds like you just want your app to serve on the root. So remove that from the alias:
WSGIScriptAlias / /home/project/myapp/myapp/wsgi.py
I tried that, then restarted Apache. With that Apache configuration in the sites-available file, I get this error in /var/log/apache/error.log:[Wed Mar 27 07:05:52.609215 2019] [wsgi:error] [pid 12936:tid 140276901172992] [remote 10.52.127.195:51266] ImportError: No module named 'myapp'
The whole error log in: pastebin.com/dJJJTUBS And, when I open the servers URL, I get a HTTP 500 Internal Server Error.
– stuckonflow
Mar 27 at 8:49
add a comment |
There are a couple of errors here.
Firstly, you should absolutely not set your DocumentRoot to the templates directory. In fact, you should not set it at all; delete that line.
Secondly, you have set your app to serve on the prefix "myapp". I doubt you wanted to do that; it sounds like you just want your app to serve on the root. So remove that from the alias:
WSGIScriptAlias / /home/project/myapp/myapp/wsgi.py
There are a couple of errors here.
Firstly, you should absolutely not set your DocumentRoot to the templates directory. In fact, you should not set it at all; delete that line.
Secondly, you have set your app to serve on the prefix "myapp". I doubt you wanted to do that; it sounds like you just want your app to serve on the root. So remove that from the alias:
WSGIScriptAlias / /home/project/myapp/myapp/wsgi.py
answered Mar 25 at 14:51
Daniel RosemanDaniel Roseman
471k42 gold badges608 silver badges667 bronze badges
471k42 gold badges608 silver badges667 bronze badges
I tried that, then restarted Apache. With that Apache configuration in the sites-available file, I get this error in /var/log/apache/error.log:[Wed Mar 27 07:05:52.609215 2019] [wsgi:error] [pid 12936:tid 140276901172992] [remote 10.52.127.195:51266] ImportError: No module named 'myapp'
The whole error log in: pastebin.com/dJJJTUBS And, when I open the servers URL, I get a HTTP 500 Internal Server Error.
– stuckonflow
Mar 27 at 8:49
add a comment |
I tried that, then restarted Apache. With that Apache configuration in the sites-available file, I get this error in /var/log/apache/error.log:[Wed Mar 27 07:05:52.609215 2019] [wsgi:error] [pid 12936:tid 140276901172992] [remote 10.52.127.195:51266] ImportError: No module named 'myapp'
The whole error log in: pastebin.com/dJJJTUBS And, when I open the servers URL, I get a HTTP 500 Internal Server Error.
– stuckonflow
Mar 27 at 8:49
I tried that, then restarted Apache. With that Apache configuration in the sites-available file, I get this error in /var/log/apache/error.log:
[Wed Mar 27 07:05:52.609215 2019] [wsgi:error] [pid 12936:tid 140276901172992] [remote 10.52.127.195:51266] ImportError: No module named 'myapp'
The whole error log in: pastebin.com/dJJJTUBS And, when I open the servers URL, I get a HTTP 500 Internal Server Error.– stuckonflow
Mar 27 at 8:49
I tried that, then restarted Apache. With that Apache configuration in the sites-available file, I get this error in /var/log/apache/error.log:
[Wed Mar 27 07:05:52.609215 2019] [wsgi:error] [pid 12936:tid 140276901172992] [remote 10.52.127.195:51266] ImportError: No module named 'myapp'
The whole error log in: pastebin.com/dJJJTUBS And, when I open the servers URL, I get a HTTP 500 Internal Server Error.– stuckonflow
Mar 27 at 8:49
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
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%2f55339502%2fim-having-issues-with-mod-wsgi-django-apache%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