Python Software Development Specification

Source: Internet
Author: User

Directory structure
The directory structure implies logic.
Five major branches: Bin,modules,db,conf,log plus Lib
Each folder has a __init__.py
Core is the entry directory, unique file main.py
Conf is a profile directory, unique file setting.py
Log is a logging file, with multiple log files associated with the end of the suffix. Log
DB is the data file

setting.py Configuration
Enter the Conf setting.py file, configure the root directory path, how the database is stored, and the storage path
Base_dir = Os.path.dirname (Os.path.dirname (Os.path.abspath (__file__)))
Database_engine= ' file '
databases={
' file ': {' path ': '%s/db '%base_dir},
' MySQL ': {
' Host ': ' localhost ',
' Port ': ' 3306 ',
' User ': ' Root ',
' Password ': '
},
' Redis ': {
' Host ': ' localhost ',
' Port ': 6379,
' User ': ' Root ',
' Password ': '
}
}

Log function
Before preparing to write the module, consider which modules (functions) require the log function
In the log folder, separate modules to create a folder to hold the module log, a user a file

Python Software Development Specification

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.