Skip to content

Commit e6a4819

Browse files
author
Simon Funke
committed
An initial django app
0 parents  commit e6a4819

File tree

10 files changed

+212
-0
lines changed

10 files changed

+212
-0
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
deploy:
2+
echo 'CREATE DATABASE IF NOT EXISTS cpp_backend2;' | mysql -u root --password=rootpassword
3+
python manage.py syncdb

cpp_backend2/__init__.py

Whitespace-only changes.

cpp_backend2/__init__.pyc

140 Bytes
Binary file not shown.

cpp_backend2/settings.py

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# Django settings for cpp_backend2 project.
2+
3+
DEBUG = True
4+
TEMPLATE_DEBUG = DEBUG
5+
6+
ADMINS = (
7+
# ('Your Name', '[email protected]'),
8+
)
9+
10+
MANAGERS = ADMINS
11+
12+
DATABASES = {
13+
'default': {
14+
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
15+
'NAME': 'cpp_backend2', # Or path to database file if using sqlite3.
16+
'USER': 'root', # Not used with sqlite3.
17+
'PASSWORD': 'rootpassword', # Not used with sqlite3.
18+
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
19+
'PORT': '', # Set to empty string for default. Not used with sqlite3.
20+
}
21+
}
22+
23+
# Local time zone for this installation. Choices can be found here:
24+
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
25+
# although not all choices may be available on all operating systems.
26+
# On Unix systems, a value of None will cause Django to use the same
27+
# timezone as the operating system.
28+
# If running in a Windows environment this must be set to the same as your
29+
# system time zone.
30+
TIME_ZONE = 'America/Chicago'
31+
32+
# Language code for this installation. All choices can be found here:
33+
# http://www.i18nguy.com/unicode/language-identifiers.html
34+
LANGUAGE_CODE = 'en-us'
35+
36+
SITE_ID = 1
37+
38+
# If you set this to False, Django will make some optimizations so as not
39+
# to load the internationalization machinery.
40+
USE_I18N = True
41+
42+
# If you set this to False, Django will not format dates, numbers and
43+
# calendars according to the current locale.
44+
USE_L10N = True
45+
46+
# If you set this to False, Django will not use timezone-aware datetimes.
47+
USE_TZ = True
48+
49+
# Absolute filesystem path to the directory that will hold user-uploaded files.
50+
# Example: "/home/media/media.lawrence.com/media/"
51+
MEDIA_ROOT = ''
52+
53+
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
54+
# trailing slash.
55+
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
56+
MEDIA_URL = ''
57+
58+
# Absolute path to the directory static files should be collected to.
59+
# Don't put anything in this directory yourself; store your static files
60+
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
61+
# Example: "/home/media/media.lawrence.com/static/"
62+
STATIC_ROOT = ''
63+
64+
# URL prefix for static files.
65+
# Example: "http://media.lawrence.com/static/"
66+
STATIC_URL = '/static/'
67+
68+
# Additional locations of static files
69+
STATICFILES_DIRS = (
70+
# Put strings here, like "/home/html/static" or "C:/www/django/static".
71+
# Always use forward slashes, even on Windows.
72+
# Don't forget to use absolute paths, not relative paths.
73+
)
74+
75+
# List of finder classes that know how to find static files in
76+
# various locations.
77+
STATICFILES_FINDERS = (
78+
'django.contrib.staticfiles.finders.FileSystemFinder',
79+
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
80+
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
81+
)
82+
83+
# Make this unique, and don't share it with anybody.
84+
SECRET_KEY = '(1glfbbRasfdai23983&&*^()*e_12e1ds01sd092okdlfds5r(qd^i1tg#@'
85+
86+
# List of callables that know how to import templates from various sources.
87+
TEMPLATE_LOADERS = (
88+
'django.template.loaders.filesystem.Loader',
89+
'django.template.loaders.app_directories.Loader',
90+
# 'django.template.loaders.eggs.Loader',
91+
)
92+
93+
MIDDLEWARE_CLASSES = (
94+
'django.middleware.common.CommonMiddleware',
95+
'django.contrib.sessions.middleware.SessionMiddleware',
96+
'django.middleware.csrf.CsrfViewMiddleware',
97+
'django.contrib.auth.middleware.AuthenticationMiddleware',
98+
'django.contrib.messages.middleware.MessageMiddleware',
99+
# Uncomment the next line for simple clickjacking protection:
100+
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
101+
)
102+
103+
ROOT_URLCONF = 'cpp_backend2.urls'
104+
105+
# Python dotted path to the WSGI application used by Django's runserver.
106+
WSGI_APPLICATION = 'cpp_backend2.wsgi.application'
107+
108+
TEMPLATE_DIRS = (
109+
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
110+
# Always use forward slashes, even on Windows.
111+
# Don't forget to use absolute paths, not relative paths.
112+
)
113+
114+
INSTALLED_APPS = (
115+
#'django.contrib.auth',
116+
'django.contrib.contenttypes',
117+
#'django.contrib.sessions',
118+
'django.contrib.sites',
119+
#'django.contrib.messages',
120+
'django.contrib.staticfiles',
121+
# Uncomment the next line to enable the admin:
122+
# 'django.contrib.admin',
123+
# Uncomment the next line to enable admin documentation:
124+
# 'django.contrib.admindocs',
125+
)
126+
127+
# A sample logging configuration. The only tangible logging
128+
# performed by this configuration is to send an email to
129+
# the site admins on every HTTP 500 error when DEBUG=False.
130+
# See http://docs.djangoproject.com/en/dev/topics/logging for
131+
# more details on how to customize your logging configuration.
132+
LOGGING = {
133+
'version': 1,
134+
'disable_existing_loggers': False,
135+
'filters': {
136+
'require_debug_false': {
137+
'()': 'django.utils.log.RequireDebugFalse'
138+
}
139+
},
140+
'handlers': {
141+
'mail_admins': {
142+
'level': 'ERROR',
143+
'filters': ['require_debug_false'],
144+
'class': 'django.utils.log.AdminEmailHandler'
145+
}
146+
},
147+
'loggers': {
148+
'django.request': {
149+
'handlers': ['mail_admins'],
150+
'level': 'ERROR',
151+
'propagate': True,
152+
},
153+
}
154+
}

