python - Setting up django on a virtual machine -


i have virtual machine running peppermint os 2 (basically ubuntu).

i've been trying follow following tutorial: http://jeffbaier.com/articles/installing-django-on-an-ubuntu-linux-server/

and far has worked out tutorial has stated. apache httpd.conf file looks following:

servername localhost  maxrequestsperchild 1      sethandler python-program     pythonhandler django.core.handlers.modpython     setenv django_settings_module myproject.settings     pythonpath "['/home/<my_user_name>/django_projects'] + sys.path"      sethandler none      sethandler none      sethandler none      sethandler none 

whenever try , and go "localhost/", shows me /var/www/ folder (the index.html file says "it works!") , not django startpage should come up. contents of /var/www "admin_media" , "media"

what need do? thank you.

try mod_wsgi or uwsgi, it's easier config, robust, , faster.

you @ django doc - use django mod_wsgi

as using ubuntu, install of mod_wsgi easy:

sudo apt-get install libapache2-mod-wsgi 

if not have mod-wsgi enabled, following:

cd /etc/apache2/mod_available cp mod_wsgi.* ../mod_enable sudo service apache2 restart 

for using mod_python, apache config is:

amevirtualhost *:80 namevirtualhost *:8000 listen 80 listen 8000  wsgidaemonprocess xxxx display-name=%{group} wsgiprocessgroup xxxx <virtualhost *:80>     servername  xxxx     wsgiscriptalias / /home/xxx/xxxx/xxxx.wsgi      alias /js "/home/xxx/xxxx/xxxx/public/js"     <location "/js">         sethandler none     </location>     <directory "/home/xxx/xxxx/xxxx/public/js">        order deny,allow        allow     </directory> </virtualhost>  namevirtualhost *:8080 <virtualhost *:8080>         wsgiscriptalias / /home/xxxx/xxxx/wsgi_handler.py         #wsgidaemonprocess xxxx_com22 user=xxxx processes=1 threads=10         #wsgiprocessgroup xxxx_com1          alias /upload/ "/home/xxxx/xxxx/upload/"         <directory /home/xxxx/xxxx/upload/>                 options indexes followsymlinks multiviews                 allowoverride none                 order allow,deny                 allow         </directory> </virtualhost> listen 8080 

and using uwsgi, recommend using nginx + uwsgi, if interesting, i'll post tutorial , configuration.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -