From 8f9d9a7266852eba357ca7be1046dfac6bbeaef7 Mon Sep 17 00:00:00 2001 From: feysal-Ibrahim Date: Feb 23 2019 00:58:00 +0000 Subject: [PATCH 1/3] enabled the django debug too to appper in the in the index page when in development stage --- diff --git a/happinesspackets/settings/base.py b/happinesspackets/settings/base.py index 249badd..b2fa326 100644 --- a/happinesspackets/settings/base.py +++ b/happinesspackets/settings/base.py @@ -9,7 +9,8 @@ PROJECT_DIR = Path(__file__).ancestor(3) # For clean_pyc to work without complaining BASE_DIR = PROJECT_DIR -DEBUG = False +# DEBUG = False +DEBUG = True ADMINS = ( ('Anna Philips', 'algogator@fedoraproject.org'), @@ -69,8 +70,22 @@ MIDDLEWARE_CLASSES = [ 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', + 'debug_toolbar.panels.versions.VersionsPanel' , 'debug_toolbar.panels.timer.TimerPanel' , + 'debug_toolbar.panels.settings.SettingsPanel' , 'debug_toolbar.panels.headers.HeadersPanel' , + 'debug_toolbar.panels.request.RequestPanel' , 'debug_toolbar.panels.sql.SQLPanel' , + 'debug_toolbar.panels.staticfiles.StaticFilesPanel' , 'debug_toolbar.panels.templates.TemplatesPanel' , + 'debug_toolbar.panels.cache.CachePanel' , 'debug_toolbar.panels.signals.SignalsPanel' , + 'debug_toolbar.panels.logging.LoggingPanel' , 'debug_toolbar.panels.redirects.RedirectsPanel' ] + +""" +function to get the django debug toolbar +""" +def show_toolbar(request): + return True + +DEBUG_TOOLBAR_CONFIG={'INTERCEPT_REDIRECT': False , 'SHOW_TOOLBAR_CALLBACK': show_toolbar , } ROOT_URLCONF = 'happinesspackets.urls' # Python dotted path to the WSGI application used by Django's runserver. diff --git a/happinesspackets/settings/dev.py b/happinesspackets/settings/dev.py index a7ccc0b..20eab94 100644 --- a/happinesspackets/settings/dev.py +++ b/happinesspackets/settings/dev.py @@ -18,7 +18,7 @@ DATABASES = { EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" -SECRET_KEY = 'only-for-testing' +SECRET_KEY = '*_8(8jk-1j&m-zy1p9*giy%$x9ngyr_!s_=g3o-mdcz@h!-x9m' INTERNAL_IPS = ('127.0.0.1',) @@ -47,6 +47,12 @@ MIDDLEWARE_CLASSES = [ INSTALLED_APPS += ( 'debug_toolbar', ) +MIDDLEWARE_CLASSES+=['debug_toolbar.middleware.DebugToolbarMiddleware' , ] + +# DEBUG TOOLBAR SETTINGS: + + + SELENIUM_SCREENSHOT_DIR = PROJECT_DIR.child('selenium-screenshots') diff --git a/happinesspackets/urls.py b/happinesspackets/urls.py index 375f4d3..a2587aa 100644 --- a/happinesspackets/urls.py +++ b/happinesspackets/urls.py @@ -4,14 +4,22 @@ import django from django.conf import settings from django.conf.urls import include, url from django.contrib import admin +from django.conf.urls.static import static urlpatterns = [ url(r'^oidc/', include('mozilla_django_oidc.urls')), url(r'^', include('happinesspackets.messaging.urls', namespace="messaging")), ] - +# refactor django toolbar conflict +""" +dispalying the django debug toolbar +""" if settings.ADMIN_ENABLED or settings.DEBUG: urlpatterns.append(url(r'^drunken-octo-lama/', include(admin.site.urls))) + if settings: + import debug_toolbar + + urlpatterns+=[url( '__debug__/' , include( debug_toolbar.urls ) ) , ] if settings.DEBUG: urlpatterns.append(url(r'^media/(?P.*)$', django.views.static.serve, {'document_root': settings.MEDIA_ROOT})) diff --git a/happinesspackets/wsgi.py b/happinesspackets/wsgi.py index 97f9ef7..65de01c 100644 --- a/happinesspackets/wsgi.py +++ b/happinesspackets/wsgi.py @@ -20,7 +20,14 @@ from django.core.wsgi import get_wsgi_application # We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks # if running multiple sites in the same mod_wsgi process. To fix this, use # mod_wsgi daemon mode with each site in its own daemon process, or use -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "happinesspackets.settings") +""" + you can change this os settings to whatever setting file you want to work + note: now the setting is for development only + hint: change to os.environ.setdefault( "DJANGO_SETTINGS_MODULE" , "happinesspackets.settings.prod" )/ + when in production + hint: do the same also manage.py file + """ +os.environ.setdefault( "DJANGO_SETTINGS_MODULE" , "happinesspackets.settings.dev" ) # This application object is used by any WSGI server configured to use this # file. This includes Django's development server, if the WSGI_APPLICATION diff --git a/manage.py b/manage.py index 18f7994..c0d887b 100755 --- a/manage.py +++ b/manage.py @@ -3,7 +3,14 @@ import os import sys if __name__ == "__main__": - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "happinesspackets.settings") + """ + you can change this os settings to whatever setting file you want to work + note: now the setting is for development only + hint: change to os.environ.setdefault( "DJANGO_SETTINGS_MODULE" , "happinesspackets.settings.prod" )/ + when in production + """ + os.environ.setdefault( "DJANGO_SETTINGS_MODULE" , "happinesspackets.settings.dev" ) + from django.core.management import execute_from_command_line From ecb50da7109244e928af457f3f5b7ddbac739bdd Mon Sep 17 00:00:00 2001 From: feysal-Ibrahim Date: Feb 23 2019 01:17:18 +0000 Subject: [PATCH 2/3] fixed and removed one of the duplicates send me happiness button --- diff --git a/templates/messaging/start.html b/templates/messaging/start.html index f0562c5..e4edec8 100644 --- a/templates/messaging/start.html +++ b/templates/messaging/start.html @@ -19,10 +19,6 @@ trying to spread that feeling.

