コード例 #1
0
    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()
コード例 #2
0
ファイル: wsgi.py プロジェクト: flopezag/fiware-cloto
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")
コード例 #3
0
# 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")