dudarev / photoplanet

Project for learnpython.dn.ua
http://dudarev.github.io/photoplanet/
6 stars 7 forks source link

Deploy on Digitalocean #11

Open dudarev opened 10 years ago

dudarev commented 10 years ago

Re-deploy one instance on DigitalOcean

dudarev commented 9 years ago

scp user@site.com:/sites/photoplanet/photoplanet/photoplanet.db .

dudarev commented 9 years ago

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')),
dudarev commented 9 years ago

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 = ''
dudarev commented 9 years ago
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
dudarev commented 9 years ago

createdb -U donetskogram -E utf8 -O donetskogram donetskogram -T template0

dudarev commented 9 years ago
alter role donetskogram superuser;
ALTER USER donetskogram WITH NOSUPERUSER ;
dudarev commented 9 years ago
*/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