diff options
| author | Bobby <[email protected]> | 2022-07-20 06:18:14 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-07-20 06:18:14 +0530 |
| commit | f44f1061a6f32eaa5dd1a42742f92e776641e97f (patch) | |
| tree | 0df4a91c455aed6c9c05640a7fe979aa25c19686 | |
| parent | adf558afea0bcaa7dea0cd7855cafe3bf5717d4e (diff) | |
| download | thatcomputerscientist-f44f1061a6f32eaa5dd1a42742f92e776641e97f.tar.xz thatcomputerscientist-f44f1061a6f32eaa5dd1a42742f92e776641e97f.zip | |
Basic Hello World page with Debug Disabled
| -rw-r--r-- | blog/__init__.py | 0 | ||||
| -rw-r--r-- | blog/admin.py | 3 | ||||
| -rw-r--r-- | blog/apps.py | 6 | ||||
| -rw-r--r-- | blog/migrations/__init__.py | 0 | ||||
| -rw-r--r-- | blog/models.py | 3 | ||||
| -rw-r--r-- | blog/templates/home.html | 3 | ||||
| -rw-r--r-- | blog/tests.py | 3 | ||||
| -rw-r--r-- | blog/urls.py | 6 | ||||
| -rw-r--r-- | blog/views.py | 6 | ||||
| -rw-r--r-- | thatcomputerscientist/settings.py | 3 | ||||
| -rw-r--r-- | thatcomputerscientist/urls.py | 3 |
11 files changed, 34 insertions, 2 deletions
diff --git a/blog/__init__.py b/blog/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/blog/__init__.py diff --git a/blog/admin.py b/blog/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/blog/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/blog/apps.py b/blog/apps.py new file mode 100644 index 00000000..94788a5e --- /dev/null +++ b/blog/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class BlogConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'blog' diff --git a/blog/migrations/__init__.py b/blog/migrations/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/blog/migrations/__init__.py diff --git a/blog/models.py b/blog/models.py new file mode 100644 index 00000000..71a83623 --- /dev/null +++ b/blog/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/blog/templates/home.html b/blog/templates/home.html new file mode 100644 index 00000000..7f246ce9 --- /dev/null +++ b/blog/templates/home.html @@ -0,0 +1,3 @@ +<h1>Hello, world!</h1> +<hr> +<p>This website is under construction and will be available soon.</p>
\ No newline at end of file diff --git a/blog/tests.py b/blog/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/blog/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/blog/urls.py b/blog/urls.py new file mode 100644 index 00000000..9ec83613 --- /dev/null +++ b/blog/urls.py @@ -0,0 +1,6 @@ +from django.urls import path +from . import views + +urlpatterns = [ + path('', views.home, name='home'), +] diff --git a/blog/views.py b/blog/views.py new file mode 100644 index 00000000..699940a6 --- /dev/null +++ b/blog/views.py @@ -0,0 +1,6 @@ +from django.shortcuts import render + +# Create your views here. + +def home(request): + return render(request, 'home.html', {'title': 'Home'}) diff --git a/thatcomputerscientist/settings.py b/thatcomputerscientist/settings.py index f68c4e36..715a52b2 100644 --- a/thatcomputerscientist/settings.py +++ b/thatcomputerscientist/settings.py @@ -27,7 +27,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = os.getenv('AUTHORIZATION_STRING') # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = os.getenv('ENVIRONMENT') == 'development' or False ALLOWED_HOSTS = ["*"] CSRF_TRUSTED_ORIGINS = ['https://*.thatcomputerscientist.com', 'https://*.thatcomputerscientist.fly.dev/'] @@ -43,6 +43,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'blog', ] MIDDLEWARE = [ diff --git a/thatcomputerscientist/urls.py b/thatcomputerscientist/urls.py index f7e33978..2fb02d7d 100644 --- a/thatcomputerscientist/urls.py +++ b/thatcomputerscientist/urls.py @@ -14,8 +14,9 @@ Including another URLconf 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin -from django.urls import path +from django.urls import path, include urlpatterns = [ path('admin/', admin.site.urls), + path('', include('blog.urls')), ] |
