This file contains hidden or 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
# -*- coding:utf-8 -*- | |
import re | |
from django import forms | |
USERID_REGEX = re.compile(r"^[\w-]+$") | |
class UserForm(forms.Form): | |
userid = forms.RegexField(max_length=64, regex=USERID_REGEX) |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Angular HTML5 Preview, Crop And Upload</title> | |
<style> | |
body { | |
padding: 50px; | |
font: 16px Helvetica; | |
} |
This file contains hidden or 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
#!/bin/bash | |
################################################################################ | |
# Script for installing Odoo V10 on Ubuntu 16.04, 15.04, 14.04 | |
# Author: Yenthe Van Ginneken | |
# Adjusted: Ray Carnes | |
# Assumes you already have an Ubuntu user called "odoo" with a home folder | |
#------------------------------------------------------------------------------- | |
# Make a new file: | |
# sudo nano odoo-install.sh | |
# Place this content in it and then make the file executable: |
This file contains hidden or 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
# Author: Ryan Cole | |
# Website: https://ryanc.me | |
# GitHub: https://github.com/MGinshe | |
# Usage: | |
# Place this file in /etc/nginx/sites-enabled/ | |
# Make sure you edit the DOMAIN_HERE and SSL_CERTIFICATE, and DB_FILTER sections | |
# | |
# Note: This config file is designed to be used with the Odoo dbfilter_from_header module | |
# https://apps.openerp.com/apps/modules/9.0/dbfilter_from_header/ |
This file contains hidden or 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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# utf-8 中文编码 | |
import glob | |
import os,sys | |
import json | |
reload(sys) | |
sys.setdefaultencoding('utf-8') | |
import time, sys,iptc # iptc 包通过 sudo pip install python-iptables 安装 | |
from datetime import datetime |
This file contains hidden or 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
I had this really small problem today. I wanted to migrate one of my small django apps to use postgres, just to make everything easy to manage. Sqlite3 is perfectly fine for the amount of load, however I am really much faster at administering postgres than I am on sqlite3. So I decided to migrate the stuff over. | |
I tried a few approaches, but what ultimately worked the best and the fastest fo rmy particular problem was to do the following. | |
Use original SQLITE3 connection in settings.py | |
1. python manage.py dumpdata > dump.json | |
(I read some things here about some options you can pass, at the end what just worked was the following) | |
2. Change DB connection string in settings.py to POSTGRES |
OlderNewer