Commits

Chris Lee-Messer committed cf498f2

clean up old testproject files

  • Participants
  • Parent commits 2ecf21e

Comments (0)

Files changed (7)

File tests/testdjangoproject/__init__.py

Empty file removed.

File tests/testdjangoproject/manage.py

-#!/usr/bin/env python
-import sys
-sys.path.append("..")
-from django.core.management import execute_manager
-try:
-    import settings # Assumed to be in the same directory.
-except ImportError:
-    import sys
-    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
-    sys.exit(1)
-
-if __name__ == "__main__":
-    execute_manager(settings)

File tests/testdjangoproject/settings.py

-# Django settings for testdjangoproject project.
-# to test django-cherrypy-wsgiserver
-# add django_wsgiserver to the PYTHONPATH
-import sys, os
-PROJECT_ROOT = os.path.dirname(__file__)
-# add django_wsgiserver to python path
-sys.path.append(os.path.join(PROJECT_ROOT,"../.."))  
-
-DEBUG = True
-TEMPLATE_DEBUG = DEBUG
-
-ADMINS = (
-    # ('Your Name', 'your_email@domain.com'),
-)
-
-MANAGERS = ADMINS
-
-DATABASES = {
-    'default': {
-        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
-        'NAME': 'testdb.sqlite',                      # Or path to database file if using sqlite3.
-        'USER': '',                      # Not used with sqlite3.
-        'PASSWORD': '',                  # Not used with sqlite3.
-        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
-        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
-    }
-}
-
-# Local time zone for this installation. Choices can be found here:
-# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
-# although not all choices may be available on all operating systems.
-# On Unix systems, a value of None will cause Django to use the same
-# timezone as the operating system.
-# If running in a Windows environment this must be set to the same as your
-# system time zone.
-TIME_ZONE = 'America/Chicago'
-
-# Language code for this installation. All choices can be found here:
-# http://www.i18nguy.com/unicode/language-identifiers.html
-LANGUAGE_CODE = 'en-us'
-
-SITE_ID = 1
-
-# If you set this to False, Django will make some optimizations so as not
-# to load the internationalization machinery.
-USE_I18N = True
-
-# If you set this to False, Django will not format dates, numbers and
-# calendars according to the current locale
-USE_L10N = True
-
-# Absolute path to the directory that holds media.
-# Example: "/home/media/media.lawrence.com/"
-MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'sitemedia')
-
-# URL that handles the media served from MEDIA_ROOT. Make sure to use a
-# trailing slash if there is a path component (optional in other cases).
-# Examples: "http://media.lawrence.com", "http://example.com/media/"
-MEDIA_URL = '/media/'
-
-# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
-# trailing slash.
-# Examples: "http://foo.com/media/", "/media/".
-ADMIN_MEDIA_PREFIX = '/media/admin/'
-
-# Make this unique, and don't share it with anybody.
-SECRET_KEY = 'v+ryc^&*s9%9h=r$72%c59h3jgq+u(n^*es6fz02xb4naj+cbt'
-
-# List of callables that know how to import templates from various sources.
-TEMPLATE_LOADERS = (
-    'django.template.loaders.filesystem.Loader',
-    'django.template.loaders.app_directories.Loader',
-#     'django.template.loaders.eggs.Loader',
-)
-
-MIDDLEWARE_CLASSES = (
-    'django.middleware.common.CommonMiddleware',
-    'django.contrib.sessions.middleware.SessionMiddleware',
-    'django.middleware.csrf.CsrfViewMiddleware',
-    'django.contrib.auth.middleware.AuthenticationMiddleware',
-    'django.contrib.messages.middleware.MessageMiddleware',
-    'debug_toolbar.middleware.DebugToolbarMiddleware',
-)
-
-ROOT_URLCONF = 'testdjangoproject.urls'
-
-TEMPLATE_DIRS = (
-    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
-    # Always use forward slashes, even on Windows.
-    # Don't forget to use absolute paths, not relative paths.
-    os.path.join(PROJECT_ROOT, 'templates'),
-)
-
-INSTALLED_APPS = (
-    'django.contrib.auth',
-    'django.contrib.contenttypes',
-    'django.contrib.sessions',
-    'django.contrib.sites',
-    'django.contrib.messages',
-    'django_wsgiserver',
-    # Uncomment the next line to enable the admin:
-    'django.contrib.admin',
-    'django.contrib.admindocs',
-    'debug_toolbar',
-    'dummyapp',
-)
-
-INTERNAL_IPS = ('localhost',
-                '127.0.0.1',
-                )

