Skip to content

Commit e6f404b

Browse files
committed
Use Cloudflare CDN for static files
1 parent c9c0e1a commit e6f404b

File tree

12 files changed

+10
-9603
lines changed

12 files changed

+10
-9603
lines changed

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ Quick Install
3030
cd myproj
3131
cp ~/django-swiftbrowser/example/settings.py myproj/settings.py
3232

33-
34-
3) Adopt myproj/settings.py to your needs, especially settings for Swift and static file directories.
33+
3) Adopt myproj/settings.py to your needs, especially Swift settings.
3534
Please note: you need to change BASE_URL if you're using the built-in development server with non-default settings.
3635

3736
4) Update myproj/urls.py and include swiftbrowser.urls:
@@ -42,22 +41,18 @@ Quick Install
4241
url(r'^', include(swiftbrowser.urls)),
4342
)
4443

45-
5) Collect static files:
46-
47-
python manage.py collectstatic
48-
49-
6) Run development server:
44+
5) Run development server:
5045

5146
python manage.py runserver
5247

5348
*Important*: Either use 'python manage.py runserver --insecure' or set DEBUG = True in myproj/settings.py if you want to use the
5449
local development server. Don't use these settings in production!
5550

56-
7) Use 'account:username' to login (or tenant/project:username if using Keystone).
51+
6) Use 'account:username' to login (or tenant/project:username if using Keystone).
5752

58-
8) Deploying to production? Have a look at Djangos docs: https://docs.djangoproject.com/en/1.5/howto/deployment/wsgi/
53+
7) Deploying to production? Have a look at Djangos docs: https://docs.djangoproject.com/en/1.5/howto/deployment/wsgi/
5954

60-
9) Please make sure that "tempurl" and "formpost" middlewares are activated in your proxy server. Extract from /etc/swift/proxy-server.conf:
55+
8) Please make sure that "tempurl" and "formpost" middlewares are activated in your proxy server. Extract from /etc/swift/proxy-server.conf:
6156

6257
[pipeline:main]
6358
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache tempurl formpost tempauth proxy-logging proxy-server

example/settings.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,10 @@
4343
STORAGE_URL = 'http://127.0.0.1:8080/v1/'
4444
BASE_URL = 'http://127.0.0.1:8000' # default if using built-in runserver
4545
SWAUTH_URL = 'http://127.0.0.1:8080/auth/v2'
46-
STATIC_DIR = '/var/www/myproj/static'
4746

4847
TIME_ZONE = 'Europe/Berlin'
4948
LANGUAGE_CODE = 'de-de'
5049
SECRET_KEY = 'DONT_USE_THIS_IN_PRODUCTION'
51-
STATIC_URL = "/static/"
52-
STATIC_ROOT = "/var/www/myproj/static/"
50+
STATIC_URL = "http://cdnjs.cloudflare.com/ajax/libs/"
5351

5452
ALLOWED_HOSTS = ['127.0.0.1', 'insert_your_hostname_here']

0 commit comments

Comments
 (0)