Skip to content

Commit

Permalink
Ready for Heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
arocks committed Jan 29, 2019
1 parent 8a25105 commit 59a4c81
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ verify_ssl = true

[packages]
django = "*"
gunicorn = "*"
django-heroku = "*"
psycopg2-binary = "*"

[requires]
python_version = "3.7"
103 changes: 102 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn showtime.wsgi --log-file -
10 changes: 8 additions & 2 deletions showtime/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

import os
import django_heroku

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand Down Expand Up @@ -54,7 +55,7 @@
TEMPLATES = [
{
"BACKEND": "django.template.backends.django.DjangoTemplates",
"DIRS": [],
"DIRS": [os.path.join(BASE_DIR, "templates")],
"APP_DIRS": True,
"OPTIONS": {
"context_processors": [
Expand Down Expand Up @@ -99,7 +100,7 @@

LANGUAGE_CODE = "en-us"

TIME_ZONE = "UTC"
TIME_ZONE = "Asia/Kolkata"

USE_I18N = True

Expand All @@ -112,3 +113,8 @@
# https://docs.djangoproject.com/en/2.1/howto/static-files/

STATIC_URL = "/static/"

STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")]

# Activate Heroku settings for Django
django_heroku.settings(locals())
6 changes: 5 additions & 1 deletion showtime/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@
"""
from django.contrib import admin
from django.urls import path
from django.views import generic

urlpatterns = [path("admin/", admin.site.urls)]
urlpatterns = [
path("", generic.TemplateView.as_view(template_name="home.html")),
path("admin/", admin.site.urls),
]
4 changes: 4 additions & 0 deletions static/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
body {
background: #F3EAB2;
color: #85144b;
}
8 changes: 8 additions & 0 deletions templates/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<html>
<head>
<link rel="stylesheet" href="/static/main.css">
</head>
<body>
<h1>Date: {% now "jS F Y H:i:s" %} </h1>
</body>
</html>

0 comments on commit 59a4c81

Please sign in to comment.