if os getcwd(='/app' import dj_database_url databases 'default'dj_database_url config(default='postgres://localhost' honor the ' -forwarded-protoheader for request is_secure(secure_proxy_ssl_header ('http_x_forwarded_proto''https' allow all host headers allowed_hosts ['*' static asset configuration base_dir os path dirname(os path abspath(__file__)static_root 'staticfilesstaticfiles_dirs os path join(base_dir'static')at we use the function getcwd()which gets the current working directory the file is running from in heroku deploymentthe directory is always /app in local deploymentthe directory is usually the name of the project folder (learning_log in our casethe if test ensures that the settings in this block apply only when the project is deployed on heroku this structure allows us to have one settings file that works for our local development environment as well as the live server at we import dj_database_url to help configure the database on heroku heroku uses postgresql (also called postgres) more advanced database than sqliteand these settings configure the project to use postgres on heroku the rest of the settings support https requests wensure that django will serve the project from heroku' url xand set up the project to serve static files correctly on heroku making procfile to start processes procfile tells heroku which processes to start in order to serve the project properly this is one-line file that you should save as procfilewith an uppercase and no file extensionin the same directory as manage py here' what goes in procfileprocfile webgunicorn learning_log wsgi --log-file this line tells heroku to use gunicorn as server and to use the settings in learning_log/wsgi py to launch the app the log-file flag tells heroku the kinds of events to log styling and deploying an app