diff --git a/project/settings.py b/project/settings.py index 8855547e..da0cc8c3 100644 --- a/project/settings.py +++ b/project/settings.py @@ -43,7 +43,6 @@ INSTALLED_APPS = [ 'django.contrib.messages', 'django.contrib.staticfiles', 'debug_toolbar', - 'welcome', ] MIDDLEWARE = [ diff --git a/project/urls.py b/project/urls.py index 5c6a8e36..87e8fb2b 100644 --- a/project/urls.py +++ b/project/urls.py @@ -2,15 +2,12 @@ from django.conf import settings from django.conf.urls import include, url from django.contrib import admin -from welcome.views import index, health - urlpatterns = [ # Examples: # url(r'^$', 'project.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^$', index), - url(r'^health$', health), url(r'^admin/', include(admin.site.urls)), ] diff --git a/welcome/__init__.py b/test/__init__.py similarity index 100% rename from welcome/__init__.py rename to test/__init__.py diff --git a/test/admin.py b/test/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/test/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/test/apps.py b/test/apps.py new file mode 100644 index 00000000..92401991 --- /dev/null +++ b/test/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class TestConfig(AppConfig): + name = 'test' diff --git a/welcome/migrations/__init__.py b/test/migrations/__init__.py similarity index 100% rename from welcome/migrations/__init__.py rename to test/migrations/__init__.py diff --git a/test/models.py b/test/models.py new file mode 100644 index 00000000..71a83623 --- /dev/null +++ b/test/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/test/tests.py b/test/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/test/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/test/views.py b/test/views.py new file mode 100644 index 00000000..91ea44a2 --- /dev/null +++ b/test/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/welcome/admin.py b/welcome/admin.py deleted file mode 100644 index 5320025e..00000000 --- a/welcome/admin.py +++ /dev/null @@ -1,11 +0,0 @@ -from django.contrib import admin - -from .models import PageView - -# Register your models here. - - -class PageViewAdmin(admin.ModelAdmin): - list_display = ['hostname', 'timestamp'] - -admin.site.register(PageView, PageViewAdmin) diff --git a/welcome/database.py b/welcome/database.py deleted file mode 100644 index 2ac4a3fb..00000000 --- a/welcome/database.py +++ /dev/null @@ -1,22 +0,0 @@ -from django.conf import settings - - -def info(): - db_settings = settings.DATABASES['default'] - if 'postgres' in db_settings['ENGINE']: - engine = 'PostgreSQL' - url = '{HOST}:{PORT}/{NAME}'.format(**db_settings) - elif 'mysql' in db_settings['ENGINE']: - engine = 'MySQL' - url = '{HOST}:{PORT}/{NAME}'.format(**db_settings) - elif 'sqlite' in db_settings['ENGINE']: - engine = 'SQLite' - url = '{NAME}'.format(**db_settings) - else: - engine = 'unknown' - url = '' - return { - 'engine': engine, - 'url': url, - 'is_sqlite': engine == 'SQLite', - } diff --git a/welcome/migrations/0001_initial.py b/welcome/migrations/0001_initial.py deleted file mode 100644 index d607430f..00000000 --- a/welcome/migrations/0001_initial.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import models, migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='PageView', - fields=[ - ('id', models.AutoField(verbose_name='ID', auto_created=True, serialize=False, primary_key=True)), - ('hostname', models.CharField(max_length=32)), - ('timestamp', models.DateTimeField(auto_now_add=True)), - ], - ), - ] diff --git a/welcome/models.py b/welcome/models.py deleted file mode 100644 index 8567d5d8..00000000 --- a/welcome/models.py +++ /dev/null @@ -1,7 +0,0 @@ -from django.db import models - -# Create your models here. - -class PageView(models.Model): - hostname = models.CharField(max_length=32) - timestamp = models.DateTimeField(auto_now_add=True) diff --git a/welcome/templates/welcome/index.html b/welcome/templates/welcome/index.html deleted file mode 100644 index 1643f5de..00000000 --- a/welcome/templates/welcome/index.html +++ /dev/null @@ -1,322 +0,0 @@ - - -
- - -For instructions on how to use this application with OpenShift, start by reading the Developer Guide.
- -- The source code for this application is available to be forked from the OpenShift GitHub repository. - You can configure a webhook in your repository to make OpenShift automatically start a build whenever you push your code: -
- -After you save your webhook, if you refresh your settings page you can see the status of the ping that Github sent to OpenShift to verify it can reach the server.
-Note: adding a webhook requires your OpenShift server to be reachable from GitHub.
- -If you forked the application from the OpenShift GitHub example, you'll need to manually clone the repository to your local system. Copy the application's source code Git URL and then run:
- -$ git clone <git_url> <directory_to_create> - -# Within your project directory -# Commit your changes and push to OpenShift - -$ git commit -a -m 'Some commit message' -$ git push- -
After pushing changes, you'll need to manually trigger a build if you did not setup a webhook as described above.
- -This project has just a skeleton for you to get started. It includes:
-python manage.py startproject project .python manage.py startapp welcome- Now it is time to add your own code. - Follow along the Django tutorial to learn more about Django. -
-
- If you are running Django's development server in your local host, you can see more information
- about this request using the toolbar on the right.
- Please note that by default your Django settings have DEBUG = True and that is not appropriate for production use,
- but very handy during development.
- Refer to the Deployment Checklist
- before taking this project into a production environment.
-
Documentation on how to manage your application from the Web Console or Command Line is available at the Developer Guide.
- -You can use the Web Console to view the state of your application components and launch new builds.
- -With the OpenShift command line interface (CLI), you can create applications and manage projects from a terminal.
- -
-Server hostname: {{ hostname }}
-Database server: {{ database.engine }} ({{ database.url }})
-{% if database.is_sqlite %}Data persistence warning: You are currently using SQLite. This is fine for development, but your data won't be persisted across application deployments.{% endif %}
-Page views: {{ count }}
-
-
-