1. Mezzanine Introduction
Mezzanine is an application based on Django framework, For details, refer to the official website: http://mezzanine.jupo.org/
2. Mezzanine Installation Guide:
# Install from PyPI$ pip install mezzanine# Create a project$ mezzanine-project myproject$ cd myproject# Create a database$ python manage.py createdb# Run the web server$ python manage.py runserver
The new project, if you want to modify a topic, can refer to: https://github.com/renyi/mezzanine-themes.git
3. Modify the nginx configuration file
Go to the conf directory under your nginx installation directory and modify the configuration file nginx. conf.
* *** About how to configure static files during deployment
cd /usr/local/nginx/conf/gedit nginx.conf
Add the following content:
Make sure to modify the path of your project, such as Alias/home/Daniel/myblog/static;
server { listen 8080; server_name 123456; location / { root /home/daniel/myblog/; uwsgi_pass 127.0.0.1:8000; include uwsgi_params; }location /static { autoindex on; alias /home/daniel/myblog/static; access_log off; log_not_found off; } location /robots.txt { alias /home/daniel/myblog/static; access_log off; log_not_found off; }location /favicon.ico { alias /home/daniel/myblog/static/img; access_log off; log_not_found off; } }
The deployment method can be uwsgi, http://projects.unbit.it/downloads /.
tar zxvf uwsgi-latest.tar.gz cd uwsgi-1.2.6 make cp uwsgi /usr/sbin/uwsgi
After uwsgi is installed.
Create the file django_wsgi.py in your project directory.
Add the following content:
#!/usr/bin/env python # coding: utf-8import os,sys if not os.path.dirname(__file__) in sys.path[:1]:sys.path.insert(0, os.path.dirname(__file__)) os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' from django.core.handlers.wsgi import WSGIHandler application = WSGIHandler()
Create File Django. xml
Add the following content and change it to your own path:
<uwsgi> <socket>127.0.0.1:8000</socket> <master>true</master> <chdir>/home/daniel/myblog</chdir> <pythonpath>..</pythonpath><wsgi-file>django_wsgi.py</wsgi-file> <enable-threads>true</enable-threads> </uwsgi>
Last run: wsgi-x wsgi. xml
This is configured. Enter http: // localhost: 8080/in the browser/
Is it possible to browse your site.
For specific configuration, see related configuration in my project.
Https://github.com/ustcdane/Mezzanine-uwsgi-nginx