diff --git a/neoexchange/astrometrics/ephem_subs.py b/neoexchange/astrometrics/ephem_subs.py index 5a13786be..12d3e086a 100644 --- a/neoexchange/astrometrics/ephem_subs.py +++ b/neoexchange/astrometrics/ephem_subs.py @@ -70,7 +70,6 @@ def compute_ephem(d, orbelems, sitecode, dbg=False, perturb=True, display=False) epochofel = datetime.strptime(orbelems['epochofel'], '%Y-%m-%d %H:%M:%S') except TypeError: epochofel = orbelems['epochofel'] - print epochofel epoch_mjd = datetime2mjd_utc(epochofel) else: epoch_mjd = orbelems['epoch'] diff --git a/neoexchange/astrometrics/sources_subs.py b/neoexchange/astrometrics/sources_subs.py index 213de8d4d..067b35406 100644 --- a/neoexchange/astrometrics/sources_subs.py +++ b/neoexchange/astrometrics/sources_subs.py @@ -14,14 +14,15 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ''' -import urllib2, os + from bs4 import BeautifulSoup from datetime import datetime -from reqdb.requests import Request, UserRequest -from reqdb.client import SchedulerClient - from re import sub +from reqdb.client import SchedulerClient +from reqdb.requests import Request, UserRequest import logging +import urllib2, os + logger = logging.getLogger(__name__) def download_file(url, file_to_save): diff --git a/neoexchange/core/views.py b/neoexchange/core/views.py index 564d58cf6..4d518acde 100644 --- a/neoexchange/core/views.py +++ b/neoexchange/core/views.py @@ -40,6 +40,8 @@ class LoginRequiredMixin(object): + #login_url = reverse('auth_login') + @classmethod def as_view(cls, **initkwargs): view = super(LoginRequiredMixin, cls).as_view(**initkwargs) diff --git a/neoexchange/neox/__init__.py b/neoexchange/neox/__init__.py index f8fb2fd89..e69de29bb 100644 --- a/neoexchange/neox/__init__.py +++ b/neoexchange/neox/__init__.py @@ -1,29 +0,0 @@ -''' -NEO exchange: NEO observing portal for Las Cumbres Observatory Global Telescope Network -Copyright (C) 2014-2015 LCOGT - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. -''' -# -# monkey patch urlresolvers.reverse, -# to be aware of the application PREFIX -# - -import django.core.urlresolvers - -old_reverse = django.core.urlresolvers.reverse -def myreverse(*args, **kwargs): - from django.conf import settings - try: - return settings.PREFIX + old_reverse(*args, **kwargs) - except: - return old_reverse(*args, **kwargs) -django.core.urlresolvers.reverse = myreverse diff --git a/neoexchange/neox/settings.py b/neoexchange/neox/settings.py index c95bbbd81..6dce0f42a 100644 --- a/neoexchange/neox/settings.py +++ b/neoexchange/neox/settings.py @@ -15,6 +15,8 @@ PREFIX = os.environ.get('PREFIX', '') +FORCE_SCRIPT_NAME = '/neoexchange' + BASE_DIR = os.path.dirname(CURRENT_PATH) ADMINS = ( @@ -105,6 +107,8 @@ }, ] +LOGIN_URL = PREFIX +'/accounts/login/' + LOGIN_REDIRECT_URL = PREFIX + '/' # GRAPPELLI_INDEX_DASHBOARD = 'neox.dashboard.CustomIndexDashboard' @@ -162,7 +166,7 @@ 'filters': ['require_debug_false'] }, 'console': { - 'level': 'DEBUG', + 'level': 'ERROR', 'class': 'logging.StreamHandler', } }, @@ -180,6 +184,10 @@ 'core' : { 'handlers' : ['file','console'], 'level' : 'DEBUG', + }, + 'astrometrics' : { + 'handlers' : ['file','console'], + 'level' : 'ERROR', } } } diff --git a/neoexchange/templates/admin/login.html b/neoexchange/templates/admin/login.html index ebe787211..c1a3df6e8 100644 --- a/neoexchange/templates/admin/login.html +++ b/neoexchange/templates/admin/login.html @@ -25,7 +25,7 @@
{{ form.password.errors }} {{ form.password.label_tag }} {{ form.password }} - +
{% url 'admin_password_reset' as password_reset_url %} {% if password_reset_url %}