Skip to content

Commit e8e0f15

Browse files
committed
Include settings.py in swiftbrowser
This makes it much easier to deploy swiftbrowser when used in a Swift All in One (SAIO) environment because it is no longer required to create an extra project and app.
1 parent e6f404b commit e8e0f15

File tree

2 files changed

+10
-46
lines changed

2 files changed

+10
-46
lines changed

README.md

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,43 +16,9 @@ Quick Install
1616

1717
1) Install swiftbrowser:
1818

19-
git clone git://github.com/cschwede/django-swiftbrowser.git
20-
cd django-swiftbrowser
21-
sudo python setup.py install
19+
pip install https://github.com/cschwede/django-swiftbrowser/zipball/master
2220

23-
Optional: run tests
24-
25-
python runtests.py
26-
27-
2) Create a new Django project:
28-
29-
django-admin.py startproject myproj
30-
cd myproj
31-
cp ~/django-swiftbrowser/example/settings.py myproj/settings.py
32-
33-
3) Adopt myproj/settings.py to your needs, especially Swift settings.
34-
Please note: you need to change BASE_URL if you're using the built-in development server with non-default settings.
35-
36-
4) Update myproj/urls.py and include swiftbrowser.urls:
37-
38-
import swiftbrowser.urls
39-
40-
urlpatterns = patterns('',
41-
url(r'^', include(swiftbrowser.urls)),
42-
)
43-
44-
5) Run development server:
45-
46-
python manage.py runserver
47-
48-
*Important*: Either use 'python manage.py runserver --insecure' or set DEBUG = True in myproj/settings.py if you want to use the
49-
local development server. Don't use these settings in production!
50-
51-
6) Use 'account:username' to login (or tenant/project:username if using Keystone).
52-
53-
7) Deploying to production? Have a look at Djangos docs: https://docs.djangoproject.com/en/1.5/howto/deployment/wsgi/
54-
55-
8) Please make sure that "tempurl" and "formpost" middlewares are activated in your proxy server. Extract from /etc/swift/proxy-server.conf:
21+
2) Please make sure that "tempurl" and "formpost" middlewares are activated in your proxy server. Extract from /etc/swift/proxy-server.conf:
5622

5723
[pipeline:main]
5824
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache tempurl formpost tempauth proxy-logging proxy-server
@@ -63,6 +29,12 @@ Quick Install
6329
[filter:formpost]
6430
use = egg:swift#formpost
6531

32+
3) Run development server:
33+
34+
django-admin runserver --settings=swiftbrowser.settings
35+
36+
4) Open "http://127.0.0.1:8000/" in your browser and use 'account:username' to login (or tenant/project:username if using Keystone).
37+
6638

6739
Screenshots
6840
-----------

example/settings.py renamed to swiftbrowser/settings.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
""" Settings for Django project """
22
import os
33

4-
# The database isn't used, but Django might complain if setting missing
5-
DATABASES = {
6-
'default': {
7-
'ENGINE': 'django.db.backends.sqlite3',
8-
'NAME': 'swiftbrowser.db'
9-
}
10-
}
11-
124
SESSION_ENGINE = 'django.contrib.sessions.backends.signed_cookies'
135

146
USE_L10N = True
@@ -30,12 +22,12 @@
3022
'django.middleware.csrf.CsrfViewMiddleware',
3123
)
3224

33-
ROOT_URLCONF = 'myproj.urls'
25+
ROOT_URLCONF = 'swiftbrowser.urls'
3426

3527
INSTALLED_APPS = (
3628
'django.contrib.sessions',
3729
'django.contrib.staticfiles',
38-
'swiftbrowser',
30+
'swiftbrowser',
3931
)
4032

4133
SWIFT_AUTH_URL = 'http://127.0.0.1:8080/auth/v1.0'

0 commit comments

Comments
 (0)