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.
Note: This development server installation was tested in Docker with Ubuntu 16.04.2 LTS.
apt-get update
apt-get install -y python3-dev zlib1g-dev git wget bzip2 gcc vim redis-server screen
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
(Note the --recursive flag)
git clone --recursive https://github.com/carl9384/3dfsc_upload fscupload
conda env create -f ~/fscupload/environment.yml
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 = 'fscuser@gmail.com'
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'
cd ~/fscupload
./manage.py makemigrations
./manage.py migrate
screen
redis-server (detach with ctrl+a, ctrl+d)
screen
cd ~/fscupload
celery -A fscupload worker -l info
(detach with ctrl+a, ctrl+d)
cd ~/fscupload
./manage.py runserver 0.0.0.0:8000
You should now be able to navigate to http://192.168.4.147:8000
NOTE: The development server should not be used for production!
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