burke-software/django-sis — pull request #204 by saulshanabrook (2014-12-06 23:22:18+00:00)
Title: add start of docs on how to import prod DB

I wanted to add some docs on how to get production running locally, so I can properly test importing another DB.

I am currently getting some DB errors after importing, insure why.

```bash
saul@macbookpro-cacc ~/p/django-sis> fig up
Recreating djangosis_db_1...
Recreating djangosis_redis_1...
Recreating djangosis_web_1...
Attaching to djangosis_db_1, djangosis_redis_1, djangosis_web_1
db_1 | LOG: database system was shut down at 2014-12-06 23:18:16 UTC
db_1 | LOG: autovacuum launcher started
db_1 | LOG: database system is ready to accept connections
redis_1 | _._
redis_1 | _.-``__ ''-._
redis_1 | _.-`` `. `_. ''-._ Redis 2.8.17 (00000000/0) 64 bit
redis_1 | .-`` .-```. ```\/ _.,_ ''-._
redis_1 | ( ' , .-` | `, ) Running in stand alone mode
redis_1 | |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
redis_1 | | `-._ `._ / _.-' | PID: 1
redis_1 | `-._ `-._ `-./ _.-' _.-'
redis_1 | |`-._`-._ `-.__.-' _.-'_.-'|
redis_1 | | `-._`-._ _.-'_.-' | http://redis.io
redis_1 | `-._ `-._`-.__.-'_.-' _.-'
redis_1 | |`-._`-._ `-.__.-' _.-'_.-'|
redis_1 | | `-._`-._ _.-'_.-' |
redis_1 | `-._ `-._`-.__.-'_.-' _.-'
redis_1 | `-._ `-.__.-' _.-'
redis_1 | `-._ _.-'
redis_1 | `-.__.-'
redis_1 |
redis_1 | [1] 06 Dec 23:18:20.561 # Server started, Redis version 2.8.17
redis_1 | [1] 06 Dec 23:18:20.561 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis_1 | [1] 06 Dec 23:18:20.561 * DB loaded from disk: 0.000 seconds
redis_1 | [1] 06 Dec 23:18:20.561 * The server is now ready to accept connections on port 6379
web_1 | Warning: Could not import settings_server.py
web_1 | Warning: Could not import settings_local.py
web_1 | Warning: Could not import settings_server.py
web_1 | Warning: Could not import settings_local.py
web_1 | Warning: Could not import settings_server.py
web_1 | Warning: Could not import settings_local.py
web_1 |
web_1 | Warning: You should put 'tenant_schemas' at the end of INSTALLED_APPS like this:
web_1 | INSTALLED_APPS = TENANT_APPS + SHARED_APPS + ('tenant_schemas',)
web_1 | This is necessary to overwrite built-in django management commands with their schema-aware implementations.
web_1 |
web_1 |
web_1 | Warning: You should put 'tenant_schemas' at the end of INSTALLED_APPS like this:
web_1 | INSTALLED_APPS = TENANT_APPS + SHARED_APPS + ('tenant_schemas',)
web_1 | This is necessary to overwrite built-in django management commands with their schema-aware implementations.
web_1 |
web_1 | Validating models...
web_1 |
web_1 | Warning: You should put 'tenant_schemas' at the end of INSTALLED_APPS like this:
web_1 | INSTALLED_APPS = TENANT_APPS + SHARED_APPS + ('tenant_schemas',)
web_1 | This is necessary to overwrite built-in django management commands with their schema-aware implementations.
web_1 |
web_1 | 0 errors found
web_1 |
web_1 | Django version 1.6.8, using settings 'django_sis.settings'
web_1 | Development server is running at http://0.0.0.0:8000/
web_1 | Using the Werkzeug debugger (http://werkzeug.pocoo.org/)
web_1 | Quit the server with CONTROL-C.
web_1 | * Running on http://0.0.0.0:8000/
web_1 | * Restarting with reloader
web_1 | Warning: Could not import settings_server.py
web_1 | Warning: Could not import settings_local.py
web_1 |
web_1 | -------------- celery@76ee9666b52a v3.1.16 (Cipater)
web_1 | ---- **** -----
web_1 | --- * *** * -- Linux-3.16.7-tinycore64-x86_64-with-Ubuntu-12.04-precise
web_1 | -- * - **** ---
web_1 | - ** ---------- [config]
web_1 | - ** ---------- .> app: django_sis:0x1de6e50
web_1 | - ** ---------- .> transport: redis://172.17.0.81:6379/0
web_1 | - ** ---------- .> results: djcelery.backends.database:DatabaseBackend
web_1 | - *** --- * --- .> concurrency: 8 (prefork)
web_1 | -- ******* ----
web_1 | --- ***** ----- [queues]
web_1 | -------------- .> celery exchange=celery(direct) key=celery
web_1 |
web_1 |
web_1 | [tasks]
web_1 | . django_cached_field.tasks.offload_cache_recalculation
web_1 | . django_sis.celery.debug_task
web_1 | . ecwsp.admissions.tasks.email_admissions_new_inquiries
web_1 | . ecwsp.benchmark_grade.tasks.benchmark_aggregate_task
web_1 | . ecwsp.grades.tasks.build_grade_cache
web_1 | . ecwsp.grades.tasks.build_grade_cache_task
web_1 | . ecwsp.integrations.schoolreach.tasks.sync_schoolreach_lists
web_1 | . ecwsp.naviance_sso.tasks.create_new_naviance_students
web_1 | . ecwsp.volunteer_track.tasks.handle
web_1 | . ecwsp.work_study.models.emailStudent
web_1 | . ecwsp.work_study.tasks.email_cra_nightly
web_1 | . ecwsp.work_study.tasks.update_contact_to_sugarcrm
web_1 | . ecwsp.work_study.tasks.update_contacts_from_sugarcrm
web_1 | . report_builder.tasks.report_builder_async_report_save
web_1 |
web_1 | [2014-12-06 18:18:29,838: INFO/MainProcess] Connected to redis://172.17.0.81:6379/0
web_1 | [2014-12-06 18:18:29,849: INFO/Beat] beat: Starting...
web_1 | [2014-12-06 18:18:29,852: INFO/MainProcess] mingle: searching for neighbors
web_1 | [2014-12-06 18:18:29,950: INFO/Beat] Scheduler: Sending due task update_contacts_from_sugarcrm (ecwsp.work_study.tasks.update_contacts_from_sugarcrm)
web_1 | [2014-12-06 18:18:29,959: INFO/Beat] Scheduler: Sending due task sent-admissions-email (ecwsp.admissions.tasks.email_admissions_new_inquiries)
web_1 | [2014-12-06 18:18:29,964: INFO/Beat] Scheduler: Sending due task sync_schoolreach (ecwsp.integrations.schoolreach.tasks.sync_schoolreach_lists)
web_1 | [2014-12-06 18:18:29,969: INFO/Beat] Scheduler: Sending due task email_cra_nightly (ecwsp.work_study.tasks.email_cra_nightly)
web_1 | [2014-12-06 18:18:29,972: INFO/Beat] Scheduler: Sending due task volunteer-emails (ecwsp.volunteer_track.tasks.handle)
web_1 | Validating models...
web_1 |
web_1 | Warning: You should put 'tenant_schemas' at the end of INSTALLED_APPS like this:
web_1 | INSTALLED_APPS = TENANT_APPS + SHARED_APPS + ('tenant_schemas',)
web_1 | This is necessary to overwrite built-in django management commands with their schema-aware implementations.
web_1 |
web_1 | [2014-12-06 18:18:30,870: INFO/MainProcess] mingle: all alone
web_1 | [2014-12-06 18:18:30,882: WARNING/MainProcess] celery@76ee9666b52a ready.
web_1 | [2014-12-06 18:18:31,079: INFO/MainProcess] Received task: ecwsp.work_study.tasks.update_contacts_from_sugarcrm[82bdbf1e-b6d9-41db-aef1-5aa9daf8ed10]
web_1 | [2014-12-06 18:18:31,083: INFO/MainProcess] Received task: ecwsp.admissions.tasks.email_admissions_new_inquiries[c9126224-ace5-4270-83d7-2a3562654eb6]
web_1 | [2014-12-06 18:18:31,093: INFO/MainProcess] Received task: ecwsp.integrations.schoolreach.tasks.sync_schoolreach_lists[cafc65c9-0be8-4cdf-8299-dd8a8ff1a7c4]
web_1 | [2014-12-06 18:18:31,103: INFO/MainProcess] Received task: ecwsp.work_study.tasks.email_cra_nightly[a218d5c6-18a9-4364-b59f-7379ec0a245f]
web_1 | [2014-12-06 18:18:31,114: INFO/MainProcess] Received task: ecwsp.volunteer_track.tasks.handle[bd5b80ba-e243-4d7d-b07b-c3e8e75d30c1]
db_1 | ERROR: relation "volunteer_track_volunteer" does not exist at character 309
db_1 | STATEMENT: SELECT "volunteer_track_volunteer"."id", "volunteer_track_volunteer"."student_id", "volunteer_track_volunteer"."attended_reflection", "volunteer_track_volunteer"."hours_required", "volunteer_track_volunteer"."notes", "volunteer_track_volunteer"."last_updated", "volunteer_track_volunteer"."email_queue" FROM "volunteer_track_volunteer" WHERE ("volunteer_track_volunteer"."email_queue" IS NOT NULL AND NOT ("volunteer_track_volunteer"."email_queue" = '' ))
db_1 | ERROR: relation "work_study_cracontact" does not exist at character 147
db_1 | STATEMENT: SELECT "work_study_cracontact"."id", "work_study_cracontact"."name_id", "work_study_cracontact"."email", "work_study_cracontact"."email_all" FROM "work_study_cracontact" WHERE "work_study_cracontact"."email" = true
web_1 | [2014-12-06 18:18:31,145: INFO/MainProcess] Task ecwsp.work_study.tasks.update_contacts_from_sugarcrm[82bdbf1e-b6d9-41db-aef1-5aa9daf8ed10] succeeded in 0.0595150010004s: None
web_1 | [2014-12-06 18:18:31,180: INFO/MainProcess] Task ecwsp.integrations.schoolreach.tasks.sync_schoolreach_lists[cafc65c9-0be8-4cdf-8299-dd8a8ff1a7c4] succeeded in 0.0712374220002s: None
web_1 | [2014-12-06 18:18:31,199: INFO/MainProcess] Task ecwsp.admissions.tasks.email_admissions_new_inquiries[c9126224-ace5-4270-83d7-2a3562654eb6] succeeded in 0.104556624s: None
web_1 | [2014-12-06 18:18:31,212: ERROR/MainProcess] Task ecwsp.work_study.tasks.email_cra_nightly[a218d5c6-18a9-4364-b59f-7379ec0a245f] raised unexpected: ProgrammingError('relation "work_study_cracontact" does not exist\nLINE 1: ..."email", "work_study_cracontact"."email_all" FROM "work_stud...\n ^\n',)
web_1 | Traceback (most recent call last):
web_1 | File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 240, in trace_task
web_1 | R = retval = fun(*args, **kwargs)
web_1 | File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 437, in __protected_call__
web_1 | return self.run(*args, **kwargs)
web_1 | File "/code/ecwsp/sis/helper_functions.py", line 38, in wrapper
web_1 | f(*args, **kwargs)
web_1 | File "/code/ecwsp/work_study/tasks.py", line 39, in email_cra_nightly
web_1 | for cra in cras:
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 96, in __iter__
web_1 | self._fetch_all()
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 857, in _fetch_all
web_1 | self._result_cache = list(self.iterator())
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 220, in iterator
web_1 | for row in compiler.results_iter():
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 713, in results_iter
web_1 | for rows in self.execute_sql(MULTI):
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
web_1 | cursor.execute(sql, params)
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 69, in execute
web_1 | return super(CursorDebugWrapper, self).execute(sql, params)
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 53, in execute
web_1 | return self.cursor.execute(sql, params)
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 99, in __exit__
web_1 | six.reraise(dj_exc_type, dj_exc_value, traceback)
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 53, in execute
web_1 | return self.cursor.execute(sql, params)
web_1 | ProgrammingError: relation "work_study_cracontact" does not exist
web_1 | LINE 1: ..."email", "work_study_cracontact"."email_all" FROM "work_stud...
web_1 | ^
web_1 |
web_1 | [2014-12-06 18:18:31,223: ERROR/MainProcess] Task ecwsp.volunteer_track.tasks.handle[bd5b80ba-e243-4d7d-b07b-c3e8e75d30c1] raised unexpected: ProgrammingError('relation "volunteer_track_volunteer" does not exist\nLINE 1: ...", "volunteer_track_volunteer"."email_queue" FROM "volunteer...\n ^\n',)
web_1 | Traceback (most recent call last):
web_1 | File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 240, in trace_task
web_1 | R = retval = fun(*args, **kwargs)
web_1 | File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 437, in __protected_call__
web_1 | return self.run(*args, **kwargs)
web_1 | File "/code/ecwsp/sis/helper_functions.py", line 38, in wrapper
web_1 | f(*args, **kwargs)
web_1 | File "/code/ecwsp/volunteer_track/tasks.py", line 18, in handle
web_1 | if volunteers:
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 100, in __nonzero__
web_1 | self._fetch_all()
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 857, in _fetch_all
web_1 | self._result_cache = list(self.iterator())
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 220, in iterator
web_1 | for row in compiler.results_iter():
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 713, in results_iter
web_1 | for rows in self.execute_sql(MULTI):
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 786, in execute_sql
web_1 | cursor.execute(sql, params)
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 69, in execute
web_1 | return super(CursorDebugWrapper, self).execute(sql, params)
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 53, in execute
web_1 | return self.cursor.execute(sql, params)
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line 99, in __exit__
web_1 | six.reraise(dj_exc_type, dj_exc_value, traceback)
web_1 | File "/usr/local/lib/python2.7/dist-packages/django/db/backends/util.py", line 53, in execute
web_1 | return self.cursor.execute(sql, params)
web_1 | ProgrammingError: relation "volunteer_track_volunteer" does not exist
web_1 | LINE 1: ...", "volunteer_track_volunteer"."email_queue" FROM "volunteer...
web_1 | ^
web_1 |
web_1 | 0 errors found
web_1 |
web_1 | Django version 1.6.8, using settings 'django_sis.settings'
web_1 | Development server is running at http://0.0.0.0:8000/
web_1 | Using the Werkzeug debugger (http://werkzeug.pocoo.org/)
web_1 | Quit the server with CONTROL-C.
```