-
Installing Httpd,django
Yum install-y httpd Python-pip
Pip Install Django (if the Python version is 2.6 requires PIP install django==1.4, if the Python version is 2.7, you can install the latest version of Django directly)
-
Installing MOD_WSGI
Yum Install-y Mod_wsgi
-
Modify/etc/httpd/conf.d/wsgi.conf
LoadModule wsgi_module modules/mod_wsgi.soalias/templates//usr/local/django/admin/templates/(static file path) < Directory "/templates/" > Order deny,allow allow from all</directory>alias/static//usr/local/django/admin/st Atic/<directory "/static/" > Order deny,allow allow from All</directory>wsgipythonpath "/usr/local/dj Ango/admin "Wsgiscriptalias/"/usr/local/django/admin/admin/wsgi.py "
4. Restart httpd
Service httpd Restart
5. Check for static files
Python manage.py collectstatic (to execute this file in your project directory) PS: It seems like you want to copy the static files to the Python installation directory
6. You need to manually copy things under Templates to/usr/lib/python2.6/site-packages/django/contrib/admin/templates/and/usr/lib/python2.6/ In the site-packages/django/contrib/auth/templates/directory
PS: I don't know why I'm doing this.
Spit the slot: Django Default login is required to use the database, this does not know where to modify the database is not required.
This article is from "It worker-small Maple" blog, please be sure to keep this source http://wangfeng7399.blog.51cto.com/3518031/1684287
Django Apache Release