-

- Send some happiness now! 💌 -

-

How does it work?

Openly expressing appreciation, gratitude, or happiness to other people can be difficult. This is especially From 5bd30f436e0709131e520a44ab8daeeb6f60c3e0 Mon Sep 17 00:00:00 2001 From: feysal-Ibrahim Date: Feb 23 2019 18:29:13 +0000 Subject: [PATCH 3/3] modify the faq template --- diff --git a/templates/messaging/faq.html b/templates/messaging/faq.html index 11ea5a8..8beaef9 100644 --- a/templates/messaging/faq.html +++ b/templates/messaging/faq.html @@ -1,91 +1,223 @@ {% extends 'base.html' %} {% block content %} -

- - -

Who made this and why?

-

- The Open-Source Happiness Packets project was created by Sasha Romijn and - Mikey Ariel in March 2016. - The idea came about while we were building our - Healthy Minds in a Healthy Community presentation - for Djangocon Europe 2016. One of the issues we wanted to address in the presentation was that many - people are unaware of how loved, appreciated, or admired they are by their peers, since our culture seems - to discourage positive feedback and amplify negative feedback. With this project, we wanted to provide a platform - for people to send positive feedback, thanks, or just a kind word to their peers, with hope to make it - easier and more acceptable for people to spread happiness, gratitude and appreciation in open-source communities. -

- -

Isn't it weird to send these notes to other people?

-

- Many of us come from a culture where it's sometimes more acceptable to complain about the negative than to - acknowledge the positive things. Therefore, it might feel a little awkward to communicate positive feedback - directly to others. However, in our personal experience, once you take that first step, any awkwardness - is quickly replaced by feeling good about helping someone else feel good. -

- -

Can I send anything I want?

-

- We don't screen the content of messages. However, all messages must meet the - Django Project Code of Conduct. - Notably, harassment, insults and other exclusionary behavior are never acceptable. -

-

- Violations of this can result in blocking you from using the service. Your message might also be shared with - the Django Code of Conduct committee, who reserve the right to take further action of their own. If you're a member - of another open-source community, your message might be shared with any code of conduct committee or similar group - from that community. -

- -

Should I reply when I get a Happiness Packet from someone?

-

- You are under no obligation to respond to the sender of the Happiness Packet. But if you are inspired by what - you received, you are welcome to respond or send your own Happiness Packet. We always encourage sending more - messages, but only if they are sincere. -

-

