Out of the box, the Fabric fabfile will not move your database from your local workspace to your production or any other environment.
On Thu, Dec 18, 2014 at 8:29 AM, vikraw <[email protected]> wrote: > > Ken, > The links u sent mentioned of 'rsync' and now i got my setup working using > - rsync(for static folder), pg_dump/restore(for database); then deleting > the ghost migration errors!! Earlier i was using 'reserve' keyword with > --delete-ghost-migrations which was throwing bunch of errors. removing that > reserve word made everything work. > However, i am still not sure how the default 'fab all' works out of box > for other people. maybe i will discover someday. i tried more than 5-6 > times 'fab all' (the default script) and None of the pages,images etc added > to the "cartridge" shop section ever appear on aws. > But for now everything is working as expected for me. Thank you ken for > the help, till i run into something else > > On Tuesday, December 16, 2014 8:21:47 PM UTC+5:30, Kenneth Bolton wrote: > >> >> >> On Tue, Dec 16, 2014 at 9:26 AM, vikraw <[email protected]> wrote: >>> >>> So to make my things work I commented out the >>> >>> - python syncdb and makemigrate commands in the fabfile >>> >>> - do manual local development database backup/dump >>> >>> - copy the dump to production server >>> >>> - restore the database using pg_restore command as stated above on >>> prod. server >>> >>> - "fab deploy" on development machine to make any other changes >>> available to prod. server >>> >> >> Read this SO question and its answers >> <https://www.google.com/url?q=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F13089163%2Fhow-to-fix-a-database-error-and-ghost-migration-error-in-django&sa=D&sntz=1&usg=AFQjCNGAaAnE8ZMJUbQ0pL2cIT74LUUqQw> >> regarding >> ghost migrations. I think --delete-ghost-migrations might be the flag you >> can run manually to clear up the problem. It is not clear what state your >> local database is in. I suggest that unless you have done a lot of work to >> the local database, you recreate it manually in production. It might have >> taken less time, depending on the depth of your content. >> >> - so i deleted the /static entry in gitignore file on development >>> machine >>> >>> - ran collectstatic on development machine >>> >>> - git add, commit >>> >>> - fab deploy >>> >> >> Spend some time reading the static files deployment documentation >> <https://docs.djangoproject.com/en/dev/howto/static-files/deployment/> to >> get your head around how this works. The Fabric script "just works" for me >> when deploying to AWS. Make sure your settings.STATIC_URL and >> settings.STATIC_ROOT make sense. >> >> It is working for me right now, but I am not sure, if it is the right >>> approach to get my static media displayed as well as syncing database? >>> >> >> I think they are unrelated. Do further `fab deploy`s work as expected? >> Does the site/app behave as expected? Those are the points that really >> matter. >> >> >>> Any inputs on my setup. My situation right now: >>> >>> - started learning web development 3 months back >>> >> >> Good! Keep going. >> >> >>> - laptop development & production server >>> >> >> Run a VM on your laptop rather than the runserver. >> >> >>> - no Staging environment >>> >> >> Run a staging VM on your laptop. Run `fab all` on it daily. >> >> -ken >> > -- > You received this message because you are subscribed to the Google Groups > "Mezzanine Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Mezzanine Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
