Skip to content

Python Directories

Siqi Tian edited this page Feb 5, 2017 · 1 revision
  • Install django-filemanager with the modified version (0.0.2). The source code are available from the backup/backup_config.tgz. The original (0.0.1) is here.
  • Install gviz-api.py. The source code are available from the backup/backup_config.tgz, or download from here.
  • Other dependencies are described in requirements.txt and should be installed via pip system-wide.

The following sections breaks down each directory and their contents.

/ (root)

File Description
requirements.txt Description of python package dependency.
robots.txt Instruction for web crawlers. See here.
manage.py Django script entry point. Do not change, unless syntax changes in newer Django releases.
util_chmod.sh Runs chmod and chown to files and directories to set minimal required permissions. Most files are owned by www-data (the Apache user). config/bot.conf and config/cron.conf are writable by www-data, while others are read-only. *.sh are only accessible by ubuntu.
util_minify.sh Minifies *.css and *.js files for production. Also concatenates cetain *.css and *.js files for fewer requests in production. Requires ../yuicompressor.jar.
util_prep_dir.sh Prepares empty directories and log files for first time setup.
util_sys_asset.sh Copies over essential system settings and packages into config/sys/ that will later be zipped by dj_man backup.

backup/

Contains *.tgz backup files: backup/backup_apache.tgz, backup/backup_config.tgz, backup/backup_mysql.tgz and backup/backup_static.tgz. See src/management/commands/backup.py and src/management/commands/restore.py for usage.

cache/

Contains cache results, cron and Django log files, as well as status text files.

File Description
*.log Log files for cron and Django.
*.pickle, *.json Cached analytics results of AWS, Google Analytics, GitHub repository activities, Slack activities, Dropbox activities, Group Calendar, Schedule Spreadsheet, and Duty Spreadsheet. Files are updated every 3/15/30 minutes by cron jobs.
stat_*.json Status JSON files used for admin pages. cache/stat_ver.json contains package versions currently installed, cache/stat_sys.json contains memory and disk capacity; used by /admin/. cache/stat_backup.json contains data/ folder sizes, and daslab Google Drive file list; used by /admin/backup/.

config/

Contains app settings and account information. Do not include these files in git! Template files config/*.conf.example are tracked instead.

File Description
bot.conf Settings for Bot in JSON format. Individual functions can be toggled in /admin/bot/ page panels.
cron.conf List of cron jobs in JSON format. See django-crontab specs. The suffix of each job is for logging into corresponding log files in cache/.
env.conf Server secrets! Contains MySQL database, Apache login and email settings for additional admin. See django-environ specs.
group.conf Group access control file for Apache and WebAuth. See mod_authz_groupfile specs.
oauth.conf Access token and account information for third-party APIs in JSON format. All vendors are under daslab Gmail account. It also records Schedule SpreadsheetID, Duty SpreadsheetID, Group Calendar ICS link, AWS IDs and Google Analytics ID.
t47_dev.py Django setting flags, isolated from all others.
IS_DEVEL : DEBUG flag. Use 1 for test server, 0 for production.
IS_MAINTENANCE : Flag for temporary server downtime. Set to 1 for downtime, which returns 503 response to all urls.
IS_SLACK: Flag for using Slack for messaging. No longer used, moved to config/bot.conf.
amazon.pem AWS ssh certificate. It is placed here to restrict access to admin only.

data/

Contains user uploaded data as well as publication export.

File Description
news_img/ News images.
ppl_img/ Member avatars.
pub_data/ Publication extra data files.
pub_img/ Publication images for is_feature entries.
pub_pdf/ Publication PDF copies.
rot_data/ Rotation student extra data files.
rot_ppt/ Rotation student presentations.
spe_ppt/ Archived presentations.
def_img/ Defense posters.
export_citation.* Temporary files for /admin/export/ function (HTML or DOCX)

Clone this wiki locally