Standardized directory

Category Code: loads fast, high readability, simple query modification

Analysis of standardized directory

1. The fixed path specification

2. settings.py profile

import os
BASEPATH = os.path.dirname(os.path.dirname(__file__))
A2_TXT_PATH = os.path.join(BASEPATH,'db','a2.txt')
BLACKLIST_PATH = os.path.join(BASEPATH,'db','blacklist')
User_PATH = os.path.join(BASEPATH,'db','user')

3. src.py main logic core logic file, common.py common component parts

from conf import setting
from lib import common

4. start.py startup file

import os
import sys
BASEPATH = os.path.dirname(os.path.dirname(__file__))
sys.path.append(BASEPATH)

from core.src import run

if __name__ == '__main__':

    run()

The register file like: user information, data related to a plurality of documents

6. logging log file: Record number of visits of users, such as prepaid withdraw money transfers

7. Directory Structure

Guess you like

Origin www.cnblogs.com/lav3nder/p/11801919.html