From 7e506590099f8b8a6b7a4ecff52211e825cfc210 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Sun, 14 Oct 2012 16:27:17 +0200 Subject: [PATCH] wip: command line tool Few fixes. see #314 --- modoboa/core/commands/deploy.py | 1 + modoboa/core/templates/settings.py | 10 +++++----- modoboa/core/templates/urls.py | 15 +-------------- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/modoboa/core/commands/deploy.py b/modoboa/core/commands/deploy.py index 3a58161af..4b8650712 100644 --- a/modoboa/core/commands/deploy.py +++ b/modoboa/core/commands/deploy.py @@ -110,6 +110,7 @@ class DeployCommand(Command): if parsed_args.run_syncdb: self._exec_django_command("syncdb", parsed_args.name, '--migrate', '--noinput') + self._exec_django_command("loaddata", parsed_args.name, 'initial_users.json') if parsed_args.run_collectstatic: self._exec_django_command("collectstatic", parsed_args.name, '--noinput') diff --git a/modoboa/core/templates/settings.py b/modoboa/core/templates/settings.py index 3ca4b3ba5..d80dda3f4 100644 --- a/modoboa/core/templates/settings.py +++ b/modoboa/core/templates/settings.py @@ -1,4 +1,4 @@ -# Django settings for toto project. +# Django settings for {{ name }} project. import os DEBUG = True @@ -101,7 +101,7 @@ TEMPLATE_LOADERS = ( MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', + # 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', # Uncomment the next line for simple clickjacking protection: @@ -112,10 +112,10 @@ MIDDLEWARE_CLASSES = ( 'modoboa.lib.middleware.ExtControlMiddleware', ) -ROOT_URLCONF = 'urls' +ROOT_URLCONF = '{{ name }}.urls' -# Python dotted path to the WSGI application used by Django's runserver. -WSGI_APPLICATION = '{{ name }}.wsgi.application' +{% if django14 %}# Python dotted path to the WSGI application used by Django's runserver. +WSGI_APPLICATION = '{{ name }}.wsgi.application'{% endif %} TEMPLATE_DIRS = ( # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". diff --git a/modoboa/core/templates/urls.py b/modoboa/core/templates/urls.py index 1e2629e5f..280ff642e 100644 --- a/modoboa/core/templates/urls.py +++ b/modoboa/core/templates/urls.py @@ -1,18 +1,5 @@ -from django.conf.urls import patterns, include, url - -# Uncomment the next two lines to enable the admin: -# from django.contrib import admin -# admin.autodiscover() +from django.conf.urls.defaults import patterns, include, url urlpatterns = patterns('', - # Examples: - # url(r'^$', 'toto.views.home', name='home'), - # url(r'^toto/', include('toto.foo.urls')), - - # Uncomment the admin/doc line below to enable admin documentation: - # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), - - # Uncomment the next line to enable the admin: - # url(r'^admin/', include(admin.site.urls)), url(r'', include('modoboa.urls')), )