This document uses fabric to automatically deploy its own Webtools project, saving time on the Go . Fabric Installation
The fabric installation is straightforward apt-get install fabric, but installing on Windows will cause the following error: Missing Visual C + + 9.0. You only need to download the Microsoft Visual C + + Compiler for Python 2.7 installation. When installed, a Fab.exe file is generated in the scripts directory and added to the environ
This article describes how to deploy the Apache + Python + Django + MySQL environment on Linux, and connect mod_python to the mysqldb module, for more information, see Linux + apache + mysql + python + mod_python + Django.
Note: httpd and mysql are installed by default in rhel 5.3. If not, download and install the RPM package and delete/etc/httpd/modules/mod_pyth
Nginx + uwsgi or fastcgi deploy the Django project, nginxdjangoNginx + uwsgi
Install the C compiler and Python environment in ubuntu:
sudo apt-get install build-essential python-dev
Use pip to install uwsgi:
pip install uwsgi
Nginx Configuration:
You can set a configuration file for the site separately:
sudo vim /etc/nginx/sites-enabled/mysite
You can also directly set it in nginx. conf:
sudo vim /etc/nginx
#thebasedirectory (Fullpath) chdir=/opt/ourcmdb/ #项目目录 #djangoswsgifilemodule =OurCMDB.wsgi #wsgi .py Create a django project when you have generated catalog /opt/ ourcmdb/ourcmdb/wsgi.py#process-relatedsettings#mastermaster =true#maximumnumberofworker processesprocesses=4##...with appropriatepermissions-maybeneeded#chmod-socket= 664#clearenvironment onexitvacuum=true View the files under the projectNew Nginx Virtual configuration fileCat/etc/nginx
I. Setting up a virtual directory in a Web applicationIi. in the virtual directory, a file, Web. config, reads as follows: XML version= "1.0"?> Configuration> system.webserver> handlers> Clear/> Addname= "Staticfile"Path="*"verb="*"Modules= "Staticfilemodule,defaultdocumentmodule,directorylistingmodule"ResourceType= "either"requireaccess= "Read" /> handlers> system.webserver>Configuration> Ways to set up a static virtual directory in an Azure web app
Tags: file sudo remote etc access right get address Ubuntu effective1. Install MySQL and plugins:sudo apt-get install mysql-server mysql-clientsudo apt-get Install Libmysqld-devsudo apt-get install Python-devIn this process he will prompt you to enter the root password and confirm the password.Install the python and MySQL connection pluginMysqlclient2. Configure MySQL remote access permission (user name password self-modification)GRANT all privileges on * * to ' user name ' @ '% ' identified by
have been optimizing the code of their own blog, yesterday, the CSS style sheet was separated, as a staticFile, but didn't learn how Django uses static files, after some googleFinally solved.There are two ways Django uses static files, one that is deployed on Django, and the otheris deployed on Apache, the previous method has a certain flaw, inefficient, and will
System version:CentOS 7.3Apache 2.4Django 1.11Problem descriptionThe Django project involves the upload operation, the upload file name contains Chinese, if use Runserver start the service, no problem!If you deploy the Django project to the Apache server, if you upload a file that contains Chinese, the error is:ASCII ' codec can ' t encode characters in position
()1 vim/var/www/html/buglist/buglist/settings.py1 allowed_hosts = [www.example.com',] ----Add your own domain name1Staticfiles_finders = (2 'Django.contrib.staticfiles.finders.FileSystemFinder',3 'Django.contrib.staticfiles.finders.AppDirectoriesFinder',4#'Django.contrib.staticfiles.finders.DefaultStorageFinder',5 )6Staticfiles_dirs = ('/var/www/html/buglist/static/css',-----Here to change the previous relative path to an absolute path7 '/var/www/html
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.