diff --git a/base/context_processors.py b/base/context_processors.py index 4294c2b5eb..cfa4481d2e 100644 --- a/base/context_processors.py +++ b/base/context_processors.py @@ -7,7 +7,7 @@ These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by RequestContext. """ from settings import SEAFILE_VERSION, SITE_TITLE, SITE_NAME, SITE_BASE, \ - ENABLE_SIGNUP, MAX_FILE_NAME + ENABLE_SIGNUP, MAX_FILE_NAME, BRANDING_CSS, LOGO_PATH, LOGO_URL try: from settings import BUSINESS_MODE except ImportError: @@ -35,6 +35,9 @@ def base(request): return { 'seafile_version': SEAFILE_VERSION, 'site_title': SITE_TITLE, + 'branding_css': BRANDING_CSS, + 'logo_path': LOGO_PATH, + 'logo_url': LOGO_URL, 'business_mode': BUSINESS_MODE, 'cloud_mode': request.cloud_mode, 'org': org, diff --git a/settings.py b/settings.py index 15f7470572..dbba3bdbb4 100644 --- a/settings.py +++ b/settings.py @@ -3,6 +3,9 @@ import sys import os import re +import random +import string + DEBUG = False TEMPLATE_DEBUG = DEBUG @@ -204,7 +207,11 @@ REGISTRATION_SEND_MAIL = False CCNET_APPLET_ROOT = "http://127.0.0.1:13420" # Account initial password, for password resetting. -INIT_PASSWD = '123456' +# INIT_PASSWD can either be a string, or a function (function has to be set without the brackets) +def genpassword(): + return ''.join([random.choice(string.digits + string.letters) for i in range(0, 10)]) + +INIT_PASSWD = genpassword # browser tab title SITE_TITLE = 'Private Seafile' @@ -213,6 +220,14 @@ SITE_TITLE = 'Private Seafile' SITE_BASE = 'http://seafile.com' SITE_NAME = 'Seafile' +# Path to the Logo Imagefile (relative to the media path) +LOGO_PATH = 'img/logo.png' +# URL to which the logo links +LOGO_URL = SITE_BASE + +# css to modify the seafile css +BRANDING_CSS = '' + # Using Django to server static file. Set to `False` if deployed behide a web # server. SERVE_STATIC = True diff --git a/templates/base.html b/templates/base.html index e87309dd81..f333b5c56e 100644 --- a/templates/base.html +++ b/templates/base.html @@ -15,6 +15,7 @@ {% block extra_style %}{% endblock %} +{% if branding_css != '' %}{% endif %}
@@ -62,8 +63,8 @@