diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-10-09 17:47:02 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-10-09 17:47:02 +0200 |
commit | 57af459400d9160f413f384d140f80e9e2329b61 (patch) | |
tree | d6d70cf31a6038062e06eabd43f96926f9576268 | |
parent | ef17bd0f0e94a0c379b1b9b37216e2290707a558 (diff) | |
download | Chimère-57af459400d9160f413f384d140f80e9e2329b61.tar.bz2 Chimère-57af459400d9160f413f384d140f80e9e2329b61.zip |
Integration of Alban Tiberghien <alban.tiberghien@gmail.com> changes to make the application more 'pip' and 'virtualenv' friendly
Changes has been integrated in alternate files 'local_settings.py.pip.sample'
and 'apache-wsgi-pip.conf' in order to not conflict with installation
not using 'pip'.
The changes are:
- Add django-extensions
- Install tinymce as 3rd app
- Minor fix in jquery path
- Fix shabang in order to work with virtual environment
As I want to minimise the size of the tracked files in the Git
repository jQuery-UI files were not included (as a small fix Google CDN
is set by default for jquery-UI).
-rw-r--r-- | apache/apache-wsgi-pip.conf | 13 | ||||
-rw-r--r-- | example_project/local_settings.py.pip.sample | 42 | ||||
-rwxr-xr-x | example_project/manage.py | 2 | ||||
-rw-r--r-- | example_project/urls.py | 5 | ||||
-rw-r--r-- | requirements.txt | 2 |
5 files changed, 63 insertions, 1 deletions
diff --git a/apache/apache-wsgi-pip.conf b/apache/apache-wsgi-pip.conf new file mode 100644 index 0000000..df690d2 --- /dev/null +++ b/apache/apache-wsgi-pip.conf @@ -0,0 +1,13 @@ +<VirtualHost *:80> + ServerName chimere.example.com + WSGIDaemonProcess chimere processes=2 maximum-requests=500 threads=1 + WSGIProcessGroup chimere + WSGIScriptAlias / /var/local/chimere/apache/mydjango.wsgi + Alias /static "/var/local/chimere/mychimere_project/static" + Alias /admin/doc "/var/local/chimere/docs/_build/html/" + + ErrorLog ${APACHE_LOG_DIR}/chimere/error.log + LogLevel warn + CustomLog ${APACHE_LOG_DIR}/chimere/access.log combined + +</VirtualHost> diff --git a/example_project/local_settings.py.pip.sample b/example_project/local_settings.py.pip.sample new file mode 100644 index 0000000..6b6cffc --- /dev/null +++ b/example_project/local_settings.py.pip.sample @@ -0,0 +1,42 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# rename this file to local_settings.py and overload settings in this file + +import os + +STATIC_URL = '/static/' + +CHIMERE_OSM_API_URL = 'api06.dev.openstreetmap.org' # test URL +CHIMERE_OSM_USER = 'osm_user' +CHIMERE_OSM_PASSWORD = 'osm_pass' + +# Make this string unique, and don't share it with anybody. +SECRET_KEY = '' + +ADMINS = ( + # ('Your Name', 'your_email@domain.com'), +) + +MANAGERS = ADMINS + +DATABASES = { + 'default': { + 'NAME': 'chimere', + 'ENGINE': 'django.contrib.gis.db.backends.postgis', + 'HOST': 'localhost', + 'PORT': '5432', + 'USER': 'postgres', + 'PASSWORD': '', + }, +} + +ROOT_URLCONF = 'example_project.urls' + +INSTALLED_APPS += ['django_extensions', + 'tinymce'] + +TINYMCE_URL = '%stiny_mce/' % STATIC_URL +JQUERY_JS_URLS = ('%sjquery/jquery.js' % STATIC_URL, + 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js') +JQUERY_CSS_URLS = ('https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css') diff --git a/example_project/manage.py b/example_project/manage.py index 300eab0..301acc2 100755 --- a/example_project/manage.py +++ b/example_project/manage.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import os, sys from django.core.management import execute_manager sys.path.insert(0, os.path.abspath('./..')) diff --git a/example_project/urls.py b/example_project/urls.py index a49cb4f..e37ae53 100644 --- a/example_project/urls.py +++ b/example_project/urls.py @@ -28,6 +28,11 @@ urlpatterns = patterns('django.views.static', (r'^%s(?P<path>.*)' % settings.MEDIA_URL[1:], 'serve', {'document_root': settings.MEDIA_ROOT}), ) + +if "tinymce" in settings.INSTALLED_APPS: + urlpatterns += patterns('django.views.static', + (r'^tinymce/', include('tinymce.urls')),) + urlpatterns += staticfiles_urlpatterns() urlpatterns += patterns('', diff --git a/requirements.txt b/requirements.txt index 7c073dd..b7d71a1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,5 @@ south==0.7.3 simplejson unidecode feedparser +django-extensions +django-tinymce |