This repository has been archived by the owner on Feb 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 48
Web interface
jpmckinney edited this page Dec 17, 2012
·
4 revisions
In all instructions below, replace APPNAME
with your Django app's name.
mkdir site
cd site
django-admin.py startproject APPNAME_site
mv APPNAME_site/manage.py .
Replace its contents with:
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "oglocal_site.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
Add import os
and set:
-
TIME_ZONE
to'UTC'
-
USE_L10N
toFalse
Add:
USE_TZ = True
DATE_FORMAT = 'Y-m-d'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'Y-m-d H:i:s'
WSGI_APPLICATION = 'web.wsgi.application'
Add the following to TEMPLATE_DIRS
:
os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'templates')),
Add the following to INSTALLED_APPS
:
'django.contrib.humanize',
'django.contrib.admin',
'billy.web.api',
'billy.web.admin',
'billy.web.public',
If you are using the boundary service, set:
- database
ENGINE
to'django.contrib.gis.db.backends.postgis'
- database
NAME
toAPPNAME
and add the following to INSTALLED_APPS
:
'django.contrib.gis',
'south',
'boundaries',
If using Homebrew on Mac OS X, you may need to set the database HOST
to 'localhost'
Otherwise, set:
- database
ENGINE
to'django.db.backends.sqlite3'
- database
NAME
toos.path.join(os.path.dirname(__file__), 'APPNAME.sqlite3')
Uncomment:
from django.contrib import admin
admin.autodiscover()
Add the following to urlpatterns
:
(r'^api/', include('billy.web.api.urls')),
(r'^admin/', include('billy.web.admin.urls')),
(r'^djadmin/', include(admin.site.urls)),
(r'^', include('billy.web.public.urls')),
If you are using the boundary service, add the following to urlpatterns
:
(r'', include('boundaries.urls')),
Create a wsgi.py
file under site/APPNAME_site
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "web.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
python site/manage.py runserver