Install Python’s Django on Windows

This document will guide you through installing Python and Django for basic usage on Windows. This is meant as a beginner’s guide for users working on Django projects and does not reflect how Django should be installed when developing patches for Django itself.
The steps in this guide have been tested with Windows 7 and 8. In other versions, the steps would be similar.

Install Python

Django is a Python web framework, thus requiring Python to be installed on your machine.

To install Python on your machine go to https://python.org/download/, and download a Windows MSI installer for Python. Once downloaded, run the MSI installer and follow the on-screen instructions.

After installation, open the command prompt and check the Python version by executing python --version. If you encounter a problem, make sure you have set the PATH variable correctly. You might need to adjust your PATHenvironment variable to include paths to the Python executable and additional scripts. For example, if your Python is installed in C:Python34, the following paths need to be added to PATH:

C:Python34;C:Python34Scripts;

Install Setuptools

To install Python packages on your computer, Setuptools is needed. Download the latest version of Setuptools for your Python version and follow the installation instructions given there.

Install PIP

PIP is a package manager for Python that uses the Python Package Index to install Python packages. PIP will later be used to install Django from PyPI. Python 3.4 and later include pip by default [1], so you may have pip already.

Install Django

Django can be installed easily using pip.

In the command prompt, execute the following command: pip install django. This will download and install Django.

After the installation has completed, you can verify your Django installation by executing django-admin --version in the command prompt.

Changed in Django 1.7:In Django 1.7, a .exe has been introduced, so just use django-admin in place of django-admin.py in the command prompt.

See Get your database running for information on database installation with Django.

Common pitfalls

  • If django-admin only displays the help text no matter what arguments it is given, there is probably a problem with the file association in Windows. Check if there is more than one environment variable set for running Python scripts inPATH. This usually occurs when there is more than one Python version installed.

  • If you are connecting to the internet behind a proxy, there might be problem in running the commands easy_installpip and pip install django. Set the environment variables for proxy configuration in the command prompt as follows:

    set http_proxy=http://username:password@proxyserver:proxyport
    set https_proxy=https://username:password@proxyserver:proxyport

    Git Installation

    • download from http://git-scm.com/download/win

    • Run UNIX command under Window Environment.

Title 21 CFR Part 11 Requirement

Title 21 CFR Part 11 is the part of Title 21 of the Code of Federal Regulations that establishes the United States Food and Drug Administration(FDA) regulations on electronic records and electronic signatures (ERES). Part 11, as it is commonly called, defines the criteria under which electronic records and electronic signatures are considered trustworthy, reliable, and equivalent to paper records (Title 21 CFR Part 11 Section 11.1 (a)).

Practically speaking, Part 11 applies to drug makers, medical device manufacturers, biotech companies, biologics developers, CROs, and other FDA-regulated industries, with some specific exceptions. It requires that they implement controls, including audits, system validations, audit trails, electronic signatures, and documentation for software and systems involved in processing the electronic data that FDA predicate rules require them to maintain. A predicate rule is any requirement set forth in the Federal Food, Drug and Cosmetic Act, the Public Health Service Act, or any FDA regulation other than Part 11. [1]

The rule also applies to submissions made to the FDA in electronic format (e.g., a New Drug Application) but not to paper submissions by electronic methods (i.e., faxes). It specifically does not require the 21CFR11 requirement for record retention for tracebacks by food manufacturers. Most food manufacturers are not otherwise explicitly required to keep detailed records, but electronic documentation kept for HACCP and similar requirements must meet these requirements.

As of 2007, broad sections of the regulation have been challenged as excessive[who?], and the FDA has stated in guidance that it will exercise enforcement discretion on many parts of the rule. This has led to confusion on exactly what is required, and the rule is being revised. In practice, the requirements on access controls are the only part routinely enforced.[citation needed] The “predicate rules” that required organizations to keep records the first place are still in effect. If electronic records are illegible, inaccessible, or corrupted, manufacturers are still subject to those requirements.

If a regulated firm keeps “hard copies” of all required records, those paper documents can be considered the authoritative document for regulatory purposes, and the computer system is not in scope for electronic records requirements—though systems that control processes subject to predicate rules still require validation.[citation needed] Firms should be careful to make a claim that “hard copies” of required records are authoritative document. For the “hard copy” produced from electronic source to be the authoritative document, the “hard copy” must be a complete and accurate copy of the electronic source. The manufacturer must use the hard copy (rather than electronic versions stored in the system) of the records for regulated activities. The current technical architecture of computer systems increasingly makes the burden of proof for the complete and accurate copy requirement extremely high.[2]

Information Source: https://en.wikipedia.org/wiki/Title_21_CFR_Part_11

IT人在工廠日記 – IT人員通常的職業病痛

在二十多年的工作生涯中,我除了賺到工資外,但是也帶來很多職業病痛。其一就是肩背痛,四年前開始發作,那時痛了二、三星期才痊愈,之後只是間歇的少痛,尤其是不跟大陸同事渴白酒後,已沒大問題,可是現在剛剛轉了新工作,肩背痛又發作,令我痛了一星期,醫生說是初期的肩周炎,現在要認真治理了。另外,二年前我曾經生蛇,應該是因為工作和生活壓力的,幸好沒有後遺症。再之後,一年半前,開始腰痛發作,不知是因為工作或是床鋪問題,總之就是痛。最後,還有一樣很普遍的辦公室人員的職業病,就是痔瘡,我已經記不起什麼時候開始的,因為一直沒大困擾,只是近年開始令我坐立不安,尤其是多行更差,很討厭呢。

雖然工作重要,但是身體健康更重要,我要多多留意健康,處理病痛呢!

Video Conference Device Comparsion between Polycom Vs Tandberg

