Auth stuff.

master
Nick Sergeant 2016-11-01 15:29:47 -04:00
ebeveyn b08ca9a803
işleme fdc108aa98
8 değiştirilmiş dosya ile 6 ekleme ve 34 silme

Dosyayı Görüntüle

@ -2,7 +2,6 @@ import datetime
from annoying.functions import get_object_or_None
from django.shortcuts import get_object_or_404, render
from django.template import RequestContext
from snipts.models import Snipt
THEME_CHOICES = {

Dosyayı Görüntüle

@ -37,7 +37,7 @@ AUTH_PROFILE_MODULE = 'accounts.UserProfile'
AUTHENTICATION_BACKENDS = ('utils.backends.EmailOrUsernameModelBackend',)
BASE_PATH = os.path.dirname(__file__)
DEBUG = True if 'DEBUG' in os.environ else False
DEFAULT_FROM_EMAIL = os.environ.get('POSTMARK_EMAIL', 'snipt@localhost')
DEFAULT_FROM_EMAIL = os.environ.get('POSTMARK_EMAIL', 'support@snipt.net')
EMAIL_BACKEND = 'postmark.django_backend.EmailBackend'
HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor'
INTERNAL_IPS = ('127.0.0.1',)
@ -65,7 +65,7 @@ ROOT_URLCONF = 'urls'
SECRET_KEY = os.environ.get('SECRET_KEY', 'changeme')
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
SEND_BROKEN_LINK_EMAILS = False
SERVER_EMAIL = os.environ.get('POSTMARK_EMAIL', 'snipt@localhost')
SERVER_EMAIL = os.environ.get('POSTMARK_EMAIL', 'support@snipt.net')
SESSION_COOKIE_AGE = 15801100
SESSION_COOKIE_SECURE = True if 'USE_SSL' in os.environ else False
SITE_ID = 1

Dosyayı Görüntüle

@ -102,7 +102,7 @@ def report_spam(request, snipt_id):
User: https://snipt.net/admin/auth/user/{}/delete/
Reporter: https://snipt.net/{}/
""".format(snipt.id, snipt.user.id, request.user.username),
os.environ.get('POSTMARK_EMAIL', 'snipt@localhost'),
os.environ.get('POSTMARK_EMAIL', 'support@snipt.net'),
['nick@snipt.net'],
fail_silently=False)

Dosyayı Görüntüle

@ -42,7 +42,7 @@ def for_teams_complete(request):
Team: https://snipt.net/{}
Email: {}
""".format(team.slug, team.email),
os.environ.get('POSTMARK_EMAIL', 'snipt@localhost'),
os.environ.get('POSTMARK_EMAIL', 'support@snipt.net'),
['nick@snipt.net'],
fail_silently=False)

Dosyayı Görüntüle

@ -1,11 +1 @@
Hey there,
Welcome to Snipt. If you ever have any thoughts or issues with the site whatsoever, please feel free to contact me directly.
Thanks!
Nick Sergeant
https://twitter.com/nicksergeant
https://twitter.com/snipt
nick@snipt.net
https://snipt.net
Welcome to Snipt!

Dosyayı Görüntüle

@ -7,7 +7,7 @@
{% block content %}
<div class="static-box">
<div class="alert alert-info alert-alone">
Signup complete! You're now logged in. Go <a href="/{{ request.user.username }}/">home</a>, perhaps?
Signup complete! You're now logged in. Go <a href="/login-redirect/">home</a>, perhaps?
</div>
</div>
{% endblock %}

Dosyayı Görüntüle

@ -1,15 +0,0 @@
from registration.backends.default.views import RegistrationView
from utils.forms import SniptRegistrationForm
class SniptRegistrationView(RegistrationView):
"""
Custom registration view that uses our custom form.
"""
form_class = SniptRegistrationForm
def dispatch(self, request, *args, **kwargs):
return super(RegistrationView, self).dispatch(request, *args, **kwargs)
def get_success_url(self, request, user):
return '/account/activate/'

Dosyayı Görüntüle

@ -6,8 +6,6 @@ from blogs.views import blog_list
from django.contrib.auth.models import User
from django.db.models import Count
from django.http import HttpResponseRedirect, HttpResponseBadRequest
from django.shortcuts import render
from django.template import RequestContext
from snipts.models import Snipt
from snipts.utils import get_lexers_list
from taggit.models import Tag