Welcome Guest. Please Login or Register  


You are here: Index > Webuzo > General Support > Topic : Deploy a Django on a domain?



Threaded Mode | Print  

 Deploy a Django on a domain?, Please help me to serve a Django website with Webuzo (1 Replies, Read 1451 times)
hungdung2507
Group: Member
Post Group: Newbie
Posts: 1
Status:
I was trying my best to make a Django website on Webuzo. But there isn't an official page to tell me how to do so, https://www.webuzo.com/docs/endusers/how-to-configure-django#create-a-django-web-project wasn't helpful as it doesn't say anything about deploying it with Mod_wsgi on Apache 2.4
I followed a guide on Digitalocean. I created a domain app.anime5s.com with Webuzo, in the domain path, I created a virtual host (python 3.6), installed Django and I created a brand new django project with django-admin command, and when I run manage.py runserver everything worked fine, and modified /usr/local/apps/apache2/etc/conf.d/webuzoVH.conf


<VirtualHost 62.171.142.251:80>       
   
    <Directory /home/admin/public_html/app.anime5s.com/cgi-bin>
        RMode stat
        RUidGid admin admin
    </Directory>       
   
    ServerName app.anime5s.com
    ServerAlias www.app.anime5s.com
   
    DocumentRoot /home/admin/public_html/app.anime5s.com
    Alias /static /home/admin/public_html/app.anime5s.com/anime5s_app/static
    <Directory /home/admin/public_html/app.anime5s.com/anime5s_app/static>
        Require all granted
    </Directory>

    <Directory /home/admin/public_html/app.anime5s.com/anime5s_app/anime5s_app>
        <Files wsgi.py>
            Require all granted
        </Files>
    </Directory>

    WSGIDaemonProcess app.anime5s.com_http python-home=/home/admin/public_html/app.anime5s.com/anime5s_app_venv python-path=/home/admin/public_html/app.anime5s.com/anime5s_app
    WSGIProcessGroup app.anime5s.com_http
    WSGIScriptAlias / /home/admin/public_html/app.anime5s.com/anime5s_app/anime5s_app/wsgi.py
    ErrorLog /usr/local/apps/apache2/logs/app.anime5s.com.err
    CustomLog /usr/local/apps/apache2/logs/app.anime5s.com.log combined
   
<FilesMatch \.php$>
    <If "-f %{REQUEST_FILENAME}">
        SetHandler "proxy:unix:/usr/local/apps/php73/var/php73_9000.sock|fcgi://localhost"   
    </If>
</FilesMatch>
    ScriptAlias /cgi-bin/ /home/admin/public_html/app.anime5s.com/cgi-bin/
    ServerAdmin xxx@yyy.com
    ErrorLog /usr/local/apps/apache2/logs/app.anime5s.com.err
    CustomLog /usr/local/apps/apache2/logs/app.anime5s.com.log combined
</VirtualHost>

I restarted Apache, no error was seen. But when I access the website I got a 500 error. Here's what I get in the error log file:
[Wed Feb 26 12:21:06.159875 2020] [wsgi:error] [pid 27670] [client xxx.xxx.xxx.xxx:13850] Truncated or oversized response headers received from daemon process 'app.anime5s.com_http': /home/admin/public_html/app.anime5s.com/anime5s_app/anime5s_app/wsgi.py

I was suggested to put WSGIApplicationGroup %{GLOBAL}
in httpd.conf but when I add the line in Webuzo Apache Settings and did
service httpd restart

but it still doesn't work. All the steps above worked smoothly when I did on a server without Webuzo installed (LAMP stack with python and Django)
Did I do anything wrong or there is a specific way to deploy Django on Webuzo?
Please help!

Thanks for your time and efforts involved in solving this for me!
IP: --   

Deploy a Django on a domain?
Dhanya
Group: Member
Post Group: Working Member
Posts: 201
Status:
Hi hungdung2507,

The following Webuzo guide is for beginner who wants to create a new Django App from commandline:
https://www.webuzo.com/docs/endusers/how-to-configure-django#create-a-django-web-project

We will have to first test this on our test server and then we will be able to provide you proper solution.

Let us kow.
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is July 3, 2020, 8:18 pm.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.124