def init_information(self): """Creates initial data in data base.""" import datetime from django.utils import timezone from cloto.models import ServerInfo runningfrom = datetime.datetime.now(tz=timezone.get_default_timezone()) # Creating initial data s = ServerInfo(id=1, owner=settings.OWNER, version=settings.VERSION, runningfrom=runningfrom, doc=settings.API_INFO_URL) s.save()
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cloto.settings") # This application object is used by any WSGI server configured to use this # file. This includes Django's development server, if the WSGI_APPLICATION # setting points here. from django.core.wsgi import get_wsgi_application application = get_wsgi_application() import datetime from django.utils import timezone from cloto.models import ServerInfo from django.conf import settings from cloto.log import logger from cloto import environment_controller runningfrom = datetime.datetime.now(tz=timezone.get_default_timezone()) # Creating initial data s = ServerInfo(id=1, owner=settings.OWNER, version=settings.VERSION, runningfrom=runningfrom, doc=settings.API_INFO_URL) s.save() # Starting environments Controller controller = environment_controller.environment_controller() if not controller.is_started(): controller.start_manager() logger.info("SERVER STARTED")
# This application object is used by any WSGI server configured to use this # file. This includes Django's development server, if the WSGI_APPLICATION # setting points here. from django.core.wsgi import get_wsgi_application application = get_wsgi_application() import datetime from django.utils import timezone from cloto.models import ServerInfo from django.conf import settings from cloto.log import logger from cloto import environment_controller runningfrom = datetime.datetime.now(tz=timezone.get_default_timezone()) # Creating initial data s = ServerInfo(id=1, owner=settings.OWNER, version=settings.VERSION, runningfrom=runningfrom, doc=settings.API_INFO_URL) s.save() # Starting environments Controller controller = environment_controller.environment_controller() if not controller.is_started(): controller.start_manager() logger.info("SERVER STARTED")