Skip to content

Commit

Permalink
Merge pull request #198 from AmpliconSuite/issue_194
Browse files Browse the repository at this point in the history
Issue 194
  • Loading branch information
jluebeck authored Sep 6, 2023
2 parents 36717d2 + d63e7d2 commit 0c86781
Show file tree
Hide file tree
Showing 5 changed files with 154 additions and 7 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# AmpliconRepository

#### Authors: Forrest Kim, Jens Luebeck, Ted Liefeld, Edwin Huang, Gino Prasad, Rohil Ahuja, Rishaan Kenkre, Tushar Agashe, Devika Torvi, Thorin Tabor, Vineet Bafna
#### Authors: Forrest Kim, Jens Luebeck, Ted Liefeld, Edwin Huang, Gino Prasad, Rohil Ahuja, Rishaan Kenkre, Tushar Agashe, Devika Torvi, Madalina Giurgiu, Thorin Tabor, Vineet Bafna

---

This is the main repository for the AmpliconRepository.
Expand Down Expand Up @@ -52,6 +53,7 @@ This is the main repository for the AmpliconRepository.
## 3. Set up MongoDB locally (for development)
- Install MongoDB
- In Ubuntu this can be done with `sudo apt install mongodb-server-core`
- For newer versions of Ubuntu (e.g. 22.04+), follow the instructions here: https://www.fosstechnix.com/how-to-install-mongodb-on-ubuntu-22-04-lts/
- In macOS this can be done with
>`git config --global init.defaultBranch main`
Expand Down
20 changes: 18 additions & 2 deletions caper/caper/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import os
from django.utils.translation import gettext_lazy as _
import logging

logging.basicConfig(format='%(asctime)s %(levelname)-8s %(message)s',
level=logging.DEBUG, datefmt='%Y-%m-%d %H:%M:%S')

######################
# MEZZANINE SETTINGS #
Expand Down Expand Up @@ -139,7 +143,19 @@
# turn off email authentication when a user registers an account
ACCOUNT_EMAIL_VERIFICATION = 'none'
ACCOUNT_EMAIL_REQUIRED = False
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
#ACCOUNT_AUTHENTICATED_LOGIN_REDIRECTS = os.environ['ACCOUNT_AUTHENTICATED_LOGIN_REDIRECTS']

EMAIL_HOST = 'smtp.gmail.com' #new
EMAIL_PORT = 587 #new
EMAIL_HOST_USER = os.getenv('EMAIL_HOST_USER', default="") #new
EMAIL_HOST_PASSWORD = os.getenv('EMAIL_HOST_PASSWORD', default="")
EMAIL_USE_TLS = True #new

logging.error("EMAIL ")
logging.error( EMAIL_HOST_USER)

#ACCOUNT_AUTHENTICATED_LOGIN_REDIRECTS = os.environ['ACCOUNT_AUTHENTICATED_LOGIN_REDIRECTS']

SECRET_KEY = 'c4nc3r'
Expand Down Expand Up @@ -320,7 +336,6 @@
################

