-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from JeffreyMFarley/djangofy
Provide a thin Django implementation for the UI
- Loading branch information
Showing
25 changed files
with
273 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ Thumbs.db | |
*.egg-info/ | ||
__pycache__/ | ||
*.py[cod] | ||
.eggs/ | ||
.env | ||
|
||
# Django # | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,5 @@ | ||
All notable changes to this project will be documented in this file. | ||
We follow the [Semantic Versioning 2.0.0](http://semver.org/) format. | ||
This project does not use `CHANGELOG.md` to track release changes. | ||
|
||
See the project repository release history at: | ||
|
||
## x.y.z - YYYY-MM-DD | ||
|
||
### Added | ||
- Lorem ipsum dolor sit amet | ||
|
||
### Deprecated | ||
- Nothing. | ||
|
||
### Removed | ||
- Nothing. | ||
|
||
### Fixed | ||
- Nothing. | ||
https://github.com/cfpb/ccdb5-ui/releases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
""" | ||
Django settings for ccdb5_ui project. | ||
Generated by 'django-admin startproject' using Django 1.8.15. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/1.8/topics/settings/ | ||
For the full list of settings and their values, see | ||
https://docs.djangoproject.com/en/1.8/ref/settings/ | ||
""" | ||
|
||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) | ||
import os | ||
|
||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | ||
|
||
|
||
# Quick-start development settings - unsuitable for production | ||
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ | ||
|
||
# SECURITY WARNING: keep the secret key used in production secret! | ||
SECRET_KEY = os.environ.get('SECRET_KEY', os.urandom(32)) | ||
|
||
# SECURITY WARNING: don't run with debug turned on in production! | ||
DEBUG = True | ||
|
||
ALLOWED_HOSTS = [] | ||
|
||
# This is set here so that we can use the local server, this will not | ||
# be part of the cfgov-refresh settings | ||
STANDALONE = True | ||
|
||
# Application definition | ||
|
||
INSTALLED_APPS = ( | ||
'django.contrib.auth', | ||
'django.contrib.contenttypes', | ||
'django.contrib.staticfiles', | ||
'ccdb5_ui' | ||
) | ||
|
||
MIDDLEWARE_CLASSES = ( | ||
) | ||
|
||
ROOT_URLCONF = 'ccdb5_ui.config.urls' | ||
|
||
TEMPLATES = [ | ||
{ | ||
'BACKEND': 'django.template.backends.django.DjangoTemplates', | ||
'DIRS': [], | ||
'APP_DIRS': True, | ||
'OPTIONS': { | ||
'context_processors': [ | ||
'django.template.context_processors.debug', | ||
'django.template.context_processors.request', | ||
'django.contrib.auth.context_processors.auth', | ||
'django.contrib.messages.context_processors.messages', | ||
], | ||
}, | ||
}, | ||
] | ||
|
||
WSGI_APPLICATION = 'ccdb5_ui.config.wsgi.application' | ||
|
||
|
||
# Database | ||
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases | ||
|
||
DATABASES = {} | ||
|
||
|
||
# Internationalization | ||
# https://docs.djangoproject.com/en/1.8/topics/i18n/ | ||
|
||
LANGUAGE_CODE = 'en-us' | ||
|
||
TIME_ZONE = 'UTC' | ||
|
||
USE_I18N = True | ||
|
||
USE_L10N = True | ||
|
||
USE_TZ = True | ||
|
||
|
||
# Static files (CSS, JavaScript, Images) | ||
# https://docs.djangoproject.com/en/1.8/howto/static-files/ | ||
|
||
STATIC_URL = '/static/' | ||
|
||
STATIC_ROOT = os.path.join(BASE_DIR, 'static') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.conf.urls import url | ||
from ccdb5_ui.views import CCDB5MainView | ||
|
||
urlpatterns = [ | ||
url(r'^$', CCDB5MainView.as_view()), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import os | ||
from django.core.wsgi import get_wsgi_application | ||
|
||
application = get_wsgi_application() |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta charset="utf-8"> | ||
{% block meta_viewport %} | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
{% endblock meta_viewport %} | ||
<title> | ||
{% block title %} | ||
{% endblock title %} | ||
</title> | ||
{% block css %} | ||
{% endblock css %} | ||
{% block app_js %} | ||
{% endblock app_js %} | ||
</head> | ||
|
||
<body> | ||
{% block body %} | ||
{% block header %} | ||
{% endblock header %} | ||
{% block content %} | ||
{% endblock content %} | ||
{% endblock body %} | ||
|
||
{% block page_js %} | ||
{% endblock page_js %} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% extends ccdb5_base_template|default:'front/base_nonresponsive.html' %} | ||
|
||
{% load static %} | ||
|
||
{% block css %} | ||
{% endblock %} | ||
|
||
{% block title %}Search the Consumer Complaint Database{% endblock %} | ||
|
||
{% block content %} | ||
<div id="root"></div> | ||
{% endblock %} | ||
|
||
{% block page_js %} | ||
<script src="{% static "ccdb5.min.js" %}" type="text/javascript"></script> | ||
<script type="text/javascript"> | ||
ReactDOM.render( | ||
React.createElement(ccdb5_ui.App, {}, null), | ||
document.getElementById('root') | ||
); | ||
</script> | ||
{% endblock %} | ||
|
||
{% block app_js %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from django.views.generic.base import TemplateView | ||
from django.conf import settings | ||
|
||
try: | ||
STANDALONE = settings.STANDALONE | ||
except: # pragma: no cover | ||
STANDALONE = False | ||
|
||
|
||
if STANDALONE: | ||
BASE_TEMPLATE = 'base.html' | ||
else: # pragma: no cover | ||
BASE_TEMPLATE = 'front/base_nonresponsive.html' | ||
|
||
|
||
class CCDB5MainView(TemplateView): | ||
template_name = 'index.html' | ||
base_template = BASE_TEMPLATE | ||
|
||
def get_context_data(self, **kwargs): | ||
context = super(CCDB5MainView, self).get_context_data(**kwargs) | ||
context['ccdb5_base_template'] = self.base_template | ||
return context |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env python | ||
import os | ||
import sys | ||
|
||
if __name__ == "__main__": | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ccdb5_ui.config.settings") | ||
|
||
from django.core.management import execute_from_command_line | ||
|
||
execute_from_command_line(sys.argv) |
Oops, something went wrong.