: This article describes how to deploy nginx + uwsgi + django. if you are interested in the PHP Tutorial, refer to it.
In the python development group, some people often ask nginx + uwsgi + django about the tutorial deployment, but they do not know the relationship between them, as a result, I google a chart that makes me very much agree with each other. afte
Python development group often have the same knowledge nginx+uwsgi+django the tutorial deployment, but do not know how their relationship between, so I Google to a let me look very agree with the diagram, we see also more agree, so share out.
This is the source of this picture. Click
Copyright NOTICE: This article is Orangleliu (http://blog.csdn.net/orangleliu/) original article, the article reprodu
Two words: Simple!Gunicorn gevent Greenlet are all things that apt-get can solve.After installing the CD to the target directory, Gunicorn--worker-class=gevent--workers=2-b 0.0.0.0:8080 wsgi:application basically solves the problem.If there is a static file to be processed, to apt-get a nginx match under the/static/path to the server processing, the Django app to concentrate on processing logicNginx Plus Cache is also a two or three-minute thing, not
The process of deployment is simple, the core of deployment is why to do so, each parameter represents what meaning, the ultimate goal is to understand, some basic conceptual things.UWSGI Introduction
Before you say Uwsgi, talk about Wsgi first.
What is WSGI?
WSGI: is a Web server gateway interface that is a specification for a Web server (such as Nginx) to communicate with an application server, such as
Tags: daemonize tor custom file write BSP ice related chdir newThere are many deployment tutorials on the Internet, said a lot, meet the pit or to solve their own, here are a few more important pits we must pay attention to.1, first to install Python and python-dev environment, if there is no installation of Python-dev after the installation of some dependencies to error. This is the first pit.Apt-get Install Python python-dev pip2, install the UWSGI
project in the Awmonline server information
View Code
To install Gunicorn in a awmonline virtual environment after you have finished adding the server
(ENV) [Email protected]:~/sites/awmonline/awmonline$ pip Install Gunicorn
Set the Awmonline self-starting Gunicorn script
#/etc/init/gunicorn-awmonline.conf
Start on net-device-upStop on shutdown
Respawn
Setuid muChdir/home/mu/sites/awmonline/awmonlin
Exec.. /env/bin/gunicorn--bind Unix:/tmp/aw
Environment construction1. Download the required packages:(1) Python installation package
(2) Django installation package
The following 2 packages are actually installed with the Python Package management tool, which will be used when installing the Django Documentation Package module later, and the download site is PyPI
(1) Setuptools.exe
(2) Pip
2. Install the required packages:Python installation packag
=/var/www/OMS // project directory
Module = OMS. wsgi: Application // The loaded wsgi module. Use the default
Master = true // enable master Process
Pidfile =/var/run/OMS. PID // PID File Location
Vacuum = true // The General files and socket are automatically cleared when the server exits.
Max-Requests = 5000 // maximum request
Daemonize =/opt/log/uwsgi/OMS. Log // output location of the background running log
Socket =: 9090 // listens to the global port 9090. You can change it to socket to ru
1 Coding issuesIt's no problem to run Django directly, but there's an error when uploading a file with Chinese characters via Apache+mod_wsgi:Unicodeencodeerror: ' ASCII ' codec can ' t encode characters in position ...Workaround: Modify /etc/apache2/envvars , then restart ApacheExport lang='zh_ch. UTF-8'export lang_all='zh_ch. UTF-8'2 Permissions IssuesPermissionerror: [Errno] Permission deniedAdd a permission to the directory chmodSome problems with
No. 400, Django+xadmin build a standard online education platform-production environment Deployment CentOS6.5 installation python3.5.11. Check if Python is installed on the system[[Email protected] ~] # rpm-qa pythonpython-2.6.6-51el6.x86_64[[email protected]192 ~]#You can see that the CentOS6.5 system is installed by default python2.6.62. Check where Python is installed[[Email protected] ~] # whereis pytho
Static file-related operations involve:A. File location and access path mappingB. setting.py and static-related configurations
Static_urlStatic_rootStaticfiles_dirs
C. How the static file is referenced in HTMLD. Python manage.py collectstatic
1. Development environment-directory structure2. setting.py SettingsSTATIC_URL = ‘/static/‘# STATIC_ROOT= os.path.join(BASE_DIR,‘static‘)STATICFILES_DIRS=( os.path.join(BASE_DIR,‘static‘),)The actual access address for the brow
Just installed Ubuntu, want to try Django, here is the procedure1. Irrelevant, install SSHsudo apt-get updatesudo apt-get install Openssh-server/etc/init.d/ssh start2. Then you can access it via X_shell, install Djangosudo apt-get install python-django-y3. See the Django versionPythonImport DjangoDjango.get_version ()Output 1.8.14, check the next file, CTRL + C c
: This article mainly introduces problems encountered during Nginx and uwsgi deployment in Django. For more information about PHP tutorials, see. Https://uwsgi.readthedocs.org/en/latest/tutorials/Django_and_nginx.html
Http://my.oschina.net/u/240562/blog/127298
Http://www.nowamagic.net/academy/detail/1330334
Http://ddtcms.com/news/2012/11/11/93/jian-shu-uwsgi-nginx-python-da-jian-guo-cheng/
The above d
Deployment of Django Web on Apache, djangoapache
1. install and configure Apache2. Install the wsgi_mod Module3. Open the corresponding port
Vim/etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. * filter: input accept [0: 0]: forward accept [0: 0]: output accept [0: 0]-a input-m state -- state ESTABLISHED, RELATED-j ACCE
"What is the best layout for Django Apps, profiles, and various other related catalogs?" ”
There are always friends asking us this question, so I would like to take a moment to write about how we look at the problem, so that we can easily get others to refer to this document. Please note that this is based on the Django 1.7.1 version, but it can be easily applied to any version after
"What is the best layout for Django applications, profiles, and various other related directories?" ”
There are always friends who ask us this question, so I want to take a moment to write about how we look at the problem, so that we can easily let others refer to the document. Please note that this is based on the Django 1.7.1 version, but it can be easily applied to any version after
1. Installing ApacheFirst unload your own httpdRPM-E httpd--nodepsDownload four of files online1, apr-1.4.6.tar.gz2, apr-util-1.5.1.tar.gz3, pcre-8.32.tar.gz4, httpd-2.4.3.tar.gz:http://pan.baidu.com/share/link?shareid=169366uk=1829018343Install each of the four package root users separatelyInstalling apr-1.4.6.tar.gzTar xzf apr-1.4.6.tar.gz./configure-prefix=/usr/local/aprMakeMake installInstalling apr-util-1.5.1.tar.gzTar xzf apr-util-1.5.1.tar.gz./configure-with-apr=/usr/local/aprMakeMake ins
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.