Пример #1
0
def create_initial_data():
    root = get_root_node()
    decided = create_user("Beschluss_Programm",
                          description="Diese Vorschläge wurden in ihrer urspünglichen "
                                      "Fassung schon von einem Parteitag beschlossen. "
                                      "Weiterentwicklungen dieser Vorschläge sind "
                                      "natürlich kein beschlossenes Programm.",
                          groups=['texters', 'voters', 'bloggers'])

    with open(project_path("initial_data/root.txt"), 'r') as f:
        lines = f.readlines()
        for l in lines:
            if comment_line_pattern.match(l):
                continue

            slot_name, src_file = l.split()
            assert re.match('^' + SHORT_TITLE + '$', slot_name), \
                "Invalid short title '%s'." % slot_name

            src_path = project_path(os.path.join('initial_data', src_file))
            assert os.path.exists(src_path), \
                "Source file not found: '%s'." % src_path

            print("Creating '%s' from file '%s'." % (slot_name, src_path))
            slot = create_slot(slot_name)
            root.append_child(slot)
            with open(src_path, 'r') as src:
                schema = parse(unicode(src.read(), encoding='utf-8'), slot.title)
                create_structure_from_structure_node_schema(schema, slot, decided)
Пример #2
0
    def handle(self, *args, **options):
        if len(args) < 2:
            print("You have to provide a <TopicName> and a "
                  "<InitalTextFilename>!")

        if len(args) > 2:
            print("Please provide exactly two arguments!")

        topic_name = args[0]
        assert re.match(SHORT_TITLE, topic_name), \
            "Invalid topic name '%s'. Topic name should be only alphanumeric " \
            "chars up to a length of 20." % topic_name

        filename = args[1]
        src_path = project_path(filename)
        if not os.path.exists(src_path):
            print("File '%s' does not exist!" % src_path)

        create_topic(src_path, topic_name)
Пример #3
0
    def handle(self, *args, **options):
        if len(args) < 2:
            print("You have to provide a <TopicName> and a "
                  "<InitalTextFilename>!")

        if len(args) > 2:
            print("Please provide exactly two arguments!")

        topic_name = args[0]
        assert re.match(SHORT_TITLE, topic_name), \
            "Invalid topic name '%s'. Topic name should be only alphanumeric " \
            "chars up to a length of 20." % topic_name

        filename = args[1]
        src_path = project_path(filename)
        if not os.path.exists(src_path):
            print("File '%s' does not exist!" % src_path)

        create_topic(src_path, topic_name)
Пример #4
0
ADMINS = (
    ('Your Name', '*****@*****.**'),
)

# The password used for the auto-created 'admin' user on first database sync.
# Make sure to change your password after first login
ADMIN_PASS = "******"

# You can define your database here. The default configuration (sqlite) works
# fine for testing and development environments
DATABASES = {
    'default': {
        # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'ENGINE': 'django.db.backends.sqlite3',
        # DBName of path to database file if using sqlite3.
        'NAME': project_path("Database.sqlite3"),
        'USER': '',                      # Not used with sqlite3.
        'PASSWORD': '',                  # Not used with sqlite3.
        # Set to empty string for localhost. Not used with sqlite3.
        'HOST': '',
        # Set to empty string for default. Not used with sqlite3.
        'PORT': '',
    }
}
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'MQ4DNT74V5FFRZNFKC01CI6DYERAXEJZO5DNURVV2G4NTZ5B6OFGFPGJGKRT'

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
Пример #5
0
# We will send Exceptions created by the Api to this Email
ADMINS = (('Your Name', '*****@*****.**'), )

# The password used for the auto-created 'admin' user on first database sync.
# Make sure to change your password after first login
ADMIN_PASS = "******"

# You can define your database here. The default configuration (sqlite) works
# fine for testing and development environments
DATABASES = {
    'default': {
        # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'ENGINE': 'django.db.backends.sqlite3',
        # DBName of path to database file if using sqlite3.
        'NAME': project_path("Database.sqlite3"),
        'USER': '',  # Not used with sqlite3.
        'PASSWORD': '',  # Not used with sqlite3.
        # Set to empty string for localhost. Not used with sqlite3.
        'HOST': '',
        # Set to empty string for default. Not used with sqlite3.
        'PORT': '',
    }
}
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'MQ4DNT74V5FFRZNFKC01CI6DYERAXEJZO5DNURVV2G4NTZ5B6OFGFPGJGKRT'

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
Пример #6
0
def jasmine(request):
    with open(project_path("static/jasmine.html"), "r") as index_html_file:
        return HttpResponse(index_html_file.read(), content_type="text/html")
Пример #7
0
def jasmine(request):
    with open(project_path("static/jasmine.html"), 'r') as index_html_file:
        return HttpResponse(index_html_file.read(), content_type='text/html')