From d22f9f0c93721ae2ab310f09686ab42c6822d784 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Thu, 2 Aug 2018 22:51:18 +0530 Subject: added app website --- website/__init__.py | 0 website/admin.py | 3 +++ website/apps.py | 5 +++++ website/context_processors.py | 7 +++++++ website/migrations/__init__.py | 0 website/models.py | 3 +++ website/tests.py | 3 +++ website/urls.py | 7 +++++++ website/views.py | 12 ++++++++++++ 9 files changed, 40 insertions(+) create mode 100644 website/__init__.py create mode 100644 website/admin.py create mode 100644 website/apps.py create mode 100644 website/context_processors.py create mode 100644 website/migrations/__init__.py create mode 100644 website/models.py create mode 100644 website/tests.py create mode 100644 website/urls.py create mode 100644 website/views.py diff --git a/website/__init__.py b/website/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/website/admin.py b/website/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/website/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/website/apps.py b/website/apps.py new file mode 100644 index 0000000..5e338e4 --- /dev/null +++ b/website/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class WebsiteConfig(AppConfig): + name = 'website' diff --git a/website/context_processors.py b/website/context_processors.py new file mode 100644 index 0000000..8abae49 --- /dev/null +++ b/website/context_processors.py @@ -0,0 +1,7 @@ +from django.conf import settings + +def root_url(request): + """ + Pass your root_url from the settings.py + """ + return {'SITE_URL': settings.ROOT_URL} diff --git a/website/migrations/__init__.py b/website/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/website/models.py b/website/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/website/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/website/tests.py b/website/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/website/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/website/urls.py b/website/urls.py new file mode 100644 index 0000000..88a9cac --- /dev/null +++ b/website/urls.py @@ -0,0 +1,7 @@ +from django.urls import path + +from . import views + +urlpatterns = [ + path('', views.index, name='index'), +] diff --git a/website/views.py b/website/views.py new file mode 100644 index 0000000..4b6f624 --- /dev/null +++ b/website/views.py @@ -0,0 +1,12 @@ +# Create your views here. + +from django.http import HttpResponse +from django.shortcuts import render +from django.shortcuts import render_to_response +from django.template import loader + + +def index(request): + context = {} + template = loader.get_template('index.html') + return HttpResponse(template.render(context, request)) -- cgit