Try it live: any-sync.herokuapp.com
- Python — Main programming language
- Django — Web backend framework
- Channels — Async stuff for Django
- FFmpeg — Video & audio processing
- PostgreSQL — Primary database
- Redis — Cache database and message broker
- AWS S3 — Static and media files CDN
- Bootstrap — Web frontend library
- Heroku — Cloud application platform
- Sentry — Error tracking platform
- Install Python 3.6+ from python.org
- Install and configure virtualenv (optional)
- Install dependencies via
pip install -r config/requirements/dev.txt
- Install FFmpeg via ffmpeg.org
After these steps everything will "just work", but only with development settings. In order to deploy this project on Heroku or production server, you need to setup some extra services and environment variables described below.
Highly recommended for production (especially Heroku). Other serving options: Whitenoise middleware, Apache or Nginx. Below is shortened and simplified setup instructions originally taken from this article. The last thing to mention is that AWS S3 is completely free (with some reasonable limitations, of course) for the first year of usage.
- Create an AWS account: aws.amazon.com
- Create S3 bucket and remember its region and name: guide
- Allow read-only access: guide (2nd topic)
- Create an account for programmatic access:
- Via AWS console open IAM > Users
- Click "Add user", enter suitable name (e.g. "bucket-admin") and check "Programmatic access" option
- At the next step, select "Attach existing policies" and click "Create policy"
- In the opened tab, click "Import managed policy" and search for "AmazonS3FullAccess"
- After importing, switch to "JSON" tab and replace "Resource" by following:
"Resource": ["arn:aws:s3:::bucket", "arn:aws:s3:::bucket/*"]
- Where "bucket" should be your bucket name, of course
- Enter policy name (e.g. "bucket-full-access") and submit
- Returning to account tab, click "Refresh" and search for created policy
- Finish account registration and save "Access key ID" and "Secret access key" values
- Configure related environment variables:
- AWS_BUCKET_NAME
- AWS_REGION_NAME
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
The first thing you should do on production server is to set DJANGO_SETTINGS_MODULE
to config.settings.pro
. The reason is that manage.py
script uses config.settings.dev
by default (as it's very handy for local development) but you definitely don't want it to act like that on production. See [deploying] section for more information.
Below is a full list of variables this project depends on. Please pay attention to some values marked with
Variable name | Cast type | Development default | Production default |
---|---|---|---|
DJANGO_SETTINGS_MODULE | str | config.settings.dev | |
ENV_FILE | str | dev.env | <none> |
VERSION | str | dev | |
DATABASE_URL | database | sqlite:///sqlite.db | |
REDIS_URL | str | <none> | |
EMAIL_URL | filemail:// | ||
DJANGO_DEBUG | bool | True | False |
DJANGO_ADMIN_URL | str | ^admin/ | |
DJANGO_SECRET_KEY | str | super-secret-key | |
DJANGO_ALLOWED_HOSTS | list | * | |
DJANGO_USE_AWS | bool | False | True |
AWS_BUCKET_NAME | str | <none> | |
AWS_REGION_NAME | str | <none> | |
AWS_ACCESS_KEY_ID | str | <none> | |
AWS_SECRET_ACCESS_KEY | str | <none> |
AnySync is open-sourced software licensed under the MIT license