Steps with explanations to set up a server using:
- Virtualenv
- Virtualenvwrapper
- Django
- Gunicorn
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| FILE SPACING: | |
| # double space a file | |
| sed G | |
| # double space a file which already has blank lines in it. Output file | |
| # should contain no more than one blank line between lines of text. | |
| sed '/^$/d;G' |
| # -*- coding: utf-8 -*- | |
| from django.conf import settings | |
| from django.core.files.storage import FileSystemStorage | |
| from django.db import models | |
| class OverwriteStorage(FileSystemStorage): | |
| ''' | |
| Muda o comportamento padrão do Django e o faz sobrescrever arquivos de | |
| mesmo nome que foram carregados pelo usuário ao invés de renomeá-los. | |
| ''' |
| upstream uwsgi { | |
| ip_hash; | |
| server 127.0.0.1:40000; | |
| } | |
| server { | |
| listen 80; | |
| server_name www.domain.com; | |
| root /sites/mysite/; | |
| access_log /sites/mysite/log/nginx/access.log; |