Skip to content

Commit

Permalink
Merge pull request realpython#1 from abhyudaypratap/learn
Browse files Browse the repository at this point in the history
chore(project): updated for django=2.0
  • Loading branch information
abhyudaypratap authored Dec 25, 2017
2 parents 122092c + 1055b31 commit c55292e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ __pycache__
celerybeat.pid
celerybeat-schedule
celerybeat-schedule.db
celerybeat-schedule.bak
celerybeat-schedule.dat
celerybeat-schedule.dir
dump.rdb

whoosh_index/
4 changes: 1 addition & 3 deletions feedback/emails.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
from django.conf import settings
from django.core.mail import EmailMessage
from django.template import Context
from django.template.loader import render_to_string


def send_feedback_email(email, message):
c = Context({'email': email, 'message': message})

c = {'email': email, 'message': message}
email_subject = render_to_string(
'feedback/email/feedback_email_subject.txt', c).replace('\n', '')
email_body = render_to_string('feedback/email/feedback_email_body.txt', c)
Expand Down
6 changes: 3 additions & 3 deletions picha/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'
TIME_ZONE = 'Asia/Kolkata'

USE_I18N = True

Expand All @@ -117,10 +117,10 @@
CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TIMEZONE = 'Africa/Nairobi'
CELERY_TIMEZONE = 'Asia/Kolkata'

# Emails
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
EMAIL_HOST = 'localhost'
EMAIL_PORT = 1025
DEFAULT_FROM_EMAIL = 'Picha <picha@example.com>'
DEFAULT_FROM_EMAIL = 'TEST <test@example.com>'
8 changes: 4 additions & 4 deletions picha/urls.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from django.conf.urls import include, url
from django.urls import include, path
from django.contrib import admin

from photos.views import PhotoView
from feedback.views import FeedbackView

urlpatterns = [
url(r'^$', PhotoView.as_view(), name="home"),
url(r'^feedback/$', FeedbackView.as_view(), name="feedback"),
url(r'^admin/', include(admin.site.urls)),
path('', PhotoView.as_view(), name="home"),
path('feedback/', FeedbackView.as_view(), name="feedback"),
path('admin/', admin.site.urls)
]
15 changes: 7 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Django==1.8.2
amqp==1.4.6
amqp==2.2.2
anyjson==0.3.3
billiard==3.3.0.20
celery==3.1.18
kombu==3.0.30
pytz==2015.4
redis==2.10.3
requests==2.7.0
billiard==3.5.0.3
celery==4.1.0
Django==2.0
kombu==4.1.0
redis==2.10.6
requests==2.18.4

0 comments on commit c55292e

Please sign in to comment.