Permalink
Browse files

static files are running in prod and dev env, Bespin installation scr…

…ipts added
  • Loading branch information...
1 parent a6ef8cb commit 05335690949be9f1853f24b49df2022fde633b2c @zalun zalun committed Feb 10, 2010
@@ -7,3 +7,4 @@ def placeholder(req):
@return HttpResponse: "<h1>Flightdeck</h1>"
"""
return HttpResponse("<h1>Flightdeck</h1>")
+
@@ -3,6 +3,8 @@
<head>
{# load some css and javascript here #}
<title>{{ version }} - {{ settings.SITE_TITLE }}</title>
+ <link href="/media/bespin/BespinEmbedded.css" rel="stylesheet" type="text/css">
+ <script src="/media/bespin/BespinEmbedded.js"></script>
</head>
<body>
{# some menus default for editing #}
@@ -13,6 +15,6 @@
{% else %}switch to: <a href="{{ jetpack.get_absolute_url }}">jetpack base</a>
{% endif %}
</p>
- <pre>{{ version.code }}</pre>
+ <pre class='bespin'>{{ version.code }}</pre>
{# footer? #}
</body>
View
@@ -1,11 +1,12 @@
from django.conf.urls.defaults import *
-
-# Uncomment the next two lines to enable the admin:
+from django.views import static
+from django.conf import settings
from django.contrib import admin
-admin.autodiscover()
from flightdeck.base import views as base_views
+admin.autodiscover()
+
try:
import grappelli
urls = [(r'^grappelli/', include('grappelli.urls'))]
@@ -21,6 +22,10 @@
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/', include(admin.site.urls)),
+ # static files
+ # this should be used only in development server
+ url(r'^media/(?P<path>.*)$', static.serve, {'document_root': settings.MEDIA_ROOT}, name='media'),
+
# Jetpack
(r'^user/', include('person.urls')),
(r'^', include('jetpack.urls')),
View
@@ -13,7 +13,35 @@ done
### PIP packages installation
export PYTHONPATH=
pip install -E $V_ENV/ -r $PROJECT_DIR/tools/pip-requirements.txt
-# TODO: write a proper bash script which will install from configurable files
+
+### flightdeck media dir
+if [ ! -e $PROJECT_DIR/$PROJECT_NAME/media/ ]
+then
+ mkdir $PROJECT_DIR/$PROJECT_NAME/media/
+fi
+
+### Bespin installation
+cd $V_ENV/lib/
+if [ ! -e $V_ENV/lib/BespinEmbedded-0.5.2 ]
+then
+ wget http://ftp.mozilla.org/pub/mozilla.org/labs/bespin/Embedded/BespinEmbedded-0.5.2.tar.gz
+ tar xfz BespinEmbedded-0.5.2.tar.gz
+ rm BespinEmbedded-0.5.2.tar.gz
+fi
+if [ ! -e $V_ENV/lib/BespinEmbedded ]
+then
+ ln -fs $V_ENV/lib/BespinEmbedded-0.5.2/ $V_ENV/lib/BespinEmbedded
+fi
+if [ ! -e $PROJECT_DIR/$PROJECT_NAME/media/bespin ]
+then
+ ln -fs $V_ENV/lib/BespinEmbedded/ $PROJECT_DIR/$PROJECT_NAME/media/bespin
+fi
+
+### link jetpack application
+if [ ! -e $PROJECT_DIR/$PROJECT_NAME/media/jetpack ]
+then
+ ln -fs $PROJECT_DIR/$PROJECT_NAME/jetpack/media/ $PROJECT_DIR/$PROJECT_NAME/media/jetpack
+fi
### Grappelli section
# checkout the repository
@@ -13,6 +13,11 @@
</Location>
Alias /adminmedia /path/to/projects/FlightDeck/flightdeck/adminmedia
+ <Location "/media">
+ SetHandler default
+ </Location>
+ Alias /media /path/to/projects/FlightDeck/flightdeck/media
+
LogLevel warn
ErrorLog /path/to/projects/FlightDeck/logs/apache_error.log
CustomLog /path/to/projects/FlightDeck/logs/apache_access.log combined
View
@@ -9,6 +9,8 @@ adminmedia
dev.db
pip-log.txt
flightdeckenv
+flightdeck/media/jetpack
+flightdeck/media/bespin
*local.py
*local.wsgi
*local.sh

0 comments on commit 0533569

Please sign in to comment.