Code Monkey home page Code Monkey logo

fscupload's Introduction

Remote 3DFSC Processing

This is a Django app for uploading cryo-em maps to a remote server and processing YZT, DL, and PRB's 3DFSC program. See https://www.ncbi.nlm.nih.gov/pubmed/28671674 for the original paper.

Installation

Note: This development server installation was tested in Docker with Ubuntu 16.04.2 LTS.

1) OS Dependencies

apt-get update
apt-get install -y python3-dev zlib1g-dev git wget bzip2 gcc vim redis-server screen

2) Install Anaconda

clone Linux Anaconda3 Installer:
wget https://repo.continuum.io/archive/Anaconda3-4.4.0-Linux-x86_64.sh

run the installer (adding anaconda path to .bashrc is recommended): bash Anaconda3-4.4.0-Linux-x86_64.sh

3) Clone Repository

(Note the --recursive flag)
git clone --recursive https://github.com/carl9384/3dfsc_upload fscupload

4) Create virtual environment

conda env create -f ~/fscupload/environment.yml

Getting Started

1) Configure settings.py

cd ~/fscupload
cp settings.py.template settings.py

Change SECRET_KEY to a random 50 character string (this should be kept secret for security reasons)
(You can use this site: http://www.miniwebtool.com/django-secret-key-generator/)

DEBUG is set to TRUE for the development server. This should be set to FALSE for production (it will cause a memory leak, eventually)

Set EMAIL_ variables for your configuration.
For SMTP, ammend EMAIL_HOST, EMAIL_HOST_USER, EMAIL_HOST_PASSWORD for your email account.
e.g.

EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'fscpassword'

Set PROJECT_ROOT to the path where ./manage.py is located, e.g. /home/cnegro/fscupload/manage.py PROJECT_ROOT = '/home/cnegro/fscupload/'

Set SITE_URL to the domain of the site you plan to use: SITE_URL = 'http://192.168.4.147:8000'

2) Migrate database

cd ~/fscupload
./manage.py makemigrations
./manage.py migrate

3) Start redis

screen
redis-server (detach with ctrl+a, ctrl+d)

4) Start celery worker task

screen
cd ~/fscupload
celery -A fscupload worker -l info
(detach with ctrl+a, ctrl+d)

5) Launch Django test server

cd ~/fscupload
./manage.py runserver 0.0.0.0:8000

6) Use it

You should now be able to navigate to http://192.168.4.147:8000

NOTE: The development server should not be used for production!

Thanks

These tutorial links helped: http://www.bogotobogo.com/python/Django/Python_Django_Image_Files_Uploading_Example.php https://realpython.com/blog/python/asynchronous-tasks-with-django-and-celery/ http://garmoncheg.blogspot.com.au/2012/07/django-resetting-passwords-with.html https://stackoverflow.com/questions/388800/how-do-i-use-the-built-in-password-reset-change-views-with-my-own-templates https://github.com/johnsensible/django-sendfile

fscupload's People

Contributors

carl9384 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.