diff options
| author | Dave Page | 2016-03-14 12:18:13 +0000 |
|---|---|---|
| committer | Dave Page | 2016-03-14 12:18:13 +0000 |
| commit | 26fddee37f2140aff3c875d053bda8a1a46a5567 (patch) | |
| tree | 126b72512d4bf9d7a4b5a476a45781014879ae12 | |
| parent | 1f549bd736b897616771a6542e4790c031e8be35 (diff) | |
Cleanup layout, and ensure templates/static files work.
| -rw-r--r-- | README.rst | 2 | ||||
| -rwxr-xr-x | web/manage.py | 2 | ||||
| -rw-r--r-- | web/pgperffarm/__init__.py (renamed from web/web/__init__.py) | 0 | ||||
| -rw-r--r-- | web/pgperffarm/settings.py (renamed from web/web/settings.py) | 12 | ||||
| -rw-r--r-- | web/pgperffarm/settings_local.py.in (renamed from web/web/settings_local.py.in) | 0 | ||||
| -rw-r--r-- | web/pgperffarm/urls.py (renamed from web/web/urls.py) | 11 | ||||
| -rw-r--r-- | web/pgperffarm/views.py | 10 | ||||
| -rw-r--r-- | web/pgperffarm/wsgi.py (renamed from web/web/wsgi.py) | 2 | ||||
| -rw-r--r-- | web/static/favicon.ico | bin | 0 -> 2550 bytes | |||
| -rw-r--r-- | web/templates/index.html | 1 |
10 files changed, 33 insertions, 7 deletions
@@ -29,7 +29,7 @@ what is currently supported on the postgresql.org infrastructure:: Next, create a settings_local.py file:: - $ cp web/web/settings_local.py.in web/web/settings_local.py + $ cp web/pgperffarm/settings_local.py.in web/pgperffarm/settings_local.py Edit the file and change the database configuration and other settings to suit your environment. Make sure you create the required database and user account diff --git a/web/manage.py b/web/manage.py index 40507fb..75b91ab 100755 --- a/web/manage.py +++ b/web/manage.py @@ -3,7 +3,7 @@ import os import sys if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "web.settings") + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pgperffarm.settings") from django.core.management import execute_from_command_line diff --git a/web/web/__init__.py b/web/pgperffarm/__init__.py index e69de29..e69de29 100644 --- a/web/web/__init__.py +++ b/web/pgperffarm/__init__.py diff --git a/web/web/settings.py b/web/pgperffarm/settings.py index ed08172..bdb9bb9 100644 --- a/web/web/settings.py +++ b/web/pgperffarm/settings.py @@ -1,5 +1,5 @@ """ -Django settings for web project. +Django settings for pgperfarm project. Generated by 'django-admin startproject' using Django 1.8.11. @@ -50,12 +50,12 @@ MIDDLEWARE_CLASSES = ( 'django.middleware.security.SecurityMiddleware', ) -ROOT_URLCONF = 'web.urls' +ROOT_URLCONF = 'pgperffarm.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + 'DIRS': ['templates/',], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ @@ -68,7 +68,7 @@ TEMPLATES = [ }, ] -WSGI_APPLICATION = 'web.wsgi.application' +WSGI_APPLICATION = 'pgperffarm.wsgi.application' # Database @@ -101,5 +101,9 @@ USE_TZ = True STATIC_URL = '/static/' +STATICFILES_DIRS = [ + "static/", +] + # Load local settings overrides from settings_local import * diff --git a/web/web/settings_local.py.in b/web/pgperffarm/settings_local.py.in index fbe4ac6..fbe4ac6 100644 --- a/web/web/settings_local.py.in +++ b/web/pgperffarm/settings_local.py.in diff --git a/web/web/urls.py b/web/pgperffarm/urls.py index cea6793..9b6ad53 100644 --- a/web/web/urls.py +++ b/web/pgperffarm/urls.py @@ -14,7 +14,18 @@ Including another URLconf """ from django.conf.urls import include, url from django.contrib import admin +from django.views.generic.base import RedirectView urlpatterns = [ + # Static pages + url(r'^$', 'pgperffarm.views.index', name='index'), + + # Admin site url(r'^admin/', include(admin.site.urls)), + + # This should not happen in production - serve with lightty! + url(r'^static/(.*)$', 'django.views.static.serve', { + 'document_root': '/static', + }), + url(r'^favicon\.ico$', RedirectView.as_view(url='/static/favicon.ico')) ] diff --git a/web/pgperffarm/views.py b/web/pgperffarm/views.py new file mode 100644 index 0000000..19136db --- /dev/null +++ b/web/pgperffarm/views.py @@ -0,0 +1,10 @@ +from django.shortcuts import render_to_response +from django.http import HttpResponse, Http404 +from django.template import TemplateDoesNotExist, loader, Context + +import datetime + +# Handle the static pages +def index(request): + return render_to_response('index.html', { + })
\ No newline at end of file diff --git a/web/web/wsgi.py b/web/pgperffarm/wsgi.py index c291b5c..9f8c4db 100644 --- a/web/web/wsgi.py +++ b/web/pgperffarm/wsgi.py @@ -11,6 +11,6 @@ import os from django.core.wsgi import get_wsgi_application -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "web.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pgperffarm.settings") application = get_wsgi_application() diff --git a/web/static/favicon.ico b/web/static/favicon.ico Binary files differnew file mode 100644 index 0000000..a1cc036 --- /dev/null +++ b/web/static/favicon.ico diff --git a/web/templates/index.html b/web/templates/index.html new file mode 100644 index 0000000..7507734 --- /dev/null +++ b/web/templates/index.html @@ -0,0 +1 @@ +<p>Initial template</p>
\ No newline at end of file |