cpp_backend2/settings.pyc

2.67 KB
Binary file not shown.

cpp_backend2/urls.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from django.conf.urls import patterns, include, url
2+
3+
# Uncomment the next two lines to enable the admin:
4+
# from django.contrib import admin
5+
# admin.autodiscover()
6+
7+
urlpatterns = patterns('',
8+
# Examples:
9+
# url(r'^$', 'cpp_backend2.views.home', name='home'),
10+
# url(r'^cpp_backend2/', include('cpp_backend2.foo.urls')),
11+
12+
# Uncomment the admin/doc line below to enable admin documentation:
13+
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
14+
15+
# Uncomment the next line to enable the admin:
16+
# url(r'^admin/', include(admin.site.urls)),
17+
)

cpp_backend2/urls.pyc

278 Bytes
Binary file not shown.

cpp_backend2/wsgi.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""
2+
WSGI config for cpp_backend2 project.
3+
4+
This module contains the WSGI application used by Django's development server
5+
and any production WSGI deployments. It should expose a module-level variable
6+
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
7+
this application via the ``WSGI_APPLICATION`` setting.
8+
9+
Usually you will have the standard Django WSGI application here, but it also
10+
might make sense to replace the whole Django WSGI application with a custom one
11+
that later delegates to the Django one. For example, you could introduce WSGI
12+
middleware here, or combine a Django application with an application of another
13+
framework.
14+
15+
"""
16+
import os
17+
18+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cpp_backend2.settings")
19+
20+
# This application object is used by any WSGI server configured to use this
21+
# file. This includes Django's development server, if the WSGI_APPLICATION
22+
# setting points here.
23+
from django.core.wsgi import get_wsgi_application
24+
application = get_wsgi_application()
25+
26+
# Apply WSGI middleware here.
27+
# from helloworld.wsgi import HelloWorldApplication
28+
# application = HelloWorldApplication(application)

cpp_backend2/wsgi.pyc

1.02 KB
Binary file not shown.

manage.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env python
2+
import os
3+
import sys
4+
5+
if __name__ == "__main__":
6+
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cpp_backend2.settings")
7+
8+
from django.core.management import execute_from_command_line
9+
10+
execute_from_command_line(sys.argv)

0 commit comments

Comments
 (0)