Using bower to manage javascript dependencies.

This commit is contained in:
Antoine Nguyen
2014-10-19 09:05:32 +02:00
parent 8fe30c86ea
commit bd4bfcb7fd
1070 changed files with 281991 additions and 6968 deletions
+13 -4
View File
@@ -144,11 +144,14 @@ class DeployCommand(Command):
if parsed_args.with_amavis:
if parsed_args.amavis_dburl:
amavis_info = dj_database_url.config(default=parsed_args.amavis_dburl[0])
# In case the user fails to supply a valid database url, fallback to manual mode
amavis_info = dj_database_url.config(
default=parsed_args.amavis_dburl[0])
# In case the user fails to supply a valid database
# url, fallback to manual mode
if not amavis_info:
amavis_info = self.ask_db_info('amavis')
#If we set this earlier, our fallback method will never be triggered
# If we set this earlier, our fallback method will
# never be triggered
amavis_info['conn_name'] = 'amavis'
else:
amavis_info = self.ask_db_info('amavis')
@@ -164,13 +167,19 @@ class DeployCommand(Command):
'Under which domain do you want to deploy modoboa? '
)
bower_components_dir = os.path.realpath(
os.path.join(os.path.dirname(__file__), "../../bower_components")
)
mod = __import__(parsed_args.name, globals(), locals(), ['settings'])
tpl = self._render_template(
"%s/settings.py.tpl" % self._templates_dir, {
'default_conn': default_conn, 'amavis_conn': amavis_conn,
'secret_key': mod.settings.SECRET_KEY,
'name': parsed_args.name, 'django14': django14,
'allowed_host': allowed_host
'allowed_host': allowed_host,
'bower_components_dir': bower_components_dir,
'devmode': False
}
)
with open("%s/settings.py" % path, "w") as fp:
@@ -1,8 +1,11 @@
# Django settings for {{ name }} project.
import os
from logging.handlers import SysLogHandler
{% if devmode %}
from modoboa.core.dev_settings import *
{% endif %}
DEBUG = False
DEBUG = {{ devmode }}
TEMPLATE_DEBUG = DEBUG
MODOBOA_DIR = os.path.dirname(__file__)
@@ -83,6 +86,7 @@ STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
"{{ bower_components_dir }}",
)
# List of finder classes that know how to find static files in
+16
View File
@@ -0,0 +1,16 @@
# Development settings
import os
BOWER_COMPONENTS_ROOT = os.path.join(
os.path.dirname(__file__), ".."
)
BOWER_INSTALLED_APPS = (
"jquery#1.9",
"jquery.ui#1.9",
"bootstrap#3.2.0",
"bootstrap-select#1.5.4",
"d3#3.3.13",
"eonasdan-bootstrap-datetimepicker#3.1.3",
"font-awesome#4.2.0",
)