INSTALLED_APPS = [
'caper',
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
Expand All @@ -341,6 +356,7 @@
"mezzanine.pages",
"mezzanine.forms",
"mezzanine.galleries",
"caper",
# "mezzanine.twitter",
# 'mezzanine.accounts',
'allauth',
Expand Down
9 changes: 6 additions & 3 deletions caper/caper/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,12 @@ def get_one_sample(project_name, sample_name):
runs = project['runs']
for sample_num in runs.keys():
current = runs[sample_num]
if len(current) > 0 and current[0]['Sample_name'] == sample_name:
sample_out = current

try:
if len(current) > 0 and current[0]['Sample_name'] == sample_name:
sample_out = current
except:
# should not get here but we do sometimes for new projects, issue 194
sample_out = None
return project, sample_out


Expand Down
126 changes: 126 additions & 0 deletions caper/templates/account/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<!DOCTYPE html>
{% load pages_tags mezzanine_tags i18n static %}
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta n`e="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0 shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="keywords" content="{% block meta_keywords %}amplicon architect{% endblock %}">
<meta name="description" content="{% block meta_description %}A Community Accessible Pipeline for ecDNA reconstruction{% endblock %}">

<title>{% block meta_title %}{% endblock %}{% if settings.SITE_TITLE %} | {{ settings.SITE_TITLE }}{% endif %}</title>

{# Load the tag library #}
{% load bootstrap4 %}

{# Load CSS and JavaScript #}
{% bootstrap_css %}
{% bootstrap_javascript jquery='full' %}

{# Display django.contrib.messages as Bootstrap alerts #}
{% bootstrap_messages %}

<!-- Include Mezzanine Resources -->
<link rel="stylesheet" href="{% static "css/mezzanine.css" %}">
<script src="{% static "mezzanine/js/"|add:settings.JQUERY_FILENAME %}"></script>

<!-- Include Bootstrap 4 -->
<!-- <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css"> -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css" integrity="sha384-oS3vJWv+0UjzBfQzYUhtDYW+Pj2yciDJxpsK1OYPAYjqT085Qq/1cq5FLXAZQ7Ay" crossorigin="anonymous">
<!-- <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script> -->
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> -->
<!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> -->

<!-- Include favicon -->
<link rel="shortcut icon" href="{% static 'images/favicon.ico' %}" />

<!-- Include Js DataTables -->
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.12.1/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/select/1.4.0/css/select.dataTables.min.css">
<script src="https://cdn.datatables.net/1.12.1/js/jquery.dataTables.min.js
"></script>
<script src="https://cdn.datatables.net/select/1.4.0/js/dataTables.select.min.js"></script>

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-RLJSFEY3H0"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-RLJSFEY3H0');
</script>



{% block extra_css %}
{% endblock %}

{% block extra_js %}



<script>
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})


window.onload = function(){
$("input[type='submit']").addClass("btn btn-primary");
}
</script>
{% endblock %}


<!-- Include Site Stylesheet -->
<link rel="stylesheet" href="{{ STATIC_URL }}css/style.css" type="text/css" media="screen"/>
<style>
h1, .h1 {
font-size: 1.5rem !important;
}

</style>


</head>






<body id="{% block body_id %}body{% endblock %}" class="{% block body_class %}{% endblock %}" style="padding-top: 0px">

<!-- Display the navigation header -->
{% page_menu "includes/header.html" %}
<br/>
{% block index %}
<div class="row">
<div class="container main-container" style="max-width:1400px; width:90%; margin:auto;">

<!-- Display the leading content -->
<!-- {% block lead %}
<h1 id="page-title">{% block title %}{% endblock %}</h1>
<h5 id="page-description">{% block description %}{% endblock %}</h5>
{% endblock %} -->
<!-- Display the main content -->
{% block main-container %}
<div>
{% block main %}{% endblock %}
{% block content %}{% endblock %}
</div>
{% endblock main-container %}
</div>
</div>

{% endblock index %}
<!-- Display the footer -->
{% page_menu "includes/footer.html" %}
{% include "includes/footer_scripts.html" %}
</body>


</html>
2 changes: 1 addition & 1 deletion start-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ source caper/config.sh
#docker run -d --rm --name=amplicon-prod -p 80:8000 -v /home/ubuntu/AmpliconRepository-prod/logs:/srv/logs -v /home/ubuntu/AmpliconRepository-prod/caper:/srv/caper/ -w /srv/ --env GOOGLE_SECRET_KEY --env GLOBUS_SECRET_KEY --env DB_URI --env DB_NAME --env S3_STATIC_FILES -t genepattern/amplicon-repo:dev /srv/run-manage-py.sh

#docker rm amplicon-prod
docker run -d --name=amplicon-${AMPLICON_ENV} -p ${AMPLICON_ENV_PORT}:8000 -v /home/ubuntu/.aws:/root/.aws -v ${CAPER_ROOT}/logs:/srv/logs -v ${CAPER_ROOT}:/srv/ -w /srv/caper -v ${CAPER_ROOT}/.git:/srv/.git --env GOOGLE_SECRET_KEY --env GLOBUS_SECRET_KEY --env DB_URI --env DB_NAME --env S3_STATIC_FILES --env S3_FILE_DOWNLOADS -t genepattern/amplicon-repo:${AMPLICON_ENV} /srv/run-manage-py.sh
docker run -d --name=amplicon-${AMPLICON_ENV} -p ${AMPLICON_ENV_PORT}:8000 -v /home/ubuntu/.aws:/root/.aws -v ${CAPER_ROOT}/logs:/srv/logs -v ${CAPER_ROOT}:/srv/ -w /srv/caper -v ${CAPER_ROOT}/.git:/srv/.git --env EMAIL_HOST_USER --env EMAIL_HOST_PASSWORD --env GOOGLE_SECRET_KEY --env GLOBUS_SECRET_KEY --env DB_URI --env DB_NAME --env S3_STATIC_FILES --env S3_FILE_DOWNLOADS -t genepattern/amplicon-repo:${AMPLICON_ENV} /srv/run-manage-py.sh


0 comments on commit 0c86781

Please sign in to comment.