Exemplo n.º 1
0
def syncdb(settings, args):
    """
    Run syncdb to create or update the database.
    """
    ensure_settings(settings, args)
    # TODO: Check use of filesystem2unicode here.
    path = filesystem2unicode(os.path.dirname(get_database_path_from_settings()))
    if not os.path.exists(path):
        os.makedirs(path)
    execute_from_command_line(["", "syncdb", "--noinput"])
    return 0
Exemplo n.º 2
0
def syncdb(settings, args):
    """
    Run syncdb to create or update the database.
    """
    ensure_settings(settings, args)
    # TODO: Check use of filesystem2unicode here.
    db_file = get_database_path_from_settings()
    db_dir = filesystem2unicode(os.path.dirname(db_file))
    if not os.path.exists(db_dir):
        os.makedirs(db_dir)
    if not os.path.exists(db_file):
        print('Clearing old search index...')
        execute_from_command_line(["", "clear_index", "--noinput"])
    execute_from_command_line(["", "syncdb", "--noinput"])
    return 0
Exemplo n.º 3
0
def syncdb(settings, args):
    """
    Run syncdb to create or update the database.
    """
    ensure_settings(settings, args)
    # TODO: Check use of filesystem2unicode here.
    db_file = get_database_path_from_settings()
    if db_file is not None:
        db_dir = filesystem2unicode(os.path.dirname(db_file))
        if not os.path.exists(db_dir):
            os.makedirs(db_dir)
        if not os.path.exists(db_file):
            print("Clearing old search index...")
            execute_from_command_line(["", "clear_index", "--noinput"])
    execute_from_command_line(["", "syncdb", "--noinput"])
    if args.language:
        translate_customizable_strings(args.language)
    return 0
Exemplo n.º 4
0
def syncdb(settings, args):
    """
    Run syncdb to create or update the database.
    """
    ensure_settings(settings, args)
    # TODO: Check use of filesystem2unicode here.
    db_file = get_database_path_from_settings()
    if db_file is not None:
        db_dir = filesystem2unicode(os.path.dirname(db_file))
        if not os.path.exists(db_dir):
            os.makedirs(db_dir)
        if not os.path.exists(db_file):
            print('Clearing old search index...')
            execute_from_command_line(["", "clear_index", "--noinput"])
    execute_from_command_line(["", "syncdb", "--noinput"])
    if args.language:
        translate_customizable_strings(args.language)
    return 0
Exemplo n.º 5
0
    ('en', ugettext_lazy('English')),
    ('fr', ugettext_lazy('French')),
    ('de', ugettext_lazy('German')),
    ('pt', ugettext_lazy('Portuguese')),
)

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True

LOCALE_PATHS = (
    filesystem2unicode(os.path.join(SITE_ROOT, 'locale')),
)

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/media/'

# Absolute path to the directory that holds static media from ``collectstatic``
# Example: "/home/media/static.lawrence.com/"
STATIC_ROOT = filesystem2unicode(os.path.join(SITE_ROOT, '../collected-site-static'))

# URL that handles the media served from STATIC_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://static.lawrence.com", "http://example.com/static/"
STATIC_URL = '/static/'
Exemplo n.º 6
0
    ('cs', ugettext_lazy('Czech')),
    ('en', ugettext_lazy('English')),
    ('fr', ugettext_lazy('French')),
    ('de', ugettext_lazy('German')),
    ('pt', ugettext_lazy('Portuguese')),
)

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True

LOCALE_PATHS = (filesystem2unicode(os.path.join(SITE_ROOT, 'locale')), )

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/media/'

# Absolute path to the directory that holds static media from ``collectstatic``
# Example: "/home/media/static.lawrence.com/"
STATIC_ROOT = filesystem2unicode(
    os.path.join(SITE_ROOT, '../collected-site-static'))

# URL that handles the media served from STATIC_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://static.lawrence.com", "http://example.com/static/"
STATIC_URL = '/static/'