File tests/testdjangoproject/settings_statics.py

-# this is updated to target the new static file handling in django 1.3
-from settings import *
-
-STATIC_ROOT = os.path.join(PROJECT_ROOT, 'site_static') # where files will be collected
-
-# staticfiles_urlpatterns your STATIC_URL setting can't be empty or a full URL, such as http://static.example.com/.
-STATIC_URL = r'/static/'
-# experimental for development work it would be nice to not need to
-# run collectstatic all the time
-# each app by default will have its app/static directory added, by convention these are usually subdirectories
-# app1/static/app1
-# app2/static/app2
-# but there is a problem if this convention isn't followed
-INSTALLED_APPS +=  ('django.contrib.staticfiles',)
-STATICFILES_DIRS = (
-  # 
-  # ("urlprefix", "/path/to/the/files"), # I usually have urlprefix be appname
-    os.path.join(PROJECT_ROOT, "static2"),
-# don't remember what I was doing here with this tuple
-#    ('static3', os.path.join(PROJECT_ROOT, "notstatic3")),
-)
-
-# List of finder classes that know how to find static files in
-# various locations.
-STATICFILES_FINDERS = (
-    'django.contrib.staticfiles.finders.FileSystemFinder',
-    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
-#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
-)

File tests/testdjangoproject/templates/hello.html

-<html>
-  <head>
-    <title>django-wsgiserver</title>
-  </head>
-  <body><h2>hello django-wsgiserver</h2>
- 
-    <h3>Tests</h3>
-    <ul>
-      <li> <a href="/admin/">Check the default admin css media service</a></li>
-      </ul>
-
-{% if 1 %}
-      <h4> if static file serving enabled </h4>
-      <ul>
-      <li> <a href="/static/textfile.txt">/static/textfile.txt </a></li>
-      <li> <a href="/static/htmlfile.html">/static/htmlfile.txt </a></li>
-      <li> <a href="/static/static2/textfile2.txt"> from static2/textfile2.txt mapped back to static </a></li>
-      <li> <a href="/static/static2/substatic2/sub_textfile.txt"> static2/substatic2/sub_textfile.txt </a></li>
-
-      <li> <a href="/static/../settings.py"> /static/../settings.py security test</a> should not return the settings.py file! (either forbidden or remap to another url)</li>
-
-      {% else %}
-      <li> Staticfiles are not being used </li>
-{% endif %}
-    </ul>
-</body>
-</html>

File tests/testdjangoproject/urls.py

-from django.conf.urls.defaults import *
-
-# Uncomment the next two lines to enable the admin:
-from django.contrib import admin
-admin.autodiscover()
-
-urlpatterns = patterns('',
-    # Example:
-    # (r'^testdjangoproject/', include('testdjangoproject.foo.urls')),
-
-    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
-    # to INSTALLED_APPS to enable admin documentation:
-    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
-
-    # Uncomment the next line to enable the admin:
-    (r'^admin/', include(admin.site.urls)),
-    #default                       
-    (r'^$', 'views.hello'),                                              
-)
-
-
-#from django.contrib.staticfiles.urls import staticfiles_urlpatterns
-#from pprint import pprint
-#print "staticfiles_urlpatterns():"
-#pprint (staticfiles_urlpatterns())

File tests/testdjangoproject/views.py

-from django.conf import settings
-from django.http import HttpResponse, HttpResponseRedirect
-from django.template import RequestContext
-from django.shortcuts import render_to_response
-import pprint
-
-def hello(request):
-    data = {}
-    
-    data['HAS_STATICFILES_ROOT'] = True
-    try:
-        if settings.STATICFILES_ROOT:
-            data['HAS_STATICFILES_ROOT'] = True
-            print "see the STATICFILES_ROOT:", settings.STATICFILES_ROOT
-    except:
-        data['HAS_STATICFILES_ROOT'] = False
-        pass
-
-    c = RequestContext(request, data)
-    return render_to_response("hello.html", context_instance=c)
-
-