** Continued from Try using vagrant-swift-all-in-one **
django-swiftbrowser
I built a Swift server with Try using vagrant-swift-all-in-one, but I also want to prepare the GUI on the server side. OpenStack dashboard service (Horizon) and authentication service (Keystone) You can use it, but it's very tedious to install it just to use Swift. So, let's use django-swiftbrowser which is a simple GUI for Swift.
#Get repository
git clone git://github.com/cschwede/django-swiftbrowser.git
#Installation
cd django-swiftbrowser
sudo python setup.py install
Create a suitable project.
django-admin.py startproject myproj
cd myproj
cp ~/django-swiftbrowser/example/settings.py myproj/settings.py
Modify myproj / settings.py
.
myproj/settings.py
#Change Swift authentication URL to fixed IP of Swift server
SWIFT_AUTH_URL = 'http://192.168.0.1:8080/auth/v1.0'
SWIFT_AUTH_VERSION = 1 # 2 for keystone
STORAGE_URL = 'http://192.168.0.1:8080/v1/'
BASE_URL = 'http://192.168.0.1'
SWAUTH_URL = 'http://192.168.0.1:8080/auth/v2'
STATIC_DIR = '/var/www/myproj/static'
#Corrected timezone and language from Berlin to Japan
- TIME_ZONE = 'Europe/Berlin'
- LANGUAGE_CODE = 'de-de'
+ TIME_ZONE = 'Asia/Tokyo'
+ LANGUAGE_CODE = 'ja-jp'
# ALLOWED_Added Swift server static IP to HOSTS
ALLOWED_HOSTS = ['127.0.0.1', '192.168.0.1', 'insert_your_hostname_here']
Add the URL setting to myproj / urls.py
.
myproj/urls.py
from django.conf.urls import patterns, include, url
from django.contrib import admin
+ import swiftbrowser.urls
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
+ url(r'^', include(swiftbrowser.urls)),
)
Copy the static file.
sudo python manage.py collectstatic
(Because you will be asked if you want to overwrite the existing file'yes'Enter the)
Start Swiftbrowser.
python manage.py runserver 192.168.0.1:8000 --insecure &
If you can start it without any problem, access http://192.168.0.1:8000/login/ from your browser and the login screen will be displayed. To log in as a test user, enter username: test: tester and password: testing.
You can now use Swift from your browser.
It becomes Unauthorized when uploading the file. If you find the cause, fix it.
Recommended Posts