Docker users don't need DEBUG=True

This commit is contained in:
Samuel Clay 2021-04-28 10:07:21 -04:00
parent 414d09c9b0
commit b033ca0848
2 changed files with 18 additions and 11 deletions

View file

@ -69,17 +69,23 @@ class MStatistics(mongo.Document):
def collect_statistics(cls):
now = datetime.datetime.now()
cls.collect_statistics_premium_users()
print("Premiums: %s" % (datetime.datetime.now() - now))
# if settings.DEBUG:
# print("Premiums: %s" % (datetime.datetime.now() - now))
cls.collect_statistics_standard_users()
print("Standard users: %s" % (datetime.datetime.now() - now))
# if settings.DEBUG:
# print("Standard users: %s" % (datetime.datetime.now() - now))
cls.collect_statistics_sites_loaded()
print("Sites loaded: %s" % (datetime.datetime.now() - now))
# if settings.DEBUG:
# print("Sites loaded: %s" % (datetime.datetime.now() - now))
cls.collect_statistics_stories_shared()
print("Stories shared: %s" % (datetime.datetime.now() - now))
# if settings.DEBUG:
# print("Stories shared: %s" % (datetime.datetime.now() - now))
cls.collect_statistics_for_db()
print("DB Stats: %s" % (datetime.datetime.now() - now))
# if settings.DEBUG:
# print("DB Stats: %s" % (datetime.datetime.now() - now))
cls.collect_statistics_feeds_fetched()
print("Feeds Fetched: %s" % (datetime.datetime.now() - now))
# if settings.DEBUG:
# print("Feeds Fetched: %s" % (datetime.datetime.now() - now))
@classmethod
def collect_statistics_feeds_fetched(cls):
@ -294,7 +300,8 @@ class MFeedback(mongo.Document):
feedback['url'] = "https://forum.newsblur.com/t/%s/%s/%s" % (post['topic_slug'], post['topic_id'], post['post_number'])
feedback['style'] = cls.CATEGORIES[post['category_id']]
cls.objects.create(**feedback)
print("%s: %s (%s)" % (feedback['style'], feedback['subject'], feedback['date_short']))
# if settings.DEBUG:
# print("%s: %s (%s)" % (feedback['style'], feedback['subject'], feedback['date_short']))
if post_count >= 4: break
@classmethod

View file

@ -11,15 +11,15 @@ ADMINS = (
SERVER_EMAIL = 'server@newsblur.com'
HELLO_EMAIL = 'hello@newsblur.com'
NEWSBLUR_URL = 'http://docker.newsblur.com'
SESSION_COOKIE_DOMAIN = '.newsblur.com'
NEWSBLUR_URL = 'https://localhost'
SESSION_COOKIE_DOMAIN = 'localhost'
# ===================
# = Global Settings =
# ===================
DEBUG = True
DEBUG_ASSETS = DEBUG
DEBUG = False
DEBUG_ASSETS = True
MEDIA_URL = '/media/'
SECRET_KEY = 'YOUR SECRET KEY'
AUTO_PREMIUM_NEW_USERS = True