Configurando servidor de firewall, com servidor e máquinas cliente.
Firewall Debian - Servidor Debian - Cliente Windows XP - Cliente Windows XP -
| from forms import SideBarExampleAdminForm, WidgetsExampleAdminForm | |
| class WidgetsExampleAdmin(admin.ModelAdmin): | |
| form = WidgetsExampleAdminForm | |
| admin_site.register(WidgetsExample, WidgetsExampleAdmin) |
| Exclue arquivos terminados em 'pyc' do diretório altosnoticia | |
| find altosnoticia/ -name '*.pyc' -exec rm {} \; | |
| Ver erros do NGINX | |
| /var/log/nginx/error.log |
| http://i1.ytimg.com/vi/embed/maxresdefault.jpg |
| class Photo(models.Model): | |
| image = ImageField(...) # works with FileField also | |
| def save(self, *args, **kwargs): | |
| # delete old file when replacing by updating the file | |
| try: | |
| this = Photo.objects.get(id=self.id) | |
| if this.image != self.image: | |
| this.image.delete(save=False) |
| {% load staticfiles %} | |
| <html> | |
| <head> | |
| <title>{% block title %}{% endblock %}</title> | |
| </head> | |
| <body> | |
| <img src="{% static "images/sitelogo.png" %}" alt="Logo" /> | |
| {% block content %}{% endblock %} | |
| </body> | |
| </html> |
| # -*- coding: utf-8 -*- | |
| DEBUG = True | |
| DATABASES = { | |
| 'default': { | |
| 'ENGINE': 'django.db.backends.mysql', | |
| 'NAME': 'institucional', | |
| 'USER': 'root', | |
| 'PASSWORD': 'root', |
| # /etc/supervisor/supervisord.conf | |
| environment=LANG="en_US.utf8", LC_ALL="en_US.UTF-8", LC_LANG="en_US.UTF-8" |
| # CLIENTE | |
| 10.19.8.196 | |
| # SERVIDOR | |
| 10.19.8.109 | |
| #Ver regas | |
| iptables -L | |
| # Bloquear conexões via SSH de cliente |
| .screen-custom { | |
| } | |
| .text-custom { | |
| position: relative; | |
| } | |
| .text-custom span:not(:empty) { | |
| background-color: rgba(67, 50, 42, 0.7); | |
| display: grid; |