Bandwidth Optimization – Polycom can send 720HD at lower speeds but Tandberg can send more than CIF4CIF7201080, which I’ll take that over the lower HD speeds any day.
Central Admin – Tandbery is great for admin (if you have several hundred end-point, you definitely choose Tandbery. Polycom was beta and their provisioning wasn’t ready yet.
End User Usability – This is real close and I give favor to Polycom.
Reliability/Maintenance – I once had some one tell me Polycom is like Mircosoft and Tandberg is like Cisco. Polycom looks good but has bugs while Tandberg might not be as flashy but is rock solid. I’d pick Tandberg.
Cost – if you could compare apples to apples they’d be close but looking at just the bottom line Polycom is the winner.

Conclusion: If you have only a few connection VC points and have a loose network control (e.g. not using Cisco device), I suggest to use Polycom because it is easy to setup. For company with many VC end-points (say > 50), I will prefer to choose Tandberg which is more security and easy to manage.

Diary of IT Guy in Factory – poor Dongguan beggar

When I go and return from China factory and pass across the china border, I always see some poor beggers on street. Most are disabled, e.g. without arm or leg, I know that this kind of disabled is human-made. Those beggers was controlled and forced by bad guys. They are living in a very very poor life. Please China Government help those beggers.

————–

http://www.youtube.com/watch?v=jKW2pQElPYA

Odoo System Schedule Backup and Restore Database Setup

This module will be work internally as command line interface (for Linux only) through linux crontab to backup and restore database.

  1. Backup database
  2. Restore as database _TEST
  3. Update image (i.e., with test logo) to _TEST

Just install this module, and it should work. Setup schedule time as you need it. Note: Itself, can also be used as scheduler instead of normal scheduler in OpenERP (you will see this backup and restore as one example).

Features

  • Add, Modify, Delete schedule
  • Direct process through command line interface

Setup Procedure

Menu -> Setting/Technical/Scheduler/Crontab Configuration

Fields:

  1. Crontab Name – name of crontab

  2. Description – more information

  3. Scheduling – crontab scheduling

    3.1 Minute: 0-59

    3.2 Hour: 0-23

    3.3 Day: 1-31

    3.4 Month: 1-12

    3.5 Weekday: 0-6, where 0 = Sunday

  4. Execute Directory – OpenERP’s root path to be used for log file, Temp File, DB Backup File and etc (depends on type of program)

  5. Command – command to run the program in command line interface pattern, require full path.

  6. Active – when True, will create crontab scheduler in OS. When False will delete it.

  7. Status

    7.1 Draft

    7.2 Confirmed

    7.3 Cancelled

  8. Attach File – Additional files, to be used in process (optional)

Note: crontab scheduler will be created only when State = Confirmed and Active = True

Technical Detail

Backup Database Script:

Use script, db_backup.py (written in Python)

 db_backup.py -u -d -p

Example:

 ‘/home/buasri/workspace/ecosoft_official_addons/ecosoft-addons/crontab_config/db_backup.py’ -u openerp -d TT -p ‘/home/buasri/workspace/openerp_tt’>>’/home/buasri/workspace/openerp_tt/crontab_oe.log’

Process:

  1. Create backup database as _dbbackup-YYYY-MM-DD hh:mm:ss.dmp
  2. Create file oe_db_last_bkup.txt to be used for restoration

Restore Database Process:

Use script, db_restore.py (written in Python)

 db_restore.py -u -d -p

-i id of crontab in OpenERP, from table crontab_config -c id of Company in OpenERP, from table res_company

Example:

 ‘/home/buasri/workspace/ecosoft_official_addons/ecosoft-addons/crontab_config/db_restore.py’ -u openerp -d TT_TEST -p ‘/home/buasri/workspace/openerp_tt’>>’/home/buasri/workspace/openerp_tt/crontab_oe.log’

Process

  1. Disconnect database to be restored
  2. Delete database
  3. Create new database
  4. Restore it.
  5. Read attached logo file
  6. Resize logo file
  7. Update logo file

IT Routine Work Highlight

IT Routine Work

  • Check Daily Backup
  • Perform Monthly Backup for permanent storage at least 3 years
  • Check the archive and life email client database (.pst file which should not bigger too big, especially outlook 2003 or lower version .pst file should not larger than 2G size)
  • Perform Monthly Email Archive in outlook server
  • Check Backup of ERP system, and clean-up log file if necessary
  • Handle ERP, HR, Email, Share File System, CCTV, Printer, network and phone line routine support
  • Backup machine O/S, VMWare Machine Databases at least quarterly
  • Perform Off-Site Backup Storage
  • Reboot servers at least quarterly
  • New Staff computer preparation for email account creation, share-drive access right, printer, door access card, phone
  • Staff Exist Preparation for email transfer/deletion, backup computer data
  • Handle Ad-Hoc IT project

IT Critical Document:

  • password list
  • Inventory list
  • Internet/External Support contact list

Network Monitoring Software Review

Networks are becoming critical components of business success – irrespective of
whether you are small or BIG. When network fails, customers and employees cannot
communicate, employees cannot access critical information or use basic print or email
services, resulting in productivity loss and revenue loss. Network monitoring software
tools reduce network outages and allow businesses to operate more fluently, cut costs,
and prevent revenue loss. And for those who are small and are not allowed to think of a
budget for network monitoring software, a better alternative is to start with open source
and freeware network monitoring software that reduce the time and money spent on
network administration and management. This paper talks about the top freeware and
open source network monitoring software available today.

[spiderpowa-pdf src=”https://infotechmanagefactory.com/wp-content/uploads/2015/03/Network-Monitoring-Software.pdf”]Network-Monitoring-Software