Commit c962e4c8 authored by carlosribas's avatar carlosribas
Browse files

Remove debug_toolbar package from production

parent 04e375e1
...@@ -56,11 +56,6 @@ COPY rnacentral/requirements* . ...@@ -56,11 +56,6 @@ COPY rnacentral/requirements* .
# Install requirements # Install requirements
RUN pip3 install -r requirements.txt RUN pip3 install -r requirements.txt
# Install packages for local development if needed
RUN \
LOCAL_DEV="${LOCAL_DEVELOPMENT:-False}" && \
if [ "$LOCAL_DEV" = "True" ] ; then pip3 install -r requirements_dev.txt ; fi
# Install NPM dependencies # Install NPM dependencies
ADD rnacentral/portal/static/package.json rnacentral/portal/static/ ADD rnacentral/portal/static/package.json rnacentral/portal/static/
RUN cd rnacentral/portal/static && npm install --only=production RUN cd rnacentral/portal/static && npm install --only=production
...@@ -69,6 +64,17 @@ RUN cd rnacentral/portal/static && npm install --only=production ...@@ -69,6 +64,17 @@ RUN cd rnacentral/portal/static && npm install --only=production
COPY rnacentral/ $RNACENTRAL_HOME/ COPY rnacentral/ $RNACENTRAL_HOME/
RUN chown -R rnacentral:rnacentral /srv/rnacentral RUN chown -R rnacentral:rnacentral /srv/rnacentral
# Install and configure packages for local development if needed
RUN \
LOCAL_DEV="${LOCAL_DEVELOPMENT:-False}" && \
if [ "$LOCAL_DEV" = "True" ] ; then \
pip3 install -r requirements_dev.txt ; \
sed -i "13 a import debug_toolbar" "${RNACENTRAL_HOME}"/rnacentral/urls.py ; \
sed -i "31 a \ \ \ \ url(r'^__debug__/', include(debug_toolbar.urls))," "${RNACENTRAL_HOME}"/rnacentral/urls.py ; \
sed -i "129 a \ \ \ \ 'debug_toolbar.middleware.DebugToolbarMiddleware'," "${RNACENTRAL_HOME}"/rnacentral/settings.py ; \
sed -i "188 a \ \ \ \ 'debug_toolbar'," "${RNACENTRAL_HOME}"/rnacentral/settings.py ; \
fi
# Set user # Set user
USER rnacentral USER rnacentral
......
...@@ -127,7 +127,6 @@ MIDDLEWARE = ( ...@@ -127,7 +127,6 @@ MIDDLEWARE = (
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
# django-debug-toolbar # django-debug-toolbar
'debug_toolbar.middleware.DebugToolbarMiddleware',
# django-maintenance # django-maintenance
'maintenancemode.middleware.MaintenanceModeMiddleware', 'maintenancemode.middleware.MaintenanceModeMiddleware',
) )
...@@ -186,7 +185,6 @@ INSTALLED_APPS = ( ...@@ -186,7 +185,6 @@ INSTALLED_APPS = (
'apiv1', 'apiv1',
'django_filters', # required by DRF3.5+ 'django_filters', # required by DRF3.5+
'rest_framework', 'rest_framework',
'debug_toolbar',
'compressor', 'compressor',
'markdown_deux', 'markdown_deux',
'django_rq', 'django_rq',
......
...@@ -11,7 +11,6 @@ See the License for the specific language governing permissions and ...@@ -11,7 +11,6 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
""" """
import debug_toolbar
import socket import socket
from django.conf.urls import url, include from django.conf.urls import url, include
...@@ -29,7 +28,6 @@ urlpatterns = [ ...@@ -29,7 +28,6 @@ urlpatterns = [
# new sequence search # new sequence search
url(r'^sequence-search/', include('sequence_search.urls')), url(r'^sequence-search/', include('sequence_search.urls')),
# Django Debug Toolbar # Django Debug Toolbar
url(r'^__debug__/', include(debug_toolbar.urls)),
] ]
# robots.txt extras # robots.txt extras
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment