mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 20:01:05 -05:00
non working api call.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
from djrill.views import AdminListView
|
from djrill.views import DjrillIndexView
|
||||||
|
|
||||||
|
|
||||||
admin.site.register_view("djrill", AdminListView.as_view(), "Djrill")
|
admin.site.register_view("djrill", DjrillIndexView.as_view(), "Djrill")
|
||||||
|
|||||||
@@ -1,12 +1,34 @@
|
|||||||
|
from django.conf import settings
|
||||||
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.views.generic import View
|
from django.views.generic import View
|
||||||
|
|
||||||
|
try:
|
||||||
|
import requests
|
||||||
|
except ImportError:
|
||||||
|
raise ImportError("Install the damn requirements!")
|
||||||
|
|
||||||
class AdminListView(View):
|
|
||||||
|
class DjrillIndexView(View):
|
||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
return HttpResponse("HOLA")
|
#api_key = getattr(settings.MANDRILL_API_KEY, None)
|
||||||
|
#api_url = getattr(settings.MANDRILL_API_URL)
|
||||||
|
api_key = settings.MANDRILL_API_KEY or None
|
||||||
|
api_url = settings.MANDRILL_API_URL or None
|
||||||
|
if not api_key:
|
||||||
|
raise ImproperlyConfigured("You have not set your mandrill api key "
|
||||||
|
"in the settings file.")
|
||||||
|
if not api_url:
|
||||||
|
raise ImproperlyConfigured("You have not added the Mandrill api "
|
||||||
|
"url to your settings.py")
|
||||||
|
|
||||||
|
import pdb
|
||||||
|
pdb.set_trace()
|
||||||
|
r = requests.get("%susers/info.json" % api_url, data={"key": api_key})
|
||||||
|
|
||||||
|
return HttpResponse(r)
|
||||||
|
|
||||||
def admin_list_view(request):
|
def admin_list_view(request):
|
||||||
return HttpResponse("Djrill Index")
|
return HttpResponse("Djrill Index")
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ DATABASES = {
|
|||||||
|
|
||||||
# MANDRILL API KEY
|
# MANDRILL API KEY
|
||||||
MANDRILL_API_KEY = ""
|
MANDRILL_API_KEY = ""
|
||||||
|
MANDRILL_API_URL = "https://mandrillapp.com/api/1.0/"
|
||||||
|
|
||||||
|
|
||||||
# Local time zone for this installation. Choices can be found here:
|
# Local time zone for this installation. Choices can be found here:
|
||||||
|
|||||||
Reference in New Issue
Block a user