Re: [mezzanine-users] Missing pages after Mezzanine-Cartridg Deployme using Fabric - About/Blog/Category/Contact/Products
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 vik...@gmail.com javascript: 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-djangosa=Dsntz=1usg=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 mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [mezzanine-users] Missing pages after Mezzanine-Cartridg Deployme using Fabric - About/Blog/Category/Contact/Products
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 vik...@gmail.com 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 vik...@gmail.com 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-djangosa=Dsntz=1usg=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 mezzanine-users+unsubscr...@googlegroups.com. 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 mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [mezzanine-users] Missing pages after Mezzanine-Cartridg Deployme using Fabric - About/Blog/Category/Contact/Products
Ken I was travelling so couldn't reply to this earlier. I am not using RDS. everything on Amazon free stuff; So i tried - pg_dump -Fc dbname dump.filename - On the development server sudo -u root sudo -u postgres pg_restore -c -d dbname /location/dump.filename - On the production However after this when i run fab deploy again on development server it breaks when it tries to run python manage syncdb remotely on prod. server. It complains about ghost migrations (something in database which is not on filesystem) /local/lib/python2.7/site-packages/south/migration/__init__.py, line 95, in check_migration_histories raise exceptions.GhostMigrations(ghosts) south.exceptions.GhostMigrations: ! These migrations are in the database but not on disk: shop: 0026_initial conf: 0005_initial core: 0007_initial generic: 0015_initial blog: 0021_initial forms: 0006_initial pages: 0015_initial galleries: 0002_initial twitter: 0003_initial ! I'm not trusting myself; either fix this yourself by fiddling ! with the south_migrationhistory table, or pass --delete-ghost-migrations ! to South to have it delete ALL of these records (this may not be good). 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 SECOND ISSUE - i was not seeing any static media (photos, css) even after running collectstatic on 'production' server. I was thinking that after running 'collectstatic' on the Production machine, it would make my static media available. however there were no product images in /project/static/media/product folder - so i deleted the /static entry in gitignore file on development machine - ran collectstatic on development machine - git add, commit - fab deploy 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? Any inputs on my setup. My situation right now: - started learning web development 3 months back - I am single man army and trying to setup a website for a startup business using free tools (aws, django, mezzanine, cartridge). Looking into wordpress, woocommerce also - laptop development production server - no Staging environment On Thursday, December 11, 2014 9:29:09 PM UTC+5:30, Kenneth Bolton wrote: Hi Vikram, The danger of having `fab deploy` move your data from local to production is that an accidental `fab deploy` would overwrite your production database. This is fine when you are just getting started, but would be a problem going forward with each change to your code. I would caution against extending the `deploy` command to push your database. Instead, create Fabric functions that `local_backup` and `remote_restore`. Those would be run independently of the `deploy` command. To get a handle on the appropriate PostgreSQL commands, look at the fabfile: https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/fabfile.py#L290-L303 Are you using RDS? Are you using a VPC? If you don't know, you most likely aren't, so don't sweat it. Keep learning and growing! best, ken On Thu, Dec 11, 2014 at 12:24 AM, vikraw vik...@gmail.com javascript: wrote: Thanks Kenneth for your reply. You understood the issue correctly. Yes, I am running Postgre locally. So if i understand correctly, here are my options 1- extend fabfile + add some keys to the settings.FABRIC 2- manually do a local backup and then run a restore on target deployment Option 2 looks easier to me at this moment. last night i tried running pg_restore on aws and was getting some peer authentication error which seems like some .conf/user accounts issue. However in future i would like to just run '*fab deploy*'. I am new to all these technologies and would appreciate if you could elaborate little more on *option 1* . thanks vikram On Thursday, December 11, 2014 12:09:21 AM UTC+5:30, Kenneth Bolton wrote: Hi Vikram, To restate your problem, you built a local cartridge instance and ran django's runserver against a local database. After deploying to AWS using `fab all` and an appropriately configured settings.FABRIC dictionary, you see none of the pages you added in your local instance. The fabfile that ships with Mezzanine does not move databases between deployment targets. If you are using PostgreSQL locally, the fabfile can be extended to do the dump for you. You will need to add some additional keys to settings.FABRIC for the local database that is to be backed up. hth, ken https://groups.google.com/forum/#!topic/mezzanine-users/X_Xs-Ei0OVw On Wed,
Re: [mezzanine-users] Missing pages after Mezzanine-Cartridg Deployme using Fabric - About/Blog/Category/Contact/Products
On Tue, Dec 16, 2014 at 9:26 AM, vikraw vik...@gmail.com 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://stackoverflow.com/questions/13089163/how-to-fix-a-database-error-and-ghost-migration-error-in-django 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 mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [mezzanine-users] Missing pages after Mezzanine-Cartridg Deployme using Fabric - About/Blog/Category/Contact/Products
Hi Vikram, The danger of having `fab deploy` move your data from local to production is that an accidental `fab deploy` would overwrite your production database. This is fine when you are just getting started, but would be a problem going forward with each change to your code. I would caution against extending the `deploy` command to push your database. Instead, create Fabric functions that `local_backup` and `remote_restore`. Those would be run independently of the `deploy` command. To get a handle on the appropriate PostgreSQL commands, look at the fabfile: https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/fabfile.py#L290-L303 Are you using RDS? Are you using a VPC? If you don't know, you most likely aren't, so don't sweat it. Keep learning and growing! best, ken On Thu, Dec 11, 2014 at 12:24 AM, vikraw vik...@gmail.com wrote: Thanks Kenneth for your reply. You understood the issue correctly. Yes, I am running Postgre locally. So if i understand correctly, here are my options 1- extend fabfile + add some keys to the settings.FABRIC 2- manually do a local backup and then run a restore on target deployment Option 2 looks easier to me at this moment. last night i tried running pg_restore on aws and was getting some peer authentication error which seems like some .conf/user accounts issue. However in future i would like to just run '*fab deploy*'. I am new to all these technologies and would appreciate if you could elaborate little more on *option 1* . thanks vikram On Thursday, December 11, 2014 12:09:21 AM UTC+5:30, Kenneth Bolton wrote: Hi Vikram, To restate your problem, you built a local cartridge instance and ran django's runserver against a local database. After deploying to AWS using `fab all` and an appropriately configured settings.FABRIC dictionary, you see none of the pages you added in your local instance. The fabfile that ships with Mezzanine does not move databases between deployment targets. If you are using PostgreSQL locally, the fabfile can be extended to do the dump for you. You will need to add some additional keys to settings.FABRIC for the local database that is to be backed up. hth, ken https://groups.google.com/forum/#!topic/mezzanine-users/X_Xs-Ei0OVw On Wed, Dec 10, 2014 at 11:52 AM, vikraw vik...@gmail.com wrote: Hi I have been working on Mezzanine-Cartridge development for a few weeks on my local development machine. Now I deployed to a Ubuntu AMI on Amazon webservices using the default - Fabric.py script and 'fab all' command. However the following links are missing on the deployed site. - About - Blog - Category - Contact - Shop Products *Also I cannot see any additional products or added pages on deployed website. Attached is a pic of my the default DEPLOYED site https://lh6.googleusercontent.com/-Un7OEojIQDs/VIh6GblMhdI/CQg/hwWbPwLrtcE/s1600/Capture1.PNG Attached is a pic of my the default DEVELOPMENT LOCAL site https://lh6.googleusercontent.com/-Lviy9LJVjms/VIh3zfB8ddI/CQU/0hTybKIyNnE/s1600/Capture.PNG HOWEVER, I can see the above mentioned links in the development environment which is also on Ubuntu. Development environment is as follows - pip freeze o/p - using virtualenv Cartridge==0.9.5 Django==1.6.8 Fabric==1.10.0 Mezzanine==3.1.10 Pillow==2.6.1 South==1.0.1 argparse==1.2.1 beautifulsoup4==4.1.3 bleach==1.4 boto==2.34.0 django-appconf==0.6 django-compressor==1.4 django-ses==0.7.0 ecdsa==0.11 filebrowser-safe==0.3.6 future==0.9.0 grappelli-safe==0.3.13 html5lib==0.999 mezzanine-bsbanners==0.1.4 oauthlib==0.7.2 paramiko==1.15.1 psycopg2==2.5.4 pycrypto==2.6.1 pytz==2014.10 reportlab==3.1.8 requests==2.4.3 requests-oauthlib==0.4.2 six==1.8.0 tzlocal==1.0 wsgiref==0.1.2 xhtml2pdf==0.0.6 I was expecting that one's development is finalized and uploaded to the repository, FABRIC will automatically create a similar snapshot in production server. What should I do to get all my products and additional pages to come up on deployed site?? I read somewhere that fabric doesn't syncs the database even though it syncs the schema. So i am guessing if that is the issue? My excitement of development on Mezzanine-Cartridge is fading as deployment is very tedious. I follow the following process - virtualenv - debug=true - collectstatic - git add *, git commit , - fab all I would appreciate the help -- 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 mezzanine-use...@googlegroups.com. 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
[mezzanine-users] Missing pages after Mezzanine-Cartridg Deployme using Fabric - About/Blog/Category/Contact/Products
Hi I have been working on Mezzanine-Cartridge development for a few weeks on my local development machine. Now I deployed to a Ubuntu AMI on Amazon webservices using the default - Fabric.py script and 'fab all' command. However the following links are missing on the deployed site. - About - Blog - Category - Contact - Shop Products *Also I cannot see any additional products or added pages on deployed website. Attached is a pic of my the default DEPLOYED site https://lh6.googleusercontent.com/-Un7OEojIQDs/VIh6GblMhdI/CQg/hwWbPwLrtcE/s1600/Capture1.PNG Attached is a pic of my the default DEVELOPMENT LOCAL site https://lh6.googleusercontent.com/-Lviy9LJVjms/VIh3zfB8ddI/CQU/0hTybKIyNnE/s1600/Capture.PNG HOWEVER, I can see the above mentioned links in the development environment which is also on Ubuntu. Development environment is as follows - pip freeze o/p - using virtualenv Cartridge==0.9.5 Django==1.6.8 Fabric==1.10.0 Mezzanine==3.1.10 Pillow==2.6.1 South==1.0.1 argparse==1.2.1 beautifulsoup4==4.1.3 bleach==1.4 boto==2.34.0 django-appconf==0.6 django-compressor==1.4 django-ses==0.7.0 ecdsa==0.11 filebrowser-safe==0.3.6 future==0.9.0 grappelli-safe==0.3.13 html5lib==0.999 mezzanine-bsbanners==0.1.4 oauthlib==0.7.2 paramiko==1.15.1 psycopg2==2.5.4 pycrypto==2.6.1 pytz==2014.10 reportlab==3.1.8 requests==2.4.3 requests-oauthlib==0.4.2 six==1.8.0 tzlocal==1.0 wsgiref==0.1.2 xhtml2pdf==0.0.6 I was expecting that one's development is finalized and uploaded to the repository, FABRIC will automatically create a similar snapshot in production server. What should I do to get all my products and additional pages to come up on deployed site?? I read somewhere that fabric doesn't syncs the database even though it syncs the schema. So i am guessing if that is the issue? My excitement of development on Mezzanine-Cartridge is fading as deployment is very tedious. I follow the following process - virtualenv - debug=true - collectstatic - git add *, git commit , - fab all I would appreciate the help -- 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 mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [mezzanine-users] Missing pages after Mezzanine-Cartridg Deployme using Fabric - About/Blog/Category/Contact/Products
Hi Vikram, To restate your problem, you built a local cartridge instance and ran django's runserver against a local database. After deploying to AWS using `fab all` and an appropriately configured settings.FABRIC dictionary, you see none of the pages you added in your local instance. The fabfile that ships with Mezzanine does not move databases between deployment targets. If you are using PostgreSQL locally, the fabfile can be extended to do the dump for you. You will need to add some additional keys to settings.FABRIC for the local database that is to be backed up. hth, ken https://groups.google.com/forum/#!topic/mezzanine-users/X_Xs-Ei0OVw On Wed, Dec 10, 2014 at 11:52 AM, vikraw vik...@gmail.com wrote: Hi I have been working on Mezzanine-Cartridge development for a few weeks on my local development machine. Now I deployed to a Ubuntu AMI on Amazon webservices using the default - Fabric.py script and 'fab all' command. However the following links are missing on the deployed site. - About - Blog - Category - Contact - Shop Products *Also I cannot see any additional products or added pages on deployed website. Attached is a pic of my the default DEPLOYED site https://lh6.googleusercontent.com/-Un7OEojIQDs/VIh6GblMhdI/CQg/hwWbPwLrtcE/s1600/Capture1.PNG Attached is a pic of my the default DEVELOPMENT LOCAL site https://lh6.googleusercontent.com/-Lviy9LJVjms/VIh3zfB8ddI/CQU/0hTybKIyNnE/s1600/Capture.PNG HOWEVER, I can see the above mentioned links in the development environment which is also on Ubuntu. Development environment is as follows - pip freeze o/p - using virtualenv Cartridge==0.9.5 Django==1.6.8 Fabric==1.10.0 Mezzanine==3.1.10 Pillow==2.6.1 South==1.0.1 argparse==1.2.1 beautifulsoup4==4.1.3 bleach==1.4 boto==2.34.0 django-appconf==0.6 django-compressor==1.4 django-ses==0.7.0 ecdsa==0.11 filebrowser-safe==0.3.6 future==0.9.0 grappelli-safe==0.3.13 html5lib==0.999 mezzanine-bsbanners==0.1.4 oauthlib==0.7.2 paramiko==1.15.1 psycopg2==2.5.4 pycrypto==2.6.1 pytz==2014.10 reportlab==3.1.8 requests==2.4.3 requests-oauthlib==0.4.2 six==1.8.0 tzlocal==1.0 wsgiref==0.1.2 xhtml2pdf==0.0.6 I was expecting that one's development is finalized and uploaded to the repository, FABRIC will automatically create a similar snapshot in production server. What should I do to get all my products and additional pages to come up on deployed site?? I read somewhere that fabric doesn't syncs the database even though it syncs the schema. So i am guessing if that is the issue? My excitement of development on Mezzanine-Cartridge is fading as deployment is very tedious. I follow the following process - virtualenv - debug=true - collectstatic - git add *, git commit , - fab all I would appreciate the help -- 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 mezzanine-users+unsubscr...@googlegroups.com. 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 mezzanine-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.