Posts

Showing posts from December 7, 2018

Django specific error on running code in settings.py

Image
up vote 0 down vote favorite I am trying to create an html file when the django project is started, by including code in the project/settings.py as follows: def Brander(): import configparser config = configparser.ConfigParser() config.read('settings.ini') version = config['PROJECT']['version'] APPNAME = config['BRANDING']['appname'] APPCOMPANY = config['BRANDING']['appcompany'] APPCOMPANYLINK = config['BRANDING']['appcompanysite'] APPLINK = config['BRANDING']['appsite'] from django.contrib.staticfiles import finders filen = finders.find('clinic/brandedfooter.html') f = open(filen, "w") s = f""" <div class="col-lg-8 col-md-8 d-none d-md-blo