- Note: if the sender selected to remain anonymous, you cannot reply to their message. -

- -

Are my Happiness Packets private?

-

- By default, we only send your message with the recipient. They will get an e-mail with your message - and can view it online. We only share your name and email address with the recipient if you choose this option. - We may analyse messages and their metadata for statistical analysis. -

-

- In case of suspected abuse or Code of Conduct violations, the service administrators might view and read - your message to determine further processing. -

- -

What happens if I choose to display my message publicly?

-

- If both the sender and the recipient of the message agree to publish the message on the website, - the message will be displayed in the Happiness Archive. - We encourage you to share your messages with the community, - but the choice is yours and you are not obligated to choose this option if you do not feel comfortable with it. - You can also choose to publish the message but keep the sender and recipient names private. -

-

- Note: we cannot modify the content of the message after it is sent, so if the message includes personally-identifying - information or references to third parties, they will be published even if you choose to hide the sender and - recipient names. -

- -

I received an abusive message, what should I do?

-

- Please report this to info@happinesspackets.io, preferably by - forwarding the original email that contains the message. -

- -

I don't want to receive any email from you

-

- Every email we sent includes a link to stop receiving all future e-mail messages. If you follow the link - and confirm, your email address will not be able to be used anywhere on the site. - Note: if you select to block your email address, you will not be able to send Happiness Packets yourself. -

-
+ + + + + + + + + + + + + + +

Frequently Asked Questions

+ +
+

Who made this and why?

+
The Open-Source Happiness Packets project was created by Sasha Romijn + and + Mikey Ariel in March 2016. + The idea came about while we were building our + Healthy Minds in a Healthy Community presentation + for Djangocon Europe 2016. One of the issues we wanted to address in the presentation was that many + people are unaware of how loved, appreciated, or admired they are by their peers, since our culture seems + to discourage positive feedback and amplify negative feedback. With this project, we wanted to provide a platform + for people to send positive feedback, thanks, or just a kind word to their peers, with hope to make it + easier and more acceptable for people to spread happiness, gratitude and appreciation in open-source + communities.
+
+
+

Isn't it weird to send these notes to other people?

+
+
Many of us come from a culture where it's sometimes more acceptable to complain about the negative than to + acknowledge the positive things. Therefore, it might feel a little awkward to communicate positive feedback + directly to others. However, in our personal experience, once you take that first step, any awkwardness + is quickly replaced by feeling good about helping someone else feel good.
+
+ +
+

Can I send anything I want?

+
+
We don't screen the content of messages. However, all messages must meet the + Django Project Code of Conduct. + Notably, harassment, insults and other exclusionary behavior are never acceptable
+
+ +
+

Should I reply when I get a Happiness Packet from someone?

+
+
You are under no obligation to respond to the sender of the Happiness Packet. But if you are inspired by + what you received, you are welcome to respond or send your own Happiness Packet. We always encourage sending more messages, but only if they are sincere. + + Note: if the sender selected to remain anonymous, you cannot reply to their message.
+
+ + +
+

Are my Happiness Packets private?

+
+
By default, we only send your message with the recipient. They will get an e-mail with your message and + can view it online. We only share your name and email address with the recipient if you choose this option. We may analyse messages and their metadata for statistical analysis. + + In case of suspected abuse or Code of Conduct violations, the service administrators might view and read your + message to determine further processing.
+
+ + +
+

What happens if I choose to display my message publicly?

+
+
If both the sender and the recipient of the message agree to publish the message on the website, the + message will be displayed in the Happiness Archive. We encourage you to share your messages with the community, but the choice is yours and you are not obligated to choose this option if you do not feel comfortable with it. You can also choose to publish the message but keep the sender and recipient names private. +
+
+ Note: we cannot modify the content of the message after it is sent, so if the message includes personally-identifying information or references to third parties, they will be published even if you choose to hide the sender and recipient names.
+
+ + +
+

I received an abusive message, what should I do?

+
+
Please report this to fedora.happinesspackets@gmail.com, preferably by forwarding the original email that + contains the message.
+
+ + +
+

don't want to receive any email from you

+
+
Every email we sent includes a link to stop receiving all future e-mail messages. If you follow the link and + confirm, your email address will not be able to be used anywhere on the site. Note: if you select to block your + email address, you will not be able to send Happiness Packets yourself.
+
+ + + + {% endblock content %}