Open dudarev opened 10 years ago
scp user@site.com:/sites/photoplanet/photoplanet/photoplanet.db .
launch sqlite db locally (photoplanet/photoplanet/settings/base.py
):
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
# 'NAME': DB_NAME,
'ENGINE': 'django.db.backends.sqlite3',
'NAME': normpath(join(SITE_ROOT, 'photoplanet.db')),
Makefile
:
backup:
$(MANAGE) dbbackup --settings=photoplanet.settings.local
photoplanet/photoplanet/settings/dbbackup.sample.py
# http://django-dbbackup.readthedocs.org/en/latest/storage.html
DBBACKUP_STORAGE = ''
DBBACKUP_S3_BUCKET = ''
DBBACKUP_S3_ACCESS_KEY = ''
DBBACKUP_S3_SECRET_KEY = ''
dump_to_json:
$(MANAGE) dumpdata social_auth > social_auth.json --settings=photoplanet.settings.local
$(MANAGE) dumpdata photoplanet > photoplanet.json --settings=photoplanet.settings.local
$(MANAGE) dumpdata auth > auth.json --settings=photoplanet.settings.local
load_from_json:
$(MANAGE) loaddata social_auth.json --settings=photoplanet.settings.local
$(MANAGE) loaddata auth.json --settings=photoplanet.settings.local
$(MANAGE) loaddata photoplanet.json --settings=photoplanet.settings.local
createdb -U donetskogram -E utf8 -O donetskogram donetskogram -T template0
alter role donetskogram superuser;
ALTER USER donetskogram WITH NOSUPERUSER ;
*/10 * * * * cd /sites/photoplanet/photoplanet/ && /envs/photoplanet/bin/python2.7 /sites/photoplanet/photoplanet/manage.py load_photos --settings=photoplanet.settings.donetskogram >/dev/null 2>&1
*/40 * * * * cd /sites/photoplanet/photoplanet/ && /envs/photoplanet/bin/python2.7 /sites/photoplanet/photoplanet/manage.py rank_photos --settings=photoplanet.settings.donetskogram >/dev/null 2>&1
Re-deploy one instance on DigitalOcean