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
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
"""
-Django settings for web project.
+Django settings for pgperfarm project.
Generated by 'django-admin startproject' using Django 1.8.11.
'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': [
},
]
-WSGI_APPLICATION = 'web.wsgi.application'
+WSGI_APPLICATION = 'pgperffarm.wsgi.application'
# Database
STATIC_URL = '/static/'
+STATICFILES_DIRS = [
+ "static/",
+]
+
# Load local settings overrides
from settings_local import *
"""
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'))
]
--- /dev/null
+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
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()
--- /dev/null
+<p>Initial template</p>
\ No newline at end of file