Add demo app

This commit is contained in:
Rodolfo Carvalho 2015-05-24 13:10:47 +02:00
parent 0684d3f043
commit fe41f577cd
9 changed files with 64 additions and 0 deletions

0
openshift/__init__.py Normal file
View file

3
openshift/admin.py Normal file
View file

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View file

3
openshift/models.py Normal file
View file

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

View file

@ -0,0 +1,47 @@
<!DOCTYPE html>
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="robots" content="NONE,NOARCHIVE"><title>Welcome to Django</title>
<style type="text/css">
html * { padding:0; margin:0; }
body * { padding:10px 20px; }
body * * { padding:0; }
body { font:small sans-serif; }
body>div { border-bottom:1px solid #ddd; }
h1 { font-weight:normal; }
code { background: #ffd; }
#summary { background: #34383c; }
#summary h1 { color: #fff; }
#explanation { background:#eee; }
#instructions { background:#f6f6f6; }
#instructions ol li { margin: 0.2em 0 0.2em 2em; }
</style>
</head>
<body>
<div id="summary">
<h1>Your Django-powered OpenShift project works!</h1>
</div>
<div id="instructions">
<p>
This project has just a skeleton for you to get started. It includes:
</p>
<ol>
<li>Django project created with <code>python manage.py startproject project .</code></li>
<li>Appropriate database configuration</li>
<li>Sample Django app created with <code>python manage.py startapp openshift</code></li>
</ol>
<p>
Now it is time to add your own code. Follow along the <a href="https://docs.djangoproject.com/en/1.8/intro/tutorial01/">Django tutorial</a> to learn more about Django.
</p>
</div>
<div id="explanation">
<p>
You can see more information about this request using the toolbar on the right.<br>
Please note that by default your Django settings have <code>DEBUG = True</code> and that is not appropriate for production use,
but very handy during development.<br>
Refer to the <a href="https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/">Deployment Checklist</a> before taking this project into a production environment.</p>
</div>
</body></html>

3
openshift/tests.py Normal file
View file

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

6
openshift/views.py Normal file
View file

@ -0,0 +1,6 @@
from django.shortcuts import render
# Create your views here.
def index(request):
return render(request, 'openshift/index.html')

View file

@ -43,6 +43,7 @@ INSTALLED_APPS = (
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'debug_toolbar', 'debug_toolbar',
'openshift',
) )
MIDDLEWARE_CLASSES = ( MIDDLEWARE_CLASSES = (

View file

@ -6,5 +6,6 @@ urlpatterns = [
# url(r'^$', 'project.views.home', name='home'), # url(r'^$', 'project.views.home', name='home'),
# url(r'^blog/', include('blog.urls')), # url(r'^blog/', include('blog.urls')),
url(r'^$', 'openshift.views.index'),
url(r'^admin/', include(admin.site.urls)), url(r'^admin/', include(admin.site.urls)),
] ]