Пример #1
0
    "social.pipeline.social_auth.social_uid",
    "social.pipeline.social_auth.auth_allowed",
    "social.pipeline.social_auth.social_user",
    "social.pipeline.social_auth.associate_by_email",
    "social.pipeline.user.get_username",
    # Send a validation email to the user to verify its email address.
    # Disabled by default.
    # 'social.pipeline.mail.mail_validation',
    "social.pipeline.user.create_user",
    "social.pipeline.social_auth.associate_user",
    "social.pipeline.social_auth.load_extra_data",
    "social.pipeline.user.user_details",
)

AUTHENTICATION_BACKENDS = (
    "social.backends.facebook.FacebookOAuth2",
    "social.backends.google.GoogleOAuth2",
    "django.contrib.auth.backends.ModelBackend",
)

SOCIAL_AUTH_LOGIN_URL = "/login/"
SOCIAL_AUTH_LOGOUT_URL = "/logout/"
SOCIAL_AUTH_LOGIN_REDIRECT_URL = "/"

SOCIAL_AUTH_FACEBOOK_KEY = get_env_variable("FACEBOOK_KEY")
SOCIAL_AUTH_FACEBOOK_SECRET = get_env_variable("FACEBOOK_SECRET")
SOCIAL_AUTH_FACEBOOK_SCOPE = ["email"]

SOCIAL_AUTH_GOOGLE_OAUTH2_KEY = get_env_variable("GOOGLE_OAUTH2_KEY")
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = get_env_variable("GOOGLE_OAUTH2_SECRET")
Пример #2
0
"""
WSGI config for Musetic.
"""

import os

from django.core.wsgi import get_wsgi_application

from musetic.settings.utils import get_env_variable

try:
    from dj_static import Cling
except ImportError:
    pass

os.environ.setdefault("DJANGO_SETTINGS_MODULE", get_env_variable('DJANGO_SETTINGS_MODULE'))

if get_env_variable('DJANGO_SETTINGS_MODULE') == 'musetic.settings.production':
    application = Cling(get_wsgi_application())
else:
    application = get_wsgi_application()
Пример #3
0

musetic_celery = Celery("musetic")


# Using a string here means the worker will not have to
# pickle the object when using Windows.
musetic_celery.config_from_object("django.conf:settings")
musetic_celery.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
musetic_celery.conf.update(
    BROKER_TRANSPORT="amqp",
    BROKER_TRANSPORT_OPTIONS={"fanout_prefix": True},
    CELERY_DEFAULT_QUEUE="musetic",
    CELERY_SEND_EVENTS=True,
    CELERY_SEND_TASK_SENT_EVENT=True,
    CELERY_ALWAYS_EAGER=bool(get_env_variable("CELERY_ALWAYS_EAGER", True)),
    CELERY_TIMEZONE="America/New_York",
    CELERY_ENABLE_UTC=True,
    CELERYBEAT_SCHEDULER="celery.beat:PersistentScheduler",
    CELERYBEAT_SCHEDULE={
        "rank-all-submissions": {
            "task": "musetic.submission.tasks.RankAllSubmissionsTask",
            "schedule": timedelta(minutes=15),
        }
    },
)


@musetic_celery.task(bind=True)
def debug_task(self):
    print("Request: {0!r}".format(self.request))