Cleanup layout, and ensure templates/static files work.
authorDave Page <dpage@pgadmin.org>
Mon, 14 Mar 2016 12:18:13 +0000 (12:18 +0000)
committerDave Page <dpage@pgadmin.org>
Mon, 14 Mar 2016 12:18:13 +0000 (12:18 +0000)
README.rst
web/manage.py
web/pgperffarm/__init__.py [moved from web/web/__init__.py with 100% similarity]
web/pgperffarm/settings.py [moved from web/web/settings.py with 93% similarity]
web/pgperffarm/settings_local.py.in [moved from web/web/settings_local.py.in with 100% similarity]
web/pgperffarm/urls.py [moved from web/web/urls.py with 63% similarity]
web/pgperffarm/views.py [new file with mode: 0644]
web/pgperffarm/wsgi.py [moved from web/web/wsgi.py with 81% similarity]
web/static/favicon.ico [new file with mode: 0644]
web/templates/index.html [new file with mode: 0644]

index 6ff49b71c356648d46032ef186d173bf653da2e0..6ca13585ba79c381868bb39230e9c9a0a62721bd 100644 (file)
@@ -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
index 40507fbe44b7b301e8e34638b386260be0f2e922..75b91ab207e2cb5637f025f3b617f29cc69c38c1 100755 (executable)
@@ -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
 
similarity index 93%
rename from web/web/settings.py
rename to web/pgperffarm/settings.py
index ed0817283e1cc84316d4964028f05016acabaf9a..bdb9bb978d0956f6af3aa56e5907e7a8dd13384d 100644 (file)
@@ -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 *
similarity index 63%
rename from web/web/urls.py
rename to web/pgperffarm/urls.py
index cea67933ecba53b8c9f5f34c5777abb55d4396e1..9b6ad53880e2c76f2e48c5b156ef9f5ce29c10bc 100644 (file)
@@ -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 (file)
index 0000000..19136db
--- /dev/null
@@ -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
similarity index 81%
rename from web/web/wsgi.py
rename to web/pgperffarm/wsgi.py
index c291b5c01b33f79b05a0f9f098f31cefd264be1c..9f8c4dbcaa7dbec6dd425776f616deb653527d44 100644 (file)
@@ -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
new file mode 100644 (file)
index 0000000..a1cc036
Binary files /dev/null and b/web/static/favicon.ico differ
diff --git a/web/templates/index.html b/web/templates/index.html
new file mode 100644 (file)
index 0000000..7507734
--- /dev/null
@@ -0,0 +1 @@
+<p>Initial template</p>
\ No newline at end of file