Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,5 @@ celerybeat-schedule
# virtualenv
venv/
ENV/
.coverage
*.pyc
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include README.rst
recursive-include django_simple_forum/templates *
7 changes: 3 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
django-simple-forum:
=====================================

.. image:: https://readthedocs.org/projects/django-simple-forum/badge/?version=latest
:target: http://django-simple-forum.readthedocs.io/en/latest/
:alt: Documentation Status
Expand All @@ -17,7 +16,8 @@ django-simple-forum:

.. image:: https://img.shields.io/github/license/micropyramid/django-simple-forum.svg
:target: https://pypi.python.org/pypi/django-simple-forum/



Introduction:
=============

Expand All @@ -31,11 +31,10 @@ Modules used:
* Python >= 2.6 (or Python 3.4)
* Django = 1.9.6
* JQuery >= 1.7
* Django-compressor == 2.0
* Microurl >=3.6.1
* Boto == 2.40.0
* Sendgrid == 2.2.1

* django-ses-gateway

Installation Procedure
======================
Expand Down
Empty file removed __init__.py
Empty file.
Binary file removed django_simple_forum/__init__.pyc
Binary file not shown.
Binary file removed django_simple_forum/__pycache__/__init__.cpython-34.pyc
Binary file not shown.
Binary file removed django_simple_forum/__pycache__/admin.cpython-34.pyc
Binary file not shown.
Binary file removed django_simple_forum/__pycache__/forms.cpython-34.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed django_simple_forum/__pycache__/tests.cpython-34.pyc
Binary file not shown.
Binary file removed django_simple_forum/__pycache__/urls.cpython-34.pyc
Binary file not shown.
Binary file removed django_simple_forum/__pycache__/views.cpython-34.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
14 changes: 3 additions & 11 deletions django_simple_forum/sending_mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,12 @@
import sendgrid
import requests
from django.core.mail import EmailMultiAlternatives
from django_ses_gateway.sending_mail import sending_mail


def Memail(mto, mfrom, msubject, mbody):
print (settings.MAIL_SENDER)
def Memail(mto, mfrom, msubject, mbody, email_template_name, context):
if settings.MAIL_SENDER == 'AMAZON':
# conn=SESConnection(settings.AM_ACCESS_KEY, settings.AM_PASS_KEY)
conn = boto.ses.connect_to_region(
'eu-west-1',
aws_access_key_id=settings.AM_ACCESS_KEY,
aws_secret_access_key=settings.AM_PASS_KEY
)
conn.send_email(mfrom, msubject, mbody, mto, format='html')

sending_mail(msubject, email_template_name, context, mfrom, mto)
elif settings.MAIL_SENDER == 'MAILGUN':
requests.post(
settings.MGUN_API_URL,
Expand All @@ -37,7 +30,6 @@ def Memail(mto, mfrom, msubject, mbody):
reposne = sg.send(sending_msg)
print (reposne)
else:
print (mto)
text_content = msubject
msg = EmailMultiAlternatives(msubject, mbody, mfrom, mto)
msg.attach_alternative(mbody, "text/html")
Expand Down
Binary file not shown.
Binary file not shown.
6 changes: 3 additions & 3 deletions django_simple_forum/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def form_valid(self, form):
subject = "New Comment For The Topic " + (comment.topic.title)
rendered = t.render(c)
mfrom = settings.DEFAULT_FROM_EMAIL
Memail(mto, mfrom, subject, rendered)
Memail(mto, mfrom, subject, rendered, 'emails/comment_add.html', c)

for user in comment.mentioned.all():
mto = [user.user.email]
Expand All @@ -565,7 +565,7 @@ def form_valid(self, form):
subject = "New Comment For The Topic " + (comment.topic.title)
rendered = t.render(c)
mfrom = settings.DEFAULT_FROM_EMAIL
Memail(mto, mfrom, subject, rendered)
Memail(mto, mfrom, subject, rendered, 'emails/comment_mentioned.html', c)

timeline_activity(user=self.request.user, content_object=comment,
namespace='commented for the', event_type="comment-create")
Expand Down Expand Up @@ -1260,7 +1260,7 @@ def form_valid(self, form):
message = '<p>Your Password for the forum account is <strong>'+password+'</strong></p><br/><p>Use this credentials to login into <a href="' + settings.HOST_URL + '/forum/">forum</a></p>'
to = user.email
from_email = settings.DEFAULT_FROM_EMAIL
Memail(to, from_email, subject, message)
Memail(to, from_email, subject, message, '', '')
user.set_password(password)
user.save()
data = {"error": False, "response": "An Email is sent to the entered email id"}
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Modules used:
* Microurl >=3.6.1
* Boto == 2.40.0
* Sendgrid == 2.2.1
* django-ses-gateway


Installation Procedure
Expand Down
57 changes: 57 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import os
from setuptools import setup

with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
PROJECT_NAME = 'django-simple-forum'

data_files = []
for dirpath, dirnames, filenames in os.walk(PROJECT_NAME):
for i, dirname in enumerate(dirnames):
if dirname.startswith('.'):
del dirnames[i]
if '__init__.py' in filenames:
continue
elif filenames:
for f in filenames:
data_files.append(os.path.join(
dirpath[len(PROJECT_NAME) + 1:], f))

setup(
name='django-simple-forum',
version='0.0.1',
packages=['django_simple_forum', 'django_simple_forum.templatetags', 'django_simple_forum.migrations'],
include_package_data=True,
description='A Full featured forum, easy to integrate and use.',
long_description=README,
url='https://github.com/MicroPyramid/django-simple-forum',
author='Micropyramid',
author_email='hello@micropyramid.com',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
install_requires=[
"Django>=1.6.0,<1.10",
'django-simple-pagination',
'django-storages',
'microurl',
'boto',
'sendgrid',
'sorl-thumbnail==12.4a1',
'django-ses-gateway'
],
)
2 changes: 1 addition & 1 deletion test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
'django.contrib.sessions',
'django.contrib.staticfiles',
'sorl.thumbnail',
'simple_pagination',
#'simple_pagination',
'django_simple_forum',
),
MIDDLEWARE_CLASSES=(
Expand Down