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;








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>









share|improve this question






























    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>









    share|improve this question


























      0












      0








      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>









      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      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






















          1 Answer
          1






          active

          oldest

          votes


















          0














          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





          share|improve this answer























          • 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










          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
          );



          );













          draft saved

          draft discarded


















          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









          0














          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





          share|improve this answer























          • 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















          0














          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





          share|improve this answer























          • 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













          0












          0








          0







          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





          share|improve this answer













          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






          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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








          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.



















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript