ASPred (Antibody Specificity Predictor) is an innovative computational strategy developed to predict antigen-specific B-cell receptors (BCRs)
- User registration with email verification
- reCAPTCHA protection for registration
- One sequence submission per day limit
- Sequence validation (amino acids only, max 130 length)
- Results tracking and viewing
- Create a conda environment:
conda create -n aspred python=3.11
conda activate aspred- Install dependencies:
pip install -r requirements.txt- Apply migrations:
python manage.py migrate- Run development server:
python manage.py runserver-
Clone the repository to your production server
-
Install dependencies:
pip install -r requirements.txt- Create a
.envfile based onenv.prod.example:
cp env.prod.example .env- Edit the
.envfile with your production settings:
- Generate a new Django secret key
- Configure your MySQL database credentials
- Set up your email backend credentials
- Add your reCAPTCHA keys (get them from Google reCAPTCHA)
- Create required directories:
mkdir logs
mkdir staticfiles- Collect static files:
python manage.py collectstatic --settings=labsite.settings_prod- Apply migrations:
python manage.py migrate --settings=labsite.settings_prod- Set up Gunicorn:
Create a systemd service file (e.g.,
/etc/systemd/system/labsite.service):
[Unit]
Description=Laboratory Sequence Analyzer
After=network.target
[Service]
User=www-data
Group=www-data
WorkingDirectory=/path/to/your/project
Environment="PATH=/path/to/your/virtualenv/bin"
EnvironmentFile=/path/to/your/project/.env
ExecStart=/path/to/your/virtualenv/bin/gunicorn --workers 3 --bind unix:/run/labsite.sock labsite.wsgi:application
[Install]
WantedBy=multi-user.target- Set up Nginx:
Create a Nginx configuration file (e.g.,
/etc/nginx/sites-available/labsite):
server {
listen 80;
server_name yourwebsite.com www.yourwebsite.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name yourwebsite.com www.yourwebsite.com;
ssl_certificate /path/to/your/certificate.pem;
ssl_certificate_key /path/to/your/private.key;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /path/to/your/project;
}
location / {
include proxy_params;
proxy_pass http://unix:/run/labsite.sock;
}
}- Start services:
sudo systemctl start labsite
sudo systemctl enable labsite
sudo systemctl restart nginx- Always use HTTPS in production
- Keep your
.envfile secure and never commit it to version control - Regularly update dependencies
- Monitor logs for any security issues
- Back up your database regularly