This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import forms | |
from django.core import validators | |
from django.core.exceptions import ValidationError | |
class MinLengthValidator(validators.MinLengthValidator): | |
message = 'Ensure this value has at least %(limit_value)d elements (it has %(show_value)d).' | |
class MaxLengthValidator(validators.MaxLengthValidator): | |
message = 'Ensure this value has at most %(limit_value)d elements (it has %(show_value)d).' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# project-repo/app/settings/.env-example | |
# | |
# DJANGO | |
# | |
SITE_HOST=localhost:8000 | |
USE_SSL=False | |
ALLOWED_HOSTS=localhost,127.0.0.1 | |
SECRET_KEY=asdasd | |
DEBUG=true # never on production, will cause settings including api keys to leak | |
DJANGO_LOG_LEVEL=DEBUG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[options] | |
# | |
# WARNING: | |
# If you use the Odoo Database utility to change the master password be aware | |
# that the formatting of this file WILL be LOST! A copy of this file named | |
# /etc/odoo/openerp-server.conf.template has been made in case this happens | |
# Note that the copy does not have any first boot changes | |
#----------------------------------------------------------------------------- | |
# Odoo Server Config File - TurnKey Linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div style="margin:0px;padding: 0px;"> | |
<p style="padding:0px;font-size: 13px;"> | |
Estimado/a | |
% if object.partner_id.parent_id: | |
${object.partner_id.name} (${object.partner_id.parent_id.name}) | |
% endif | |
<br><br> | |
Junto con saludarle y agradecer su preferencia, adjuntamos | |
% if object.name: | |
factura <strong>${object.name}</strong> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xlsxwriter | |
from io import BytesIO | |
from django.http import StreamingHttpResponse | |
from django.views.generic import View | |
def get_foo_table_data(): | |
""" | |
Some table data | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium.webdriver import Chrome | |
from selenium.webdriver.chrome.options import Options | |
options = Options() | |
options.binary_location = '/opt/headless-chromium' | |
options.add_argument('--headless') | |
options.add_argument('--no-sandbox') | |
options.add_argument('--start-maximized') | |
options.add_argument('--start-fullscreen') |
OlderNewer