Re: [mezzanine-users] Mezzanine 5.0 alpha 1 released!

2020-09-09 Thread Matt Mansour
Looking forward to checking it out.

Thanks for keeping it going!

On Wed, Sep 9, 2020, 2:56 PM Stephen McDonald  wrote:

> Thanks for all your hard work with this Ed and for taking the reins
> overall.
>
> Really cool to see some of the meta improvements you've made too.
>
> On Wed, Sep 9, 2020 at 12:02 PM Eduardo Rivas 
> wrote:
>
>>
>> Hello everyone!
>>
>> I'm very happy to announce that the first pre-release of the next major
>> version of Mezzanine is now available: 5.0.0 alpha 1. You can download it
>> right now with `pip install -U mezzanine==5.0.0a1`. This will also get you
>> the alpha versions for filebrowser-safe and grappelli-safe.
>>
>> *The biggest change is that we have completely dropped support for Python
>> 2 and Django versions prior to 2.2.*
>>
>> Other than that you can check out the pre-release notes over at GitHub:
>> https://github.com/stephenmcd/mezzanine/releases/tag/v5.0.0-alpha.1
>>
>> With this version we're also testing a new release process based on
>> Semantic Versioning that should make it much easier to publish pre-release
>> and stable versions to PyPI so the community can test Mezzanine without
>> having to install from GitHub.
>>
>> Additionally, since this is an alpha release, we request you do not use
>> it in production systems (unless you're ready to report and/or fix bugs).
>> You can help get Mezzanine to a stable release by filing bug reports on the
>> GitHub issue tracker. The community has already identified a few minor bugs
>> which are now being worked on as you can see here:
>> https://github.com/stephenmcd/mezzanine/issues?q=is%3Aopen+is%3Aissue+label%3A%22release+blocker%22
>>
>> Finally, I want to publicly thank Stephen McDonald who authored and
>> maintained Mezzanine for many years, as well as many other members of the
>> core team and the larger community who have made Mezzanine what it is
>> today. Going forward I (Ed Rivas) will be serving as the maintainer of the
>> project. I look forward to helping grow and nurture this amazing CMS.
>>
>> --
>> 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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/mezzanine-users/9d034202-e26c-4596-b966-fb1523c12d94n%40googlegroups.com
>> 
>> .
>>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mezzanine-users/CAFDn9NbE%3DuJMVSvuomd7FAktVGTn72U2pjUwoPJBuNk2GaNTUQ%40mail.gmail.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/CALizMdM8gzroJczqkrcatGfQj_RM3oNg3GX_u%2BErJEyqSiHdrg%40mail.gmail.com.


Re: [mezzanine-users] Any design document on how to scale(infra) Mezzanine ??

2020-09-05 Thread Matt Mansour
As Ken mentioned infrastructure is not specific to Mezzanine.

Scaling is based the level growth you're experiencing.

You don't want to build your initial Mezzanine infrastructure for the
million users you don't have yet, nor the engineering team you don't have
yet.

I start out mezzanine projects on AWS:  using an EC2 instance for the app,
an RDS instance for the database, an elasticache instance for the caching
layer, and S3 / cloudfront for file storage.

That approach is almost over optimization for something brand new. But it
also can handle the pleasant surprise of your app gaining traction.

Once your app gets to a certain point the infrastructure needs to change.
There is also DevOps if you plan on having an engineering team iterate on
your code base.

Just get your App up and running to test your hypothsis first (that people
will actually visit your project)

That said, if you're at a funded startup, or you have a large tribe on deck
and ready for your app, check out some dev ops and infrastructure courses
on Udemy and use Mezzanine with it.

On Sat, Sep 5, 2020 at 4:26 AM nitish kumar  wrote:

> Hi Ken,
>
> I am just trying to pick a topic where I can contribute to Mezzanine.
> I can see all gallery content is stored in files which will be a problem
> if you want to scale horizontally.
> so checking if already there is a way to scale if not will try to do
> something.
>
> Thanks,
> Nitish
>
> On Sat, Sep 5, 2020 at 4:23 PM Ken Bolton  wrote:
>
>> On Sat, Sep 5, 2020 at 6:48 AM nitish kumar 
>> wrote:
>>
>>> If anyone already able to scale  please let me know.
>>>
>>
>> What have you tried? Where is your bottleneck?
>>
>> Mezzanine is (and remains) just a Django app, so your strategies for
>> scaling will not be specific to Mezzanine.
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Mezzanine Users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/mezzanine-users/n5zr8XJwTos/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> mezzanine-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/mezzanine-users/CAN7ek0NE%2BEL3rjaJ2UcVaoZ7b8PUocG3h9mGHSus5BozcoukUQ%40mail.gmail.com
>> 
>> .
>>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mezzanine-users/CAChxUc-RNKwiqsXbfng5bWW3RWHjyaP-jf%3Dw3-MtQTtrVyHRrg%40mail.gmail.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/CALizMdMWineF2T5cCzEGY%2BpUo2MGwBzWRGLHA71qU43Ap7WK%3DA%40mail.gmail.com.


Re: Re: [mezzanine-users] Are fabric deployments popular?

2020-02-21 Thread Matt Mansour
"Would be cool to see others develop something similar for AWS and the
like."

Agreed. I'll take a stab at it if I can make some time. Right now I am
swamped with multiple projects.

Most of my mezzanine stuff in on AWS. Right now I use the mezz fab file to
create the default stack on EC2, but then I tear the EC2 apart, and move
postgres to RDS, the caching to Elasticache, and the media to s3 through
Cloudfront with Boto.

It would be easier in the long run to just build out the fab file.

On Fri, Feb 21, 2020 at 12:28 PM Eduardo Rivas 
wrote:

> Glad to see the fabfile is still in use. I think it would be best to keep
> it as part of Mezzanine then.
>
>
>
> Regarding some of the questions/comments:
>
>
>
>- If you’re not using git or mercurial as version control, you can
>deploy using rsync by setting “DEPLOY_TOOL”: “rsync” in your FABRIC
>dictionary
>- I’m not aware of other fabfiles at the moment, only one I maintain
>over at https://github.com/jerivas/mezzanine-webf to deploy to
>Webfaction. Would be cool to see others develop something similar for AWS
>and the like.
>
>
>
> *From: *Roger van Schie 
> *Sent: *Friday, February 21, 2020 9:45 AM
> *To: *mezzanine-users@googlegroups.com
> *Subject: *Re: [mezzanine-users] Are fabric deployments popular?
>
>
>
> Hi Ed
>
>
>
> I believe the included fab files decreases the learning curve for new
> users dramatically, and it would be great to keep it in, not only to make
> it easier for new users to get going, but to avoid unnecessary traffic on
> the forums. I would suggest having multiple fab files though, for different
> types of  infrastructure. For example, one for normal rsync, one for git,
> one for Amazon web services etc.
>
>
>
> Thanks for all your hard work and help on the forums Ed!
>
>
>
> Regards
>
> Roger
>
>
>
> On Wed, 19 Feb 2020 at 01:16, Eduardo Rivas 
> wrote:
>
> Hello everyone,
>
>
>
> I'm Ed, one of the collaborators helping maintain Mezzanine. As we prepare
> to release the next version of Mezzanine (supporting Python 3 and Django
> 2.2 only) an issue was recently filed
>  wondering about the
> future of mezzanine's built-in fabfile (which only works with Python 2).
>
>
>
> This made me wonder: Are Fabric deployments widely used by the community?
> What are your thoughts on the following options:
>
>
>
>- Stop maintaining a fabfile of our own and just point people to
>general Django deployment docs
>- Extract the fabfile as a separate package/project
>- Keep the fabfile as part of Mezzanine
>
> Looking forward to hearing from the community.
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mezzanine-users/02b090b5-2d83-485d-aee3-f5997da14844%40googlegroups.com
> 
> .
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mezzanine-users/CAFny93BODzdekVAZ26ibsXXqFHrRH_G2M9o-b6Hs9kZ008acCw%40mail.gmail.com
> 
> .
>
>
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mezzanine-users/5e503d7f.1c69fb81.62210.9061%40mx.google.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/CALizMdP5cJJ2nZFD-Dj3B3VqsBjCR2C3K4uFtp16iG%2By4y_HtQ%40mail.gmail.com.


Re: [mezzanine-users] Are fabric deployments popular?

2020-02-18 Thread Matt Mansour
I love the fab file that ships with Mezzanine.

My first vote would be extraction into a separate package.
Second vote: keeping it in Mezzanine.
Third, point to the Django deploy docs or ship Mezzanine with a docker file
(I wish I had time contribute a docker file).

Thanks for all the great work!



On Tue, Feb 18, 2020 at 5:16 PM Eduardo Rivas 
wrote:

> Hello everyone,
>
> I'm Ed, one of the collaborators helping maintain Mezzanine. As we prepare
> to release the next version of Mezzanine (supporting Python 3 and Django
> 2.2 only) an issue was recently filed
>  wondering about the
> future of mezzanine's built-in fabfile (which only works with Python 2).
>
> This made me wonder: Are Fabric deployments widely used by the community?
> What are your thoughts on the following options:
>
>
>- Stop maintaining a fabfile of our own and just point people to
>general Django deployment docs
>- Extract the fabfile as a separate package/project
>- Keep the fabfile as part of Mezzanine
>
> Looking forward to hearing from the community.
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mezzanine-users/02b090b5-2d83-485d-aee3-f5997da14844%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/CALizMdN%3DSci%3DWgi4tPhSVGGV-njojQwWtzcX4zBbjCJHAAjUiA%40mail.gmail.com.


Re: [mezzanine-users] Page and Site SQL Gets Triggered with View LevelCaching

2019-07-25 Thread Matt Mansour
So far I haven't been able to figure out an approach to easily disable 
PageMiddleWare that doesn't raise errors. Likewise, removing the mezzanine 
pages app also raises errors. 

One approach that works is to directly edit the mezzanine PageMiddleWare 
class. 


def process_view(self, request, view_func, view_args, view_kwargs):
   if the path != exluded path:
   run the middleware...
   return page_view...
   return None

I wonder short circuiting PageMiddleWare  is needed enough by others to 
create a setting: a list of excluded paths. e.g. 
EXCLUDE_PAGE_MIDDLEWARE_URLS = ('api', ) 

It appears something like this is needed you want to cache api endpoints. 

On Wednesday, July 24, 2019 at 9:37:12 AM UTC-7, Eduardo Rivas wrote:
>
> Hi Matt.
>
>  
>
> My guess is that Mezzanine’s Page middleware tries to fetch a page on 
> every request (as pages can have any URL). I would try to disable the 
> middlewares you don’t need and see if that works.
>
>  
>
> *From: *Matt Mansour 
> *Sent: *Wednesday, July 24, 2019 10:05 AM
> *To: *Mezzanine Users 
> *Subject: *[mezzanine-users] Page and Site SQL Gets Triggered with View 
> LevelCaching
>
>  
>
> Hi All, 
>
>  
>
> I am caching an endpoint at the view level and I noticed there are still 
> two sql calls being made for the Site and Page objects, after the below 
> response is cached .
>
>  
>
> class CampaignDetail(APIView):
>  @method_decorator(cache_page(10))
>  def get(self, request, version, campaign_key):
>  campaign = 
> Campaign.objects.select_related('product').get(campaign_key=campaign_key)
>  data = {
>  "active":"true",
>  "deal-price": "20.00",
>  "daily-limit-reached": campaign.daily_limit_reached(),
>  "keywords": campaign.get_campaign_keyword(),
>  "product-asin": campaign.product.asin,
>  "product-name": campaign.product.product_name,
>  "product-price": "{}".format(campaign.product.price)
>  }
>
>  return Response(data)
>
>  
>
> Campaign subclasses TimeStamped (not Displayable), so I am wondering why the 
> following SQL still gets called upon refresh during the cache period:
>
>  
>
> *SELECT*"django_site"."id", "django_site"."domain", 
> "django_site"."name"*FROM* "django_site" *WHERE* 
> UPPER("django_site"."domain"::text) = UPPER('localhost:8000')
>
>  
>
> And 
>
>  
>
> *SELECT*"pages_page"."id", "pages_page"."keywords_string", 
> "pages_page"."site_id", "pages_page"."title", "pages_page"."slug", 
> "pages_page"."_meta_title", "pages_page"."description", 
> "pages_page"."gen_description", "pages_page"."created", 
> "pages_page"."updated", "pages_page"."status", "pages_page"."publish_date", 
> "pages_page"."expiry_date", "pages_page"."short_url", 
> "pages_page"."in_sitemap", "pages_page"."_order", 
> "pages_page"."content_model", "pages_page"."parent_id", 
> "pages_page"."in_menus", "pages_page"."titles", 
> "pages_page"."login_required"*FROM* "pages_page" *WHERE* 
> ("pages_page"."site_id" = 1 *AND* ("pages_page"."publish_date" <= 
> '2019-07-24T15:26:59.395377+00:00'::timestamptz *OR* 
> "pages_page"."publish_date" *IS* *NULL*) *AND* ("pages_page"."expiry_date" >= 
> '2019-07-24T15:26:59.396055+00:00'::timestamptz *OR* 
> "pages_page"."expiry_date" *IS* *NULL*) *AND* "pages_page"."status" = 2 *AND* 
> "pages_page"."slug" *IN* ('api', 'api/v1', 
> 'api/v1/campaign/a8b7ea62-79d0-4ee4-8f62-81fcde54ea32', 'api/v1/campaign')) 
> *ORDER BY* "pages_page"."slug" *DESC*
>
>  
>
> I'd like to avoid all db hits if possible. Does anyone see what I am doing 
> wrong or if there is a bug here? 
>
>  
>
> -- 
> 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 mezzani...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/mezzanine-users/ad008e6c-856b-466a-919e-fa407461a047%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/mezzanine-users/ad008e6c-856b-466a-919e-fa407461a047%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>  
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/b540519b-9742-49ca-9c7e-e7d3792f2ea9%40googlegroups.com.


Re: [mezzanine-users] Page and Site SQL Gets Triggered with View LevelCaching

2019-07-24 Thread Matt Mansour
Thanks Eduardo. I'll give it a try.

On Wed, Jul 24, 2019 at 9:37 AM Eduardo Rivas 
wrote:

> Hi Matt.
>
>
>
> My guess is that Mezzanine’s Page middleware tries to fetch a page on
> every request (as pages can have any URL). I would try to disable the
> middlewares you don’t need and see if that works.
>
>
>
> *From: *Matt Mansour 
> *Sent: *Wednesday, July 24, 2019 10:05 AM
> *To: *Mezzanine Users 
> *Subject: *[mezzanine-users] Page and Site SQL Gets Triggered with View
> LevelCaching
>
>
>
> Hi All,
>
>
>
> I am caching an endpoint at the view level and I noticed there are still
> two sql calls being made for the Site and Page objects, after the below
> response is cached .
>
>
>
> class CampaignDetail(APIView):
>  @method_decorator(cache_page(10))
>  def get(self, request, version, campaign_key):
>  campaign = 
> Campaign.objects.select_related('product').get(campaign_key=campaign_key)
>  data = {
>  "active":"true",
>  "deal-price": "20.00",
>  "daily-limit-reached": campaign.daily_limit_reached(),
>  "keywords": campaign.get_campaign_keyword(),
>  "product-asin": campaign.product.asin,
>  "product-name": campaign.product.product_name,
>  "product-price": "{}".format(campaign.product.price)
>  }
>
>  return Response(data)
>
>
>
> Campaign subclasses TimeStamped (not Displayable), so I am wondering why the 
> following SQL still gets called upon refresh during the cache period:
>
>
>
> *SELECT*"django_site"."id", "django_site"."domain", 
> "django_site"."name"*FROM* "django_site" *WHERE* 
> UPPER("django_site"."domain"::text) = UPPER('localhost:8000')
>
>
>
> And
>
>
>
> *SELECT*"pages_page"."id", "pages_page"."keywords_string", 
> "pages_page"."site_id", "pages_page"."title", "pages_page"."slug", 
> "pages_page"."_meta_title", "pages_page"."description", 
> "pages_page"."gen_description", "pages_page"."created", 
> "pages_page"."updated", "pages_page"."status", "pages_page"."publish_date", 
> "pages_page"."expiry_date", "pages_page"."short_url", 
> "pages_page"."in_sitemap", "pages_page"."_order", 
> "pages_page"."content_model", "pages_page"."parent_id", 
> "pages_page"."in_menus", "pages_page"."titles", 
> "pages_page"."login_required"*FROM* "pages_page" *WHERE* 
> ("pages_page"."site_id" = 1 *AND* ("pages_page"."publish_date" <= 
> '2019-07-24T15:26:59.395377+00:00'::timestamptz *OR* 
> "pages_page"."publish_date" *IS* *NULL*) *AND* ("pages_page"."expiry_date" >= 
> '2019-07-24T15:26:59.396055+00:00'::timestamptz *OR* 
> "pages_page"."expiry_date" *IS* *NULL*) *AND* "pages_page"."status" = 2 *AND* 
> "pages_page"."slug" *IN* ('api', 'api/v1', 
> 'api/v1/campaign/a8b7ea62-79d0-4ee4-8f62-81fcde54ea32', 'api/v1/campaign')) 
> *ORDER BY* "pages_page"."slug" *DESC*
>
>
>
> I'd like to avoid all db hits if possible. Does anyone see what I am doing 
> wrong or if there is a bug here?
>
>
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mezzanine-users/ad008e6c-856b-466a-919e-fa407461a047%40googlegroups.com
> <https://groups.google.com/d/msgid/mezzanine-users/ad008e6c-856b-466a-919e-fa407461a047%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mezzanine-users/5d388935.1c69fb81.8de47.be88%40mx.google.com
> <https://groups.google.com/d/msgid/mezzanine-users/5d388935.1c69fb81.8de47.be88%40mx.google.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/CALizMdM_JgQsuzJkASxYvqHuEqPrbTD76OBSu0uvL1261JDh6g%40mail.gmail.com.


[mezzanine-users] Page and Site SQL Gets Triggered with View Level Caching

2019-07-24 Thread Matt Mansour
Hi All, 

I am caching an endpoint at the view level and I noticed there are still 
two sql calls being made for the Site and Page objects, after the below 
response is cached .

class CampaignDetail(APIView):
 @method_decorator(cache_page(10))
 def get(self, request, version, campaign_key):
 campaign = 
Campaign.objects.select_related('product').get(campaign_key=campaign_key)
 data = {
 "active":"true",
 "deal-price": "20.00",
 "daily-limit-reached": campaign.daily_limit_reached(),
 "keywords": campaign.get_campaign_keyword(),
 "product-asin": campaign.product.asin,
 "product-name": campaign.product.product_name,
 "product-price": "{}".format(campaign.product.price)
 }

 return Response(data)

Campaign subclasses TimeStamped (not Displayable), so I am wondering why the 
following SQL still gets called upon refresh during the cache period:


SELECT"django_site"."id", "django_site"."domain", "django_site"."name"FROM 
"django_site" WHERE UPPER("django_site"."domain"::text) = 
UPPER('localhost:8000')


And 


SELECT"pages_page"."id", "pages_page"."keywords_string", 
"pages_page"."site_id", "pages_page"."title", "pages_page"."slug", 
"pages_page"."_meta_title", "pages_page"."description", 
"pages_page"."gen_description", "pages_page"."created", "pages_page"."updated", 
"pages_page"."status", "pages_page"."publish_date", "pages_page"."expiry_date", 
"pages_page"."short_url", "pages_page"."in_sitemap", "pages_page"."_order", 
"pages_page"."content_model", "pages_page"."parent_id", 
"pages_page"."in_menus", "pages_page"."titles", 
"pages_page"."login_required"FROM "pages_page" WHERE ("pages_page"."site_id" = 
1 AND ("pages_page"."publish_date" <= 
'2019-07-24T15:26:59.395377+00:00'::timestamptz OR "pages_page"."publish_date" 
IS NULL) AND ("pages_page"."expiry_date" >= 
'2019-07-24T15:26:59.396055+00:00'::timestamptz OR "pages_page"."expiry_date" 
IS NULL) AND "pages_page"."status" = 2 AND "pages_page"."slug" IN ('api', 
'api/v1', 'api/v1/campaign/a8b7ea62-79d0-4ee4-8f62-81fcde54ea32', 
'api/v1/campaign')) ORDER BY "pages_page"."slug" DESC


I'd like to avoid all db hits if possible. Does anyone see what I am doing 
wrong or if there is a bug here? 


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/ad008e6c-856b-466a-919e-fa407461a047%40googlegroups.com.


[mezzanine-users] Re: Deploying with Python3 seems to install Python2.7

2019-05-01 Thread Matt Mansour
Sorry I misread the question.

To make this work I edited the fabfile: 

I changed line 503 to

run("virtualenv -p python3 %s" % env.proj_name)

Then I blew away the python 2.7 environment

fab remove


The created the python 3 environment 

fab create


Then redeployed

fab deploy


Hope that helps.


On Monday, April 29, 2019 at 11:47:42 PM UTC-7, Mike Dewhirst wrote:
>
> Just tried deploying Mezzanine 4.3.1 to a DigitalOcean droplet with 
> Python3.6. 
>
> Fabric3 and Python3 were used on the dev machine and Python3.6 is 
> installed on the droplet. It seems however that fabfile.py line 58 calls 
> for python rather than python3 ... 
>
> env.manage = "%s/bin/python %s/manage.py" % (env.venv_path, env.proj_path) 
>
>
> I don't know enough about how virtualenv names its python interpreter so 
> I may be wrong about all this. The droplet was created with Ubuntu 18.04 
> and did not have Python2.7 before the deployment but it certainly did 
> afterwards. 
>
> How can I get away from Python 2.7? 
>
> Thanks 
>
> Mike 
>

-- 
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] Deploying with Python3 seems to install Python2.7

2019-05-01 Thread Matt Mansour
You'll have to run "fab remove" first to blow away the python 2.7 env.

Then run "fab create" with the modification above.

On Wed, May 1, 2019 at 3:16 PM Matt Mansour  wrote:

> Sorry I misread the question.
>
> To make this work I edited the fabfile.
> I changed line 503 to
> run("virtualenv -p python3 %s" % env.proj_name)
>
> On Wed, May 1, 2019 at 3:11 PM Matt Mansour 
> wrote:
>
>> Try "pip install fabric2".
>>
>> That did the trick for me.
>>
>> On Wed, May 1, 2019 at 5:26 AM Ken Bolton  wrote:
>>
>>> Mike,
>>>
>>> Ignore my last email, follow the tutorial expertly produced by Travis.
>>>
>>> -ken
>>>
>>> On Wed, May 1, 2019 at 1:19 AM  wrote:
>>>
>>>> Thanks Ken
>>>>
>>>> I have made a start but its heavy going. Mercurial demands Python2.7
>>>> unless there is an env var HGPYTHON3=1 and then there are pip things
>>>> falling over as well.
>>>>
>>>> I'll keep trying
>>>>
>>>> M
>>>>
>>>> On Tuesday, April 30, 2019 at 10:29:46 PM UTC+10, Ken Bolton wrote:
>>>>>
>>>>> Hi Mike,
>>>>>
>>>>> Fabric3 and Python3 were used on the dev machine and Python3.6 is
>>>>>>
>>>>>
>>>>> You need to use an earlier version with the fabfile; `fabric==1.2.2`
>>>>> works, if the mailing list archives are to be believed. The alternative
>>>>> would be a rewrite of the fabfile to account for changes in the Fabric 
>>>>> api.
>>>>>
>>>>> To start using python3, modify your fabfile
>>>>> https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/fabfile.py#L446-L447
>>>>> :
>>>>>
>>>>> apt("nginx libjpeg-dev python3-dev python3-setuptools git-core " 
>>>>> "postgresql
>>>>> libpq-dev memcached supervisor python3-pip")
>>>>> Not sure what else you might have to change, but if you manage to
>>>>> deploy, a pull request of your changes would be greatly appreciated!
>>>>>
>>>>> -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.
>>>
>>

-- 
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] Deploying with Python3 seems to install Python2.7

2019-05-01 Thread Matt Mansour
Sorry I misread the question.

To make this work I edited the fabfile.
I changed line 503 to
run("virtualenv -p python3 %s" % env.proj_name)

On Wed, May 1, 2019 at 3:11 PM Matt Mansour  wrote:

> Try "pip install fabric2".
>
> That did the trick for me.
>
> On Wed, May 1, 2019 at 5:26 AM Ken Bolton  wrote:
>
>> Mike,
>>
>> Ignore my last email, follow the tutorial expertly produced by Travis.
>>
>> -ken
>>
>> On Wed, May 1, 2019 at 1:19 AM  wrote:
>>
>>> Thanks Ken
>>>
>>> I have made a start but its heavy going. Mercurial demands Python2.7
>>> unless there is an env var HGPYTHON3=1 and then there are pip things
>>> falling over as well.
>>>
>>> I'll keep trying
>>>
>>> M
>>>
>>> On Tuesday, April 30, 2019 at 10:29:46 PM UTC+10, Ken Bolton wrote:
>>>>
>>>> Hi Mike,
>>>>
>>>> Fabric3 and Python3 were used on the dev machine and Python3.6 is
>>>>>
>>>>
>>>> You need to use an earlier version with the fabfile; `fabric==1.2.2`
>>>> works, if the mailing list archives are to be believed. The alternative
>>>> would be a rewrite of the fabfile to account for changes in the Fabric api.
>>>>
>>>> To start using python3, modify your fabfile
>>>> https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/fabfile.py#L446-L447
>>>> :
>>>>
>>>> apt("nginx libjpeg-dev python3-dev python3-setuptools git-core " 
>>>> "postgresql
>>>> libpq-dev memcached supervisor python3-pip")
>>>> Not sure what else you might have to change, but if you manage to
>>>> deploy, a pull request of your changes would be greatly appreciated!
>>>>
>>>> -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.
>>
>

-- 
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] Deploying with Python3 seems to install Python2.7

2019-05-01 Thread Matt Mansour
Try "pip install fabric2".

That did the trick for me.

On Wed, May 1, 2019 at 5:26 AM Ken Bolton  wrote:

> Mike,
>
> Ignore my last email, follow the tutorial expertly produced by Travis.
>
> -ken
>
> On Wed, May 1, 2019 at 1:19 AM  wrote:
>
>> Thanks Ken
>>
>> I have made a start but its heavy going. Mercurial demands Python2.7
>> unless there is an env var HGPYTHON3=1 and then there are pip things
>> falling over as well.
>>
>> I'll keep trying
>>
>> M
>>
>> On Tuesday, April 30, 2019 at 10:29:46 PM UTC+10, Ken Bolton wrote:
>>>
>>> Hi Mike,
>>>
>>> Fabric3 and Python3 were used on the dev machine and Python3.6 is

>>>
>>> You need to use an earlier version with the fabfile; `fabric==1.2.2`
>>> works, if the mailing list archives are to be believed. The alternative
>>> would be a rewrite of the fabfile to account for changes in the Fabric api.
>>>
>>> To start using python3, modify your fabfile
>>> https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/fabfile.py#L446-L447
>>> :
>>>
>>> apt("nginx libjpeg-dev python3-dev python3-setuptools git-core " "postgresql
>>> libpq-dev memcached supervisor python3-pip")
>>> Not sure what else you might have to change, but if you manage to
>>> deploy, a pull request of your changes would be greatly appreciated!
>>>
>>> -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.
>

-- 
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] What's wrong in my local_settings / how to do basic deploy to aws

2018-04-18 Thread Matt Mansour
This post helped me in setting up my user for the ec2 instance.

http://www.crmarsh.com/aws/



On Wed, Apr 18, 2018 at 12:56 PM, Wolfgang M  wrote:

> Yes, now I can ssh in. (Couldn't before without 'ssh -i path/to/key' so I
> added my .pem to my .ssh/config.)
>
> I did a lot of troubleshooting with my environment, not sure the exact
> formula but something to do with fabric+future+python2.7 has allowed fabric
> to work.
>
> Now I can run 'fab all', but after the first line '$ apt-get update -y -q
> ->' , I am prompted for my "[IP] Login password for 'ec2-user' " which is
> the standard instance user name. AWS by default doesn't provide a password
> and handles authentication through a .pem private key, this means I've
> never set a password for ec2-user.
>
> I've messaged Matt Mansour to see if in his experience with AWS he has to
> configure anything specifically. I've tried setting a password for ec2-user
> within my instance and using that but it doesn't pass.
>
> Thanks for the help above, I've sorted out my ssh and fabric issues, but
> now I think I'm dealing with more aws specific configuration than anything
> else.
>
> On Monday, April 16, 2018 at 10:57:24 AM UTC-5, Kenneth Bolton wrote:
>
>> You can `ssh ec2-user@54.219.###.###` no problem?
>>
>>
>> --
>> Ken Bolton
>>
> --
> 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] Deploying mezzaine to AWS

2018-04-14 Thread Matt Mansour
I don't think there are official docs for that.

I took the following approach a few times over the last couple years, But
there are probably easier and better ways.


   - Create an EC2 Instance on AWS
   - Deploy Everything to EC2 (Standard Mezzanine Deploy) (you can probably
   stop here if scaling and performance is not an issue)
   - Create RDS and ElasticCache instances on AWS
   - Configure the Django settings to point RDS (db) and Elasticache
   (memcached or redis) (I forgot why I could not do step on the first deploy
   attempt)
   - redeploy
   - Install Python's Boto Library.
   - Create s3 Buckets on AWS
   - Configure Django to use Boto so your static media ends up on s3 when
   running 'collectstatic'
   - Create a Cloudfront Distribution.
   - Configure Cloudfront to serve the static media through s3

It probably took me a day or two to get this working. I had to Google quite
a few resources.

I can make this work pretty consistently but moving forward I'll probably
explore using Docker/ECS

Best,

Matt

On Sat, Apr 14, 2018 at 8:39 AM, Paul Tremblay 
wrote:

> Hi,
>
> New to mezzanine. My current job is creating a website in Django and
> deploying to AWS. For a home project, I want to deploy Mezzanine to AWS.
> Are there official docs on this? I am thinking to just download the source
> code, and then follow the same steps I take at work (create a git account
> on AWS, download the AWS tools, use elasticbeanstalk, etc.)
>
> Thanks!
>
> Henry
>
> --
> 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] Looking for a developer

2018-03-13 Thread Matt Mansour
Hi Eli,

I may be able to help. I've been working with Mezzanine since late 2011.

Send me a message at slackbabb...@gmail.com.

Let's chat about your project. We'll set up a Skype and find out if I'd be
a good fit.

Best,
Matt

On Tue, Mar 13, 2018 at 8:31 AM,  wrote:

> Hi people,
>
> My name is Eli, I am part of a small non-profit organization based in the
> Netherlands with a website running on Heroku platform.
> We're considering implementing Mezzanine for our website and are looking
> for some guidance.
> Is there any freelance developer or can you recommend someone who could
> help us?
>
> Many thanks in advance!
> Eli.
>
> --
> 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] Re: Mezzanine beyond Django 1.10

2018-03-12 Thread Matt Mansour
Thanks for the response Stephen!

On Mon, Mar 12, 2018 at 2:47 PM, Stephen McDonald  wrote:

> On Mon, Feb 19, 2018 at 10:29 PM, Wim Feijen  wrote:
>
>> Hello,
>>
>> I was wondering what we can do to help in the release of a new stable
>> Mezzanine which supports Django 1.11 LTS or Django 2.0?
>>
>
> Django 1.11 support has been available for the last 10 months, all you
> need to do is depend on the latest explicit commit on GitHub. If you'd like
> to see 2.0 support, please run the default Mezzanine project against 2.0,
> test every documented feature and see if you contribute the necessary fixes
> for compatibility. Once that's done and there are no issues, voila - 2.0
> will be supported.
>
> Unfortunately we work in an environment where stability is of much more
>> importance than using a quick leading edge release.
>>
>
> You and your team or whoever else perceives a difference between a PyPI
> release and what's on GitHub, unfortunately suffers from an inaccurate
> perception.
>
> Here's the crux of it - if we were pushing commits very frequently to
> GitHub, constantly breaking things, as is the case very early on in the
> development of a project, then your perception would be accurate. Picking a
> commit and depending on it would be a gamble. But the commits to Mezzanine
> for several years now have been infrequent and minor. Non-breaking changes,
> no new features. The project (and specifically the master branch on GitHub)
> is very stable. You can pick the latest commit on GitHub and add it to your
> dependencies file and you're now working with the latest version.
>
> The only significant changes that have occurred over the years have been
> updates for compatibility with the latest Django versions. These changes
> are generally long-developed in a pull request on GitHub and heavily tested
> and refined before being merged into the master branch. Again, the
> stability of the master branch is something always striven for.
>
> If we were to push a build to PyPI right now, there would literally be no
> difference between that and specifying an exact commit on GitHub in your
> dependencies file, which is something you can do right now. The code would
> function exactly the same way.
>
> I hope this paints a clear picture of where Mezzanine is and how you can
> use the most update to date version of it with confidence. To reiterate -
> commits to the master branch are *stable and infrequent*. There is no
> technical or conceptual difference between a commit on GitHub and PyPI
> release. Each commit to GitHub is a new version. Want the latest version?
> Update the commit referenced in your dependencies.
>
> Why don't we just push a release? There's a lot of work involved and the
> process needs a lot of improvement. The team has been recently discussing
> this off-list. But the idea that the project is dead or isn't a viable
> option, considering all the above, is nonsense. The project is mature,
> which means development is infrequent and stable, but as active as
> necessary.
>
>
>
>> We are stuck in a situation where dropping Mezzanine is actually being
>> considered as an option. I would rather help the open source project
>> Mezzanine forward than drop it. So that's why I feel forced to bump my
>> question. Apologies for that.
>>
>> Best regards,
>>
>> Wim
>>
>>
>> Op woensdag 10 januari 2018 17:38:07 UTC+1 schreef Wim Feijen:
>>
>>> Hello,
>>>
>>> The latest Mezzanine release 4.2.3 support Django up to Django 1.10,
>>> which does not receive security updates anymore. See:
>>> https://www.djangoproject.com/download/#supported-versions
>>>
>>> How can we help to release a new version of Mezzanine which support
>>> Django 1.11 LTS or Django 2.0?
>>>
>>> Although I love the high quality of development branches, using a
>>> development branch (git version) of Mezzanine is not possible for us,
>>> because it is not stable enough.
>>>
>>> Best regards,
>>>
>>> Wim
>>>
>>> --
>> 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.
>>
>
>
>
> --
> Stephen McDonald
> http://jupo.org
>
> --
> 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] Re: Mezzanine beyond Django 1.10

2018-03-12 Thread Matt Mansour
I am also curious about this question.

I've been using Mezzanine since 0.1.3 (ish). It's been a great framework
for me since 2012. I hope it's not coming to an end.

In any case much gratitude for this project.

Cheers,
Matt

On Mon, Mar 12, 2018 at 12:50 AM, Lauri Hyttinen <
lauri.st.hytti...@gmail.com> wrote:

> Hello,
>
> I am also interested in any sort of reply to this question. I fear we also
> have to start planning on moving to another CMS. Are there any news on
> about this subject?
>
> Best regards,
> Lauri Hyttinen
>
> On Monday, February 19, 2018 at 1:29:00 PM UTC+2, Wim Feijen wrote:
>>
>> Hello,
>>
>> I was wondering what we can do to help in the release of a new stable
>> Mezzanine which supports Django 1.11 LTS or Django 2.0?
>>
>> Unfortunately we work in an environment where stability is of much more
>> importance than using a quick leading edge release.
>>
>> We are stuck in a situation where dropping Mezzanine is actually being
>> considered as an option. I would rather help the open source project
>> Mezzanine forward than drop it. So that's why I feel forced to bump my
>> question. Apologies for that.
>>
>> Best regards,
>>
>> Wim
>>
>>
>> Op woensdag 10 januari 2018 17:38:07 UTC+1 schreef Wim Feijen:
>>>
>>> Hello,
>>>
>>> The latest Mezzanine release 4.2.3 support Django up to Django 1.10,
>>> which does not receive security updates anymore. See:
>>> https://www.djangoproject.com/download/#supported-versions
>>>
>>> How can we help to release a new version of Mezzanine which support
>>> Django 1.11 LTS or Django 2.0?
>>>
>>> Although I love the high quality of development branches, using a
>>> development branch (git version) of Mezzanine is not possible for us,
>>> because it is not stable enough.
>>>
>>> Best regards,
>>>
>>> Wim
>>>
>>> --
> 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] Drupal to Mezzanine migration with pandas

2018-01-17 Thread Matt Mansour
Thanks for posting. Glad it worked!

On Wed, Jan 17, 2018 at 11:45 AM,  wrote:

> Recently I migrated content from Drupal to Mezzanine using jupyter
> notebook and pandas.
>
> After numerous dead ends, fighting with the inherited table structure of
> Mezzanine Pages/RichTextPages, it looked something like this:
>
>
>1. install shell_plus jupyter notebook on same (Ubuntu) server as
>Mezzanine installation, in my virtualenv. Need django_extensions for this.
>This interfaces directly with Django models (may need to be in the same
>directory as manage.py), and is a super useful interface to have; you can
>now manipulate your data, even live, with pandas. This can be run from my
>laptop via Putty SSH tunneling.
>2. Reproduce mysql database from Drupal on Ubuntu server.
>3. Load relevant data into pandas dataframe using mysql.connector,
>super fast
>4. was able to clean up some inconsistencies while data was in
>dataframe, e.g. Drupal uses \n\r\n for paragraph breaks (Mezzanine or
>tinymce ignores these) which I replaced with html p tags.
>5. Can't use bulk_create() with inherited models. My data was destined
>for Page and RichTextPage objects. First you must create the RichTextPage
>objects. I iterated over dataframe rows with itertuples() to create
>RichTextPage objects, which I saved one at a time. Made sure to have an
>index in dataframe that corresponded to the id or pk of the RichTextPage
>objects I created.
>6. This also created Page objects which I then updated individually
>with the correct title, in_menus, slug, created, site_id, and other fields
>again using itertuples over the dataframe.
>
> Somewhat of an involved procedure but it worked well.
>
> --
> 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] Re: Does Orderable / Sortable Work on Editable Template Tag?

2017-09-18 Thread Matt Mansour
Hmm. You definitely gave me an approach to think about.
I'll dig in and report back.

Thanks Melvyn.

On Mon, Sep 18, 2017 at 12:18 AM, Melvyn Sopacua 
wrote:

> On second thought, that wouldn't work with cleaned_data, as
> has_changed() is a method of BoundField so it's a little more complex
> and you need to keep the form around:
>
>  for k, v in [k, v for k,v in data_dict.items() if
> form[k].has_changed()]
>
> On Mon, Sep 18, 2017 at 9:14 AM, Melvyn Sopacua 
> wrote:
> > Well, the key is to update only those that have changed. Any form
> > field has a has_changed() method you may be able to use, something
> > like:
> >
> > for k, v in [k, v for k,v in data_dict.items() if v.has_changed()]
> >
> > assuming data_dict is form.cleaned_data.
> >
> > On Sun, Sep 17, 2017 at 11:44 PM, Matt Mansour 
> wrote:
> >>
> >>
> >> On Friday, September 15, 2017 at 8:55:00 AM UTC-7, Matt Mansour wrote:
> >>>
> >>> Hi All -
> >>>
> >>> I am looking to create a page of images that are both sortable and in a
> >>> grid format - instead of each image stacked in rows like in the admin
> >>> inlines.
> >>>
> >>> I am digging into jQuery's sortable and breaking apart how it's used in
> >>> Mezzanine. I am making progress but I am curious if I could achieve the
> >>> sorting I am looking for by simply wrapping a list of  images in an
> editable
> >>> template tag?  Something like
> >>>
> >>> {% editable page.sort_images %}
> >>>
> >>> Code to render list of images to be sorted
> >>>
> >>> {% endeditable %}
> >>
> >> --
> >> 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.
> >
> >
> >
> > --
> > Melvyn Sopacua
>
>
>
> --
> Melvyn Sopacua
>
> --
> 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.


[mezzanine-users] Re: Does Orderable / Sortable Work on Editable Template Tag?

2017-09-17 Thread Matt Mansour


On Friday, September 15, 2017 at 8:55:00 AM UTC-7, Matt Mansour wrote:
>
> Hi All -
>
> I am looking to create a page of images that are both sortable and in a 
> grid format - instead of each image stacked in rows like in the admin 
> inlines. 
>
> I am digging into jQuery's sortable and breaking apart how it's used in 
> Mezzanine. I am making progress but I am curious if I could achieve the 
> sorting I am looking for by simply wrapping a list of  images in an 
> editable template tag?  Something like
>
> {% editable page.sort_images %}
>
> Code to render list of images to be sorted
>
> {% endeditable %}
>
>

-- 
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] Does Orderable / Sortable Work on Editable Template Tag?

2017-09-17 Thread Matt Mansour
Seems to be working out well. 

I got a grid view up. Draggable sorting using jQuery UI, which updates the 
_order field (Orderable). It's very user friendly. The only thing I am 
having trouble the number of update queries showing in the Django Debug 
Tool Bar. 

When I re-sort in the admin inlines and hit save, there are only roughly 14 
queries that happen in total. That's even if there are 80 images being 
re-sorted. 

In my grid outside the admin if there are 80 images there are 80ish plus 
'update' queries happening.  I am having trouble finding how in the admin 
the number of queries optimized so well. Can anyone point me in the right 
direction? 

For my custom code (outside the admin) it's easy to see why 80 images would 
cause roughly 80 update queries: 

with transaction.atomic():
def auto_transaction():
for k, v in data_dict.items():
ListingImage.objects.filter(pk=k).update(_order=v)
auto_transaction()


On Friday, September 15, 2017 at 9:33:34 AM UTC-7, Eduardo Rivas wrote:
>
> Cool! Glad you've enjoyed it so far. Hope it all works out. 
>
> On Sep 15, 2017 10:30 AM, "Matt Mansour"  > wrote:
>
>> That said, just want to put out there that Mezzanine has really helped a 
>> lot for this project. For example, another requirement is deep 
>> categorization.  It's nice to see how Mezzanine handles that easily without 
>> tons of database queries. 
>>
>> Overall loving Mezzanine. This is just one of those times where I'll have 
>> to create a page outside the admin, In this case for easily sorting and 
>> grouping many images.  
>>
>> On Friday, September 15, 2017 at 9:22:30 AM UTC-7, Matt Mansour wrote:
>>>
>>> In this case I have to find a solution.  The editors are not happy. 
>>> Makes sense. These are galleries of homes and locations. Some locations 
>>> have 100 + photos. Editors need to be able to quickly order and group a 
>>> gallery however they wish. They have a few thousand galleries to create. 
>>>
>>> A gallery might start with 20 shots of the exterior. Then there might be 
>>> 5 kitchen shots. 10 bedroom shots. 10 living room shots. 20 shots of the 
>>> surrounding neighborhood. 
>>>
>>> With that many images; dragging to sort and group takes much longer in a 
>>> row format (admin inlines) versus grid format. 
>>>
>>> On Friday, September 15, 2017 at 9:12:09 AM UTC-7, Eduardo Rivas wrote:
>>>>
>>>> No problem :)
>>>>
>>>> I wouldn't worry much about ordering if you're expecting to manage tens 
>>>> of items. In my mind, manual ordering only makes sense when the amount of 
>>>> items is manageable and you want to make sure some appear first. For 
>>>> something like this "newest first" works fine IMO.
>>>> On 2017-09-15 10:07 AM, Matt Mansour wrote:
>>>>
>>>> Thanks for the quick reply. My objective was the lazy approach and your 
>>>> quick reply was faster than me trying it. I'll continue using jQuery ui / 
>>>> sortable.  
>>>>
>>>> I wish creating a grid view for inlines was a relatively easy job. But 
>>>> I don't have time for tackle that one. I am sure some would find a toggle 
>>>> to grid inline useful, as galleries can have 100 + images for one gallery. 
>>>>
>>>> Drag sorting that many images is much easier in a grid format versus a 
>>>> long row of images. 
>>>>
>>>> On Friday, September 15, 2017 at 8:57:17 AM UTC-7, Eduardo Rivas wrote: 
>>>>>
>>>>> I don't think so. The Orderable abstract model is designed for inlines 
>>>>> only, and the {% editable %} template tag doesn't support that.
>>>>> On 2017-09-15 9:55 AM, Matt Mansour wrote:
>>>>>
>>>>> Hi All - 
>>>>>
>>>>> I am looking to create a page of images that are both sortable and in 
>>>>> a grid format - instead of each image stacked in rows like in the admin 
>>>>> inlines. 
>>>>>
>>>>> I am digging into jQuery's sortable and breaking apart how it's used 
>>>>> in Mezzanine. I am making progress but I am curious if I could achieve 
>>>>> the 
>>>>> sorting I am looking for by simply wrapping a list of  images in an 
>>>>> editable template tag?  Something like
>>>>>
>>>>> {% editable page.sort_images %}
>>>>>
>>>>> Code to render list of images 

Re: [mezzanine-users] Does Orderable / Sortable Work on Editable Template Tag?

2017-09-15 Thread Matt Mansour
That said, just want to put out there that Mezzanine has really helped a 
lot for this project. For example, another requirement is deep 
categorization.  It's nice to see how Mezzanine handles that easily without 
tons of database queries. 

Overall loving Mezzanine. This is just one of those times where I'll have 
to create a page outside the admin, In this case for easily sorting and 
grouping many images.  

On Friday, September 15, 2017 at 9:22:30 AM UTC-7, Matt Mansour wrote:
>
> In this case I have to find a solution.  The editors are not happy. Makes 
> sense. These are galleries of homes and locations. Some locations have 100 
> + photos. Editors need to be able to quickly order and group a gallery 
> however they wish. They have a few thousand galleries to create. 
>
> A gallery might start with 20 shots of the exterior. Then there might be 5 
> kitchen shots. 10 bedroom shots. 10 living room shots. 20 shots of the 
> surrounding neighborhood. 
>
> With that many images; dragging to sort and group takes much longer in a 
> row format (admin inlines) versus grid format. 
>
> On Friday, September 15, 2017 at 9:12:09 AM UTC-7, Eduardo Rivas wrote:
>>
>> No problem :)
>>
>> I wouldn't worry much about ordering if you're expecting to manage tens 
>> of items. In my mind, manual ordering only makes sense when the amount of 
>> items is manageable and you want to make sure some appear first. For 
>> something like this "newest first" works fine IMO.
>> On 2017-09-15 10:07 AM, Matt Mansour wrote:
>>
>> Thanks for the quick reply. My objective was the lazy approach and your 
>> quick reply was faster than me trying it. I'll continue using jQuery ui / 
>> sortable.  
>>
>> I wish creating a grid view for inlines was a relatively easy job. But I 
>> don't have time for tackle that one. I am sure some would find a toggle to 
>> grid inline useful, as galleries can have 100 + images for one gallery. 
>>
>> Drag sorting that many images is much easier in a grid format versus a 
>> long row of images. 
>>
>> On Friday, September 15, 2017 at 8:57:17 AM UTC-7, Eduardo Rivas wrote: 
>>>
>>> I don't think so. The Orderable abstract model is designed for inlines 
>>> only, and the {% editable %} template tag doesn't support that.
>>> On 2017-09-15 9:55 AM, Matt Mansour wrote:
>>>
>>> Hi All - 
>>>
>>> I am looking to create a page of images that are both sortable and in a 
>>> grid format - instead of each image stacked in rows like in the admin 
>>> inlines. 
>>>
>>> I am digging into jQuery's sortable and breaking apart how it's used in 
>>> Mezzanine. I am making progress but I am curious if I could achieve the 
>>> sorting I am looking for by simply wrapping a list of  images in an 
>>> editable template tag?  Something like
>>>
>>> {% editable page.sort_images %}
>>>
>>> Code to render list of images to be sorted
>>>
>>> {% endeditable %}
>>>
>>> -- 
>>> 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-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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Does Orderable / Sortable Work on Editable Template Tag?

2017-09-15 Thread Matt Mansour
In this case I have to find a solution.  The editors are not happy. Makes 
sense. These are galleries of homes and locations. Some locations have 100 
+ photos. Editors need to be able to quickly order and group a gallery 
however they wish. They have a few thousand galleries to create. 

A gallery might start with 20 shots of the exterior. Then there might be 5 
kitchen shots. 10 bedroom shots. 10 living room shots. 20 shots of the 
surrounding neighborhood. 

With that many images; dragging to sort and group takes much longer in a 
row format (admin inlines) versus grid format. 

On Friday, September 15, 2017 at 9:12:09 AM UTC-7, Eduardo Rivas wrote:
>
> No problem :)
>
> I wouldn't worry much about ordering if you're expecting to manage tens of 
> items. In my mind, manual ordering only makes sense when the amount of 
> items is manageable and you want to make sure some appear first. For 
> something like this "newest first" works fine IMO.
> On 2017-09-15 10:07 AM, Matt Mansour wrote:
>
> Thanks for the quick reply. My objective was the lazy approach and your 
> quick reply was faster than me trying it. I'll continue using jQuery ui / 
> sortable.  
>
> I wish creating a grid view for inlines was a relatively easy job. But I 
> don't have time for tackle that one. I am sure some would find a toggle to 
> grid inline useful, as galleries can have 100 + images for one gallery. 
>
> Drag sorting that many images is much easier in a grid format versus a 
> long row of images. 
>
> On Friday, September 15, 2017 at 8:57:17 AM UTC-7, Eduardo Rivas wrote: 
>>
>> I don't think so. The Orderable abstract model is designed for inlines 
>> only, and the {% editable %} template tag doesn't support that.
>> On 2017-09-15 9:55 AM, Matt Mansour wrote:
>>
>> Hi All - 
>>
>> I am looking to create a page of images that are both sortable and in a 
>> grid format - instead of each image stacked in rows like in the admin 
>> inlines. 
>>
>> I am digging into jQuery's sortable and breaking apart how it's used in 
>> Mezzanine. I am making progress but I am curious if I could achieve the 
>> sorting I am looking for by simply wrapping a list of  images in an 
>> editable template tag?  Something like
>>
>> {% editable page.sort_images %}
>>
>> Code to render list of images to be sorted
>>
>> {% endeditable %}
>>
>> -- 
>> 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-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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Does Orderable / Sortable Work on Editable Template Tag?

2017-09-15 Thread Matt Mansour
Thanks for the quick reply. My objective was the lazy approach and your 
quick reply was faster than me trying it. I'll continue using jQuery ui / 
sortable. 

I wish creating a grid view for inlines was a relatively easy job. But I 
don't have time for tackle that one. I am sure some would find a toggle to 
grid inline useful, as galleries can have 100 + images for one gallery. 

Drag sorting that many images is much easier in a grid format versus a long 
row of images. 

On Friday, September 15, 2017 at 8:57:17 AM UTC-7, Eduardo Rivas wrote:
>
> I don't think so. The Orderable abstract model is designed for inlines 
> only, and the {% editable %} template tag doesn't support that.
> On 2017-09-15 9:55 AM, Matt Mansour wrote:
>
> Hi All - 
>
> I am looking to create a page of images that are both sortable and in a 
> grid format - instead of each image stacked in rows like in the admin 
> inlines. 
>
> I am digging into jQuery's sortable and breaking apart how it's used in 
> Mezzanine. I am making progress but I am curious if I could achieve the 
> sorting I am looking for by simply wrapping a list of  images in an 
> editable template tag?  Something like
>
> {% editable page.sort_images %}
>
> Code to render list of images to be sorted
>
> {% endeditable %}
>
> -- 
> 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Does Orderable / Sortable Work on Editable Template Tag?

2017-09-15 Thread Matt Mansour
Hi All -

I am looking to create a page of images that are both sortable and in a 
grid format - instead of each image stacked in rows like in the admin 
inlines. 

I am digging into jQuery's sortable and breaking apart how it's used in 
Mezzanine. I am making progress but I am curious if I could achieve the 
sorting I am looking for by simply wrapping a list of  images in an 
editable template tag?  Something like

{% editable page.sort_images %}

Code to render list of images to be sorted

{% endeditable %}

-- 
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.


[mezzanine-users] How to Handle Large Zip File Uploads - Celery?

2017-08-04 Thread Matt Mansour
Hi All - 

I am using the zip file uploader code from Galleries in a different model. 
It works great. However, the requirement is to upload large zip files with 
a hundred or more large images. With that requirement the current set up 
may be a bad user experience due to the wait time. In its current state it 
cuts their time down greatly (from 30 minutes of work down to 2). However, 
the clients I am working with want a more async experience. 

Just curious if anyone has implemented a solution where a user can Create a 
Gallery, press "Save". From there a Gallery is saved instantly (freeing up 
the user to use the rest of the site) and the upload is handled with celery 
or something like that? 

I tried passing the job off to celery and that cuts the time in half (you 
still have to wait for the upload but the image records and thumbs are 
created by celery)

I'd like to have celery do the upload if possible. However, I am not quite 
sure if that's a good idea. Any thoughts on using celery to handle the 
entire upload (if possible) ?

I know this is probably more of a standard python/Django question at this 
point. 

Thanks,
Matt

-- 
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.


[mezzanine-users] Re: Thumbnail Tag with Prefetch Related Set Only Works on Last Image

2017-07-11 Thread Matt Mansour
Nevermind. I think all is working as expected. 

I just needed to clean up s3 after all the uploads during development. 

On Tuesday, July 11, 2017 at 12:27:37 PM UTC-7, Matt Mansour wrote:
>
> Hi All -
>
> I'm probably overlooking something. Using the mezzanine thumbnail tag I am 
> trying to thumbnail all related images in my object list. However, only the 
> last image in the set gets thumbnailed. 
>
> I've never seen this before. I am wondering if it's because I am using 
> prefetch_related. 
>
> Below is my code. Please let me know if anything wrong stands out. 
>
> Thanks
>
> models.py
>  
>
>> class Category(Page):
>> """
>> A category for grouping listings into a series.
>> """
>>
>> pass 
>>
>>  
>
>> class Listing(Orderable, Displayable, RichText, BaseListing):
>> categories = models.ManyToManyField("Category",
>> verbose_name=_("Categories"),
>> blank=True, 
>> related_name="categories")
>> ...
>>
>>
>> class ListingImage(Orderable):
>> listing = models.ForeignKey("Listing", related_name="images")
>> file = models.ImageField(_("File"), max_length=200, 
>> upload_to=listing_directory_path)
>> description = models.CharField(_("Description"), max_length=1000, 
>> blank=True)
>>
>> cropping = ImageRatioField('file', '430x360')#easy_thumbs for admin 
>> inline resizing
>>
>>  
> page_processors.py
>
> @processor_for(Category)
>> def category_page(request, page):
>>
>> listings = 
>> Listing.objects.prefetch_related('images').filter(categories=page)
>>
>> return {"listings": listings}
>>
>>
> template
>
> 
> {% for listing in listings %}
> {{ listing.title }}
>
> {% with image=listing.images.all|first %}
> 
> {% endwith %}
>
> {% endfor %}
>
>  
>
>

-- 
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] Thumbnail Tag with Prefetch Related Set Only Works on Last Image

2017-07-11 Thread Matt Mansour
Upon further digging it has nothing to do with pre-fetch related.  It has
to do with where I get my media from.

All images in my object list are thumbnailed when I run media from my local
server.

However, if I run media from s3 only some images are thumbnailed.

Has anyone run into this issue?



On Tue, Jul 11, 2017 at 12:27 PM, Matt Mansour 
wrote:

> Hi All -
>
> I'm probably overlooking something. Using the mezzanine thumbnail tag I am
> trying to thumbnail all related images in my object list. However, only the
> last image in the set gets thumbnailed.
>
> I've never seen this before. I am wondering if it's because I am using
> prefetch_related.
>
> Below is my code. Please let me know if anything wrong stands out.
>
> Thanks
>
> models.py
>
>
>> class Category(Page):
>> """
>> A category for grouping listings into a series.
>> """
>>
>> pass
>>
>>
>
>> class Listing(Orderable, Displayable, RichText, BaseListing):
>> categories = models.ManyToManyField("Category",
>> verbose_name=_("Categories"),
>> blank=True, 
>> related_name="categories")
>> ...
>>
>>
>> class ListingImage(Orderable):
>> listing = models.ForeignKey("Listing", related_name="images")
>> file = models.ImageField(_("File"), max_length=200, 
>> upload_to=listing_directory_path)
>> description = models.CharField(_("Description"), max_length=1000, 
>> blank=True)
>>
>> cropping = ImageRatioField('file', '430x360')#easy_thumbs for admin 
>> inline resizing
>>
>>
> page_processors.py
>
> @processor_for(Category)
>> def category_page(request, page):
>>
>> listings = 
>> Listing.objects.prefetch_related('images').filter(categories=page)
>>
>> return {"listings": listings}
>>
>>
> template
>
> 
> {% for listing in listings %}
> {{ listing.title }}
>
> {% with image=listing.images.all|first %}
> 
> {% endwith %}
>
> {% endfor %}
>
> 
>
> --
> 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.


[mezzanine-users] Thumbnail Tag with Prefetch Related Set Only Works on Last Image

2017-07-11 Thread Matt Mansour
Hi All -

I'm probably overlooking something. Using the mezzanine thumbnail tag I am 
trying to thumbnail all related images in my object list. However, only the 
last image in the set gets thumbnailed. 

I've never seen this before. I am wondering if it's because I am using 
prefetch_related. 

Below is my code. Please let me know if anything wrong stands out. 

Thanks

models.py
 

> class Category(Page):
> """
> A category for grouping listings into a series.
> """
>
> pass 
>
>  

> class Listing(Orderable, Displayable, RichText, BaseListing):
> categories = models.ManyToManyField("Category",
> verbose_name=_("Categories"),
> blank=True, related_name="categories")
> ...
>
>
> class ListingImage(Orderable):
> listing = models.ForeignKey("Listing", related_name="images")
> file = models.ImageField(_("File"), max_length=200, 
> upload_to=listing_directory_path)
> description = models.CharField(_("Description"), max_length=1000, 
> blank=True)
>
> cropping = ImageRatioField('file', '430x360')#easy_thumbs for admin 
> inline resizing
>
>  
page_processors.py

@processor_for(Category)
> def category_page(request, page):
>
> listings = 
> Listing.objects.prefetch_related('images').filter(categories=page)
>
> return {"listings": listings}
>
>
template


{% for listing in listings %}
{{ listing.title }}

{% with image=listing.images.all|first %}

{% endwith %}

{% endfor %}

 

-- 
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] A UserProfile model with Multiple Foreign Keys to 'auth.User' Breaks

2016-03-19 Thread Matt Mansour
The additional foreignkey back to user is designated users who have
permission to edit the profiles of only their  subordinates. These owners
are non staff
On Mar 18, 2016 3:49 PM, "Avery Laird"  wrote:

> Hi Matt,
>
> It might be useful if you explain what you're trying to do. For example,
> why do you need the foreign key relationship back to auth.User? I'm having
> trouble imagining a situation where you'd need both a OneToOne relationship
> and a ForeignKey relationship to the same model. Maybe you can accomplish
> your task a different way.
>
> --
> 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.


[mezzanine-users] A UserProfile model with Multiple Foreign Keys to 'auth.User' Breaks

2016-03-19 Thread Matt Mansour
Hi All - 

Here's the relevant code in UserProfile model

class UserProfile(models.Model):
user = models.OneToOneField('auth.User', blank=True, null=True, 
related_name='userprofile')
owner = models.ForeignKey('auth.User', blank=True, null=True, 
related_name='subordinates')


When I makemigrations I get the following error: 

'dashboard.UserProfile' has more than one ForeignKey to 'auth.User'.

The issue seems to be stemming from the mezzanine.accounts.admin profile 
inlines: 

If I add : 

fk_name = 'user'


to the body of the ProfileLineClass the issue is fixed. 

try:
class ProfileInline(admin.StackedInline):
model = get_profile_model()
can_delete = False
template = "admin/profile_inline.html"
extra = 0
UserProfileAdmin.inlines += (ProfileInline,)
except ProfileNotConfigured:
pass


However, I am having a tough time sub classing ProfileInline. I can't seem 
to get it to work from my project. 

Any suggestions on the sub classing approach would be greatly appreciated. 
Also, if this is an issue that should be posted in github please let me 
know. Not sure if this is a bug.  

Thanks

-- 
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] A UserProfile model with Multiple Foreign Keys to 'auth.User' Breaks

2016-03-18 Thread Matt Mansour
That sounds close but I'm not sure it's granular enough. For example an
owner can only edit the profiles that has been assigned to him. E.g Owner A
owns - and can only edit objects B, C and D. Owner E owns F G and H.  And
yes both those owners can have a superior over them and should be able to
edit the grandchildren and the owners. All of which are not staff
On Mar 18, 2016 5:36 PM, "Avery Laird"  wrote:

> No problem! Mezzanine uses Django's permission system, which is probably
> the best way to go in this situation (if I understand what you're trying to
> do). See the documentation: "three default permissions – add, change and
> delete – are created for each Django model defined in one of your installed
> applications." You have the "subordinate" profile type, and a group of
> users that can edit the "subordinate" profile type. When creating a new
> user, Mezzanine displays these three default permissions for all models you
> have created. For example, I also have a custom User Profile class, so
> there is a permission displayed " | User Profile | Can
> add/change/delete User Profile |." That means, you can create a group which
> has only the permissions you want.
>
> However, if you want to have the users arranged in a tier of some sort,
> which any relationship more complicated than what I described above, you
> may want to look in to creating your own groups/permissions. You can find
> the documentation here
> <https://docs.djangoproject.com/en/dev/topics/auth/default/#permissions-and-authorization>
> .
>
> On Friday, 18 March 2016 17:18:22 UTC-7, Matt Mansour wrote:
>>
>> Thanks for asking btw!
>> On Mar 18, 2016 5:16 PM, "Matt Mansour"  wrote:
>>
>>> The additional foreignkey back to user is designated users who have
>>> permission to edit the profiles of only their  subordinates. These owners
>>> are non staff
>>> On Mar 18, 2016 3:49 PM, "Avery Laird"  wrote:
>>>
>>>> Hi Matt,
>>>>
>>>> It might be useful if you explain what you're trying to do. For
>>>> example, why do you need the foreign key relationship back to auth.User?
>>>> I'm having trouble imagining a situation where you'd need both a OneToOne
>>>> relationship and a ForeignKey relationship to the same model. Maybe you can
>>>> accomplish your task a different way.
>>>>
>>>> --
>>>> 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+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] A UserProfile model with Multiple Foreign Keys to 'auth.User' Breaks

2016-03-18 Thread Matt Mansour
With that it seems like creating a custom permissions would be trivial with
with foreign Keys pointing to User for the different ownership relationships
On Mar 18, 2016 5:53 PM, "Matt Mansour"  wrote:

> That sounds close but I'm not sure it's granular enough. For example an
> owner can only edit the profiles that has been assigned to him. E.g Owner A
> owns - and can only edit objects B, C and D. Owner E owns F G and H.  And
> yes both those owners can have a superior over them and should be able to
> edit the grandchildren and the owners. All of which are not staff
> On Mar 18, 2016 5:36 PM, "Avery Laird"  wrote:
>
>> No problem! Mezzanine uses Django's permission system, which is probably
>> the best way to go in this situation (if I understand what you're trying to
>> do). See the documentation: "three default permissions – add, change and
>> delete – are created for each Django model defined in one of your installed
>> applications." You have the "subordinate" profile type, and a group of
>> users that can edit the "subordinate" profile type. When creating a new
>> user, Mezzanine displays these three default permissions for all models you
>> have created. For example, I also have a custom User Profile class, so
>> there is a permission displayed " | User Profile | Can
>> add/change/delete User Profile |." That means, you can create a group which
>> has only the permissions you want.
>>
>> However, if you want to have the users arranged in a tier of some sort,
>> which any relationship more complicated than what I described above, you
>> may want to look in to creating your own groups/permissions. You can find
>> the documentation here
>> <https://docs.djangoproject.com/en/dev/topics/auth/default/#permissions-and-authorization>
>> .
>>
>> On Friday, 18 March 2016 17:18:22 UTC-7, Matt Mansour wrote:
>>>
>>> Thanks for asking btw!
>>> On Mar 18, 2016 5:16 PM, "Matt Mansour"  wrote:
>>>
>>>> The additional foreignkey back to user is designated users who have
>>>> permission to edit the profiles of only their  subordinates. These owners
>>>> are non staff
>>>> On Mar 18, 2016 3:49 PM, "Avery Laird"  wrote:
>>>>
>>>>> Hi Matt,
>>>>>
>>>>> It might be useful if you explain what you're trying to do. For
>>>>> example, why do you need the foreign key relationship back to auth.User?
>>>>> I'm having trouble imagining a situation where you'd need both a OneToOne
>>>>> relationship and a ForeignKey relationship to the same model. Maybe you 
>>>>> can
>>>>> accomplish your task a different way.
>>>>>
>>>>> --
>>>>> 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+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] A UserProfile model with Multiple Foreign Keys to 'auth.User' Breaks

2016-03-18 Thread Matt Mansour
Thanks for asking btw!
On Mar 18, 2016 5:16 PM, "Matt Mansour"  wrote:

> The additional foreignkey back to user is designated users who have
> permission to edit the profiles of only their  subordinates. These owners
> are non staff
> On Mar 18, 2016 3:49 PM, "Avery Laird"  wrote:
>
>> Hi Matt,
>>
>> It might be useful if you explain what you're trying to do. For example,
>> why do you need the foreign key relationship back to auth.User? I'm having
>> trouble imagining a situation where you'd need both a OneToOne relationship
>> and a ForeignKey relationship to the same model. Maybe you can accomplish
>> your task a different way.
>>
>> --
>> 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.


[mezzanine-users] Custom Redirect to Profile Form After Signup | Slug or PK needed

2016-03-09 Thread Matt Mansour

Howdy all - 

I've hit a minor stumbling block. My current project will have a lot of 
profile fields. Too many for one form. So the sign up flow should be a 
multi-step process. E.g. 

Step 1. Basic Signup fields. -> Step 2. Some profile fields. -> Step 3 More 
profile fields -> Step 4 Final Profile Fields

The current mezzanine signup redirect options are  1. The 'next' parameter  
2 LOGIN_REDIRECT_URL or 3. home page.  What I need to do after basic sign 
up is go to step 2 in my flow (the first set of profile fields). That 
approach will require me to pass a pk or user slug in the redirect. I 
checked in the mezz code and it looks login_redirect is function based, not 
classed based, so overriding doesn't seem like an option. Any suggestions? 

I am happy to explore making these mezz views class based if we think this 
would be useful for custom sign up flows. 
Or if there is a better approach for custom sign up flow in this context 
please let me know. 

Thanks,
Matt

-- 
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.


[mezzanine-users] Re: Multi Tenancy / Multi IPs

2016-01-05 Thread Matt Mansour
Hi All -

This issue is all sorted out. Multi Tenancy with a unique IP per site works 
out of the box with AWS. You just need to follow the AWS docs on 
configuring Multiple Elastic IPs for a single EC2 instance. 

I simply forgot to change the A record of a domain to point to one of the 
new IPs

Cheers,
Matt

On Tuesday, December 29, 2015 at 12:38:05 PM UTC-8, Matt Mansour wrote:
>
> Howdy All - 
>
> I have a multi tenancy project up and running. However, I need to assign 
> each domain a unique IP. Setting this up on AWS was pretty easy. AWS allows 
> you to use multiple Elastic IPs on a single EC2 server instance. 
>
> The tricky part has been getting the mezzanine nginx.conf and 
> gunicorn.conf files configured properly. Has any one crossed this bridge 
> before? 
>
> Cheers,
> Matt
>

-- 
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.


[mezzanine-users] Re: Multi Tenancy / Multi IPs

2016-01-05 Thread Matt Mansour
Hi All -

This issue is all sorted out. Multi Tenancy with a unique IP per site 
basically works out of the box. You just have to follow the AWS docs on 
configuring Multiple Elastic IPs (EIP) per EC2 instance. I simply forgot to 
change the A record of a domain to point to one of the new IPs. 

Cheers,
Matt

On Monday, January 4, 2016 at 2:34:05 PM UTC-8, Matt Mansour wrote:
>
> Hi Anthony - 
>
> Thank you for the post. 
>
> The set up I have is one project with multiple websites all housed in the 
> same CMS - Basically following the mezzanine docs for multi-tenancy 
> http://mezzanine.jupo.org/docs/multi-tenancy.html
>
> For other projects I have used configurations that somewhat resemble 
> yours. It works great. However, on this current project we don't want 
> editors to have to log in to multiple website admins. In our case we're 
> trying to keep content for all our websites in the same CMS. 
>
> However, your post has given me some ideas to try. If I can get something 
> working I'll report back on how I did it. And more feedback is always 
> welcome and helpful. 
>
> Thanks again!
> Matt
>
> On Sunday, January 3, 2016 at 11:53:33 AM UTC-8, Anthony Gagliardo wrote:
>>
>> There are a few ways to set this up.  I've tried a couple of them out 
>> personally and from my past experience I would say that the next step 
>> depends upon how you have multitenancy set up.
>>
>> Typically I will use multiple django/mezzanine projects installed on the 
>> same server, in completely separate dirs.  Each project has a domain name 
>> (and an elastic ip associated with it), which is where nginx comes into the 
>> mix.  Inside my nginx config I have several upstream servers defined. I use 
>> one virtualhost for each of the projects plus whatever utility servers that 
>> I might need.
>>
>> example upstream setup:
>> upstream GUnicornSite1 {
>> server 127.0.0.1:8001;
>> }
>> upstream GUnicornSite2 {
>> server 127.0.0.1:8002;
>> }
>> upstream GUnicornSite3 {
>> server 127.0.0.1:8003;
>> }
>>
>> Now that nginx knows about the webservers, its time to actually start 
>> those webservers.  Its important to note that in your gunicorn 
>> configuration, you need to make sure that each server is listening on 
>> whichever port number you specified in your nginx.conf definition.  Aside 
>> from any static media nonsense that may or may not arise, I don't think 
>> there is much more to specify as far as the gUnicorn config.  I made the 
>> move to uwsgi because I needed websocket support.
>>
>> The uwsgi part of my nginx.conf looks significantly different than what a 
>> gunicorn setup needs, but here is a simple example of how I listen on a 
>> certain port.
>> Server{
>> listen 9001;
>> location / {
>>proxy_pass http://GUnicornServer1/;
>>
>> Server{
>> listen 9002;
>> location / {
>>proxy_pass http://GUnicornServer2/;
>>
>>
>>
>> You can also specify that you want to listen for a certain domain/ip 
>> address, the syntax is a little tricky so i would suggest finding a good 
>> tutorial that meets your needs.  So in the above case, if a request is sent 
>> to port 9002, it will be forwarded to whichever website is running on the 
>> 9002 server.  Again, instead of using port 9002 you could just as easily 
>> route the request based on the ip.  I use this setup with uwsgi's emperor 
>> mode because it makes managing the vassal servers simple.
>>
>>
>>
>> If you, instead, want to host multiple sites using multi-tenancy over a 
>> single webserver then I would consider using middleware to route incoming 
>> urls to the appropriate urls.py.  nginx should not need any additional 
>> configuration, it just needs to route all the requests to the one 
>> webserver.  Routing then happen when the request is processed by the 
>> middleware. 
>>
>> There's probably an easier way to do this too that I'm not aware of. 
>>  I've done subdomain routing like this in the past, but it felt kind of 
>> hacky.  I feel like nginx is the more capable  solution.  I might be 
>> deploying a site later today that involves this sort of setup.  If i get 
>> around to it ill post the actual code chunks.
>>
>> best,
>> avg
>>
>>
>>
>>
>>

-- 
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.


[mezzanine-users] Custom Editable Setting Using Textarea Formfield

2016-01-05 Thread Matt Mansour
Hi All -

I have created some custom editable settings and they're rendering fine in 
the admin. However, some of the custom settings in the admin would yield a 
better UX if the formfield was a Textarea instead of a charfield. Wondering 
if anyone can recommend a good approach. I am just starting to dig deeper 
now. 

Cheers,
Matt

-- 
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.


[mezzanine-users] Re: Multi Tenancy / Multi IPs

2016-01-04 Thread Matt Mansour
Hi Anthony - 

Thank you for the post. 

The set up I have is one project with multiple websites all housed in the 
same CMS - Basically following the mezzanine docs for multi-tenancy 
http://mezzanine.jupo.org/docs/multi-tenancy.html

For other projects I have used configurations that somewhat resemble yours. 
It works great. However, on this current project we don't want editors to 
have to log in to multiple website admins. In our case we're trying to keep 
content for all our websites in the same CMS. 

However, your post has given me some ideas to try. If I can get something 
working I'll report back on how I did it. And more feedback is always 
welcome and helpful. 

Thanks again!
Matt

On Sunday, January 3, 2016 at 11:53:33 AM UTC-8, Anthony Gagliardo wrote:
>
> There are a few ways to set this up.  I've tried a couple of them out 
> personally and from my past experience I would say that the next step 
> depends upon how you have multitenancy set up.
>
> Typically I will use multiple django/mezzanine projects installed on the 
> same server, in completely separate dirs.  Each project has a domain name 
> (and an elastic ip associated with it), which is where nginx comes into the 
> mix.  Inside my nginx config I have several upstream servers defined. I use 
> one virtualhost for each of the projects plus whatever utility servers that 
> I might need.
>
> example upstream setup:
> upstream GUnicornSite1 {
> server 127.0.0.1:8001;
> }
> upstream GUnicornSite2 {
> server 127.0.0.1:8002;
> }
> upstream GUnicornSite3 {
> server 127.0.0.1:8003;
> }
>
> Now that nginx knows about the webservers, its time to actually start 
> those webservers.  Its important to note that in your gunicorn 
> configuration, you need to make sure that each server is listening on 
> whichever port number you specified in your nginx.conf definition.  Aside 
> from any static media nonsense that may or may not arise, I don't think 
> there is much more to specify as far as the gUnicorn config.  I made the 
> move to uwsgi because I needed websocket support.
>
> The uwsgi part of my nginx.conf looks significantly different than what a 
> gunicorn setup needs, but here is a simple example of how I listen on a 
> certain port.
> Server{
> listen 9001;
> location / {
>proxy_pass http://GUnicornServer1/;
>
> Server{
> listen 9002;
> location / {
>proxy_pass http://GUnicornServer2/;
>
>
>
> You can also specify that you want to listen for a certain domain/ip 
> address, the syntax is a little tricky so i would suggest finding a good 
> tutorial that meets your needs.  So in the above case, if a request is sent 
> to port 9002, it will be forwarded to whichever website is running on the 
> 9002 server.  Again, instead of using port 9002 you could just as easily 
> route the request based on the ip.  I use this setup with uwsgi's emperor 
> mode because it makes managing the vassal servers simple.
>
>
>
> If you, instead, want to host multiple sites using multi-tenancy over a 
> single webserver then I would consider using middleware to route incoming 
> urls to the appropriate urls.py.  nginx should not need any additional 
> configuration, it just needs to route all the requests to the one 
> webserver.  Routing then happen when the request is processed by the 
> middleware. 
>
> There's probably an easier way to do this too that I'm not aware of.  I've 
> done subdomain routing like this in the past, but it felt kind of hacky.  I 
> feel like nginx is the more capable  solution.  I might be deploying a site 
> later today that involves this sort of setup.  If i get around to it ill 
> post the actual code chunks.
>
> best,
> avg
>
>
>
>
>

-- 
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.


[mezzanine-users] Re: Admin Settings | Add New Field Group for New Editable Settings

2015-12-30 Thread Matt Mansour
Hi All -

I found the code and how this appears to  work. A field group is 
automatically created when at least two setting names start with the same 
letters before the first underscore.  

So:

AD_PLACEMENT_MOBILE_1
AD_PLACEMENT_MOBILE_2


will create the Field group 'Ad'

Cheers,
Matt
On Wednesday, December 30, 2015 at 1:57:59 PM UTC-8, Matt Mansour wrote:
>
>
> Hi All -
>
> I see how we can create new editable settings in the mezzanine admin -  by 
> adding a defaults.py file into our app and setting editable to true. 
> However, I noticed all the new settings from the new defaults.py file show 
> up in the field group 'Miscellaneous' in the admin. 
>
> I'd like to have a new field group; e.g. 'Ad Tags''. And have the new Ad 
> settings show up under the 'Ad Tags' field group.
>
> Has anyone crossed this bridge yet?
>
> Thanks,
> Matt
>

-- 
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.


[mezzanine-users] Admin Settings | Add New Field Group for New Editable Settings

2015-12-30 Thread Matt Mansour

Hi All -

I see how we can create new editable settings in the mezzanine admin -  by 
adding a defaults.py file into our app and setting editable to true. 
However, I noticed all the new settings from the new defaults.py file show 
up in the field group 'Miscellaneous' in the admin. 

I'd like to have a new field group; e.g. 'Ad Tags''. And have the new Ad 
settings show up under the 'Ad Tags' field group.

Has anyone crossed this bridge yet?

Thanks,
Matt

-- 
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.


[mezzanine-users] Multi Tenancy / Multi IPs

2015-12-29 Thread Matt Mansour
Howdy All - 

I have a multi tenancy project up and running. However, I need to assign 
each domain a unique IP. Setting this up on AWS was pretty easy. AWS allows 
you to use multiple Elastic IPs on a single EC2 server instance. 

The tricky part has been getting the mezzanine nginx.conf and gunicorn.conf 
files configured properly. Has any one crossed this bridge before? 

Cheers,
Matt

-- 
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] Any interest in sorl_thumbmail?

2015-12-18 Thread Matt Mansour
I am having good success with django-image-cropper in a mezzanine project.
I am curious about it as a potential replacement or option as well.
On Dec 18, 2015 2:02 PM, "Derek Adair"  wrote:

> After running into some limitations / shortfalls of the thumbnail
> generating template-tag in mezzanine I came across this blog post
> .  I'm wondering if
> anyone else would desire this as a replacement.  Has anyone tried taking it
> further than this post and replacing the thumbnail code from mezzanine.core?
>
> --
> 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.


[mezzanine-users] Re: Different Static Url for Each Site in MultiTenancy

2015-12-09 Thread Matt Mansour
Hi All - 

This thread is probably an unusual use case for many. However, I said I'd 
report back. Since this issue only applies to the Facebook image that 
populates in a share dialog I left the STATIC_URL and MEDIA_URL settings 
alone. I created a custom context processor. It let's me replace {{ 
MEDIA_URL }} for my facebook share image with a variable called {{ 
FACEBOOK_SHARE_URL }}. The domain matches the actual site domain, as 
requested in the original post above. 

As I mentioned (and heard straight from a Facebook rep) - False positives 
for spam can get triggered when your Facebook share image has a different 
domain (e.g. a cloud front domain) than the actual site domain. That's a 
super easy fix in a single site mezzanine scenario. But a little more work 
in a multi site mezzanine scenario. When that false positive gets triggered 
your reach (from facebook shares) drops a lot. 

If anyone needs the details of the context_processor let me know. 
Otherwise, it's very just straight forward Django. 

Cheers

On Friday, November 20, 2015 at 4:48:28 PM UTC-8, Matt Mansour wrote:
>
> Howdy all -
>
> I am working on multi tenancy mezzanine project. I define a static URL in 
> settings (in this case a Cloudfront URL). However, the static URL needs to 
> change to match the site I am accessing. 
>
> For example, if I am on *example.com <http://example.com>* I want my 
> static url to render as *media.example.com/static/ 
> <http://media.example.com/static/>... * Likewise, if I am on *example2.com 
> <http://example2.com>* I want my static url to render as 
> *media.example2.com/static/ 
> <http://media.example2.com/static/>*
>
> Has anyone here had to implement something similar? 
>
> Unfortunately when images are rendered from a different domains than the 
> site domain strange things can happen; like Facebook share reach 
> diminishing, as their current algo seems to associate that sort of thing as 
> spam.
>
> Cheers
>

-- 
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.


[mezzanine-users] Re: Multi Tenancy is only using one base.html

2015-12-07 Thread Matt Mansour
In my case a unique base template per site is not necessary .  A 
combination of refactoring out the base site/template at a much broader 
level  - passing in the entire body from the child sites - and using 
includes in the child sites to keep the sites modular, seemed to do the 
trick. It looks like the base site template can easily be used for meta 
data and mezzanine settings. 

Using the Django debug tool bar to get a visual on where the child 
site/templates were being inherited from made the task easier. 

Hope this helps someone.

Cheers

On Wednesday, August 27, 2014 at 10:51:16 PM UTC-7, Jesse Ramirez wrote:
>
> I'm trying to set up a project using multi tenancy. I've set up 
> HOST_THEMES correctly.
>
> The issue is each app has it's own base.html that's not being called. 
> Instead only the topmost app in INSTALLED_APPS's base.html is being called. 
> So all themes are extending a single base.html not their own.
>
> I would like each site to use it's own base.html. Is this possible?
>

-- 
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.


[mezzanine-users] Re: Multi Tenancy is only using one base.html

2015-11-28 Thread Matt Mansour
Nevermind, I was not using the best keywords to search the forum. My 
apologies. It looks like the current approaches are 1. try Josh's 95% 
complete solution (Thanks Josh). 2 Integrate and app like django-domains 
and use that instead of HOST_THEMES

https://bitbucket.org/stephenmcd/mezzanine/pull-requests/35/site_theme-loader/



On Saturday, November 28, 2015 at 10:21:26 AM UTC-8, Matt Mansour wrote:
>
> I am just discovering this issue now. 
>
> For example, with a multisite site up; let's say two sites that are 
> properly configured, and you want the blog app (which references base.html) 
> to have a different base.html for each site, the blog only uses the 
> base.html of the top most INSTALLED_APP theme. 
>
> I am wondering what the cleanest way to approach this situation might be. 
> Any ideas? 
>
> On Wednesday, August 27, 2014 at 10:51:16 PM UTC-7, Jesse Ramirez wrote:
>>
>> I'm trying to set up a project using multi tenancy. I've set up 
>> HOST_THEMES correctly.
>>
>> The issue is each app has it's own base.html that's not being called. 
>> Instead only the topmost app in INSTALLED_APPS's base.html is being called. 
>> So all themes are extending a single base.html not their own.
>>
>> I would like each site to use it's own base.html. Is this possible?
>>
>

-- 
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.


[mezzanine-users] Re: Multi Tenancy is only using one base.html

2015-11-28 Thread Matt Mansour
I am just discovering this issue now. 

For example, with a multisite site up; let's say two sites that are 
properly configured, and you want the blog app (which references base.html) 
to have a different base.html for each site, the blog only uses the 
base.html of the top most INSTALLED_APP theme. 

I am wondering what the cleanest way to approach this situation might be. 
Any ideas? 

On Wednesday, August 27, 2014 at 10:51:16 PM UTC-7, Jesse Ramirez wrote:
>
> I'm trying to set up a project using multi tenancy. I've set up 
> HOST_THEMES correctly.
>
> The issue is each app has it's own base.html that's not being called. 
> Instead only the topmost app in INSTALLED_APPS's base.html is being called. 
> So all themes are extending a single base.html not their own.
>
> I would like each site to use it's own base.html. Is this possible?
>

-- 
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.


[mezzanine-users] Re: Different Static Url for Each Site in MultiTenancy

2015-11-24 Thread Matt Mansour
Actually I misstated. I am only trying to solve this for the MEDIA_URL. 
Specifically for the image that would be selected as the default image in a 
Facebook share open graph scenario in a blog post.  The STATIC_URL can have 
the same domain across multiple sites without Facebook reach issues. 

I'll report back on the solution I go with. 

Thanks

On Friday, November 20, 2015 at 6:28:04 PM UTC-8, Matt Mansour wrote:
>
> One approach I am looking into is adding / overiding the static template 
> context processor. But I am wondering if there is a cleaner way. Or 
> something simple that I am overlooking. 
>
> On Friday, November 20, 2015 at 4:48:28 PM UTC-8, Matt Mansour wrote:
>>
>> Howdy all -
>>
>> I am working on multi tenancy mezzanine project. I define a static URL in 
>> settings (in this case a Cloudfront URL). However, the static URL needs to 
>> change to match the site I am accessing. 
>>
>> For example, if I am on *example.com <http://example.com>* I want my 
>> static url to render as *media.example.com/static/ 
>> <http://media.example.com/static/>... * Likewise, if I am on *example2.com 
>> <http://example2.com>* I want my static url to render as 
>> *media.example2.com/static/ 
>> <http://media.example2.com/static/>*
>>
>> Has anyone here had to implement something similar? 
>>
>> Unfortunately when images are rendered from a different domains than the 
>> site domain strange things can happen; like Facebook share reach 
>> diminishing, as their current algo seems to associate that sort of thing as 
>> spam.
>>
>> Cheers
>>
>

-- 
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.


[mezzanine-users] Re: Different Static Url for Each Site in MultiTenancy

2015-11-20 Thread Matt Mansour
One approach I am looking into is adding / overiding the static template 
context processor. But I am wondering if there is a cleaner way. Or 
something simple that I am overlooking. 

On Friday, November 20, 2015 at 4:48:28 PM UTC-8, Matt Mansour wrote:
>
> Howdy all -
>
> I am working on multi tenancy mezzanine project. I define a static URL in 
> settings (in this case a Cloudfront URL). However, the static URL needs to 
> change to match the site I am accessing. 
>
> For example, if I am on *example.com <http://example.com>* I want my 
> static url to render as *media.example.com/static/ 
> <http://media.example.com/static/>... * Likewise, if I am on *example2.com 
> <http://example2.com>* I want my static url to render as 
> *media.example2.com/static/ 
> <http://media.example2.com/static/>*
>
> Has anyone here had to implement something similar? 
>
> Unfortunately when images are rendered from a different domains than the 
> site domain strange things can happen; like Facebook share reach 
> diminishing, as their current algo seems to associate that sort of thing as 
> spam.
>
> Cheers
>

-- 
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.


[mezzanine-users] Different Static Url for Each Site in MultiTenancy

2015-11-20 Thread Matt Mansour
Howdy all -

I am working on multi tenancy mezzanine project. I define a static URL in 
settings (in this case a Cloudfront URL). However, the static URL needs to 
change to match the site I am accessing. 

For example, if I am on *example.com* I want my static url to render as 
*media.example.com/static/... * Likewise, if I am on *example2.com* I want 
my static url to render as *media.example2.com/static/*

Has anyone here had to implement something similar? 

Unfortunately when images are rendered from a different domains than the 
site domain strange things can happen; like Facebook share reach 
diminishing, as their current algo seems to associate that sort of thing as 
spam.

Cheers

-- 
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] Search engine performance and technology?

2015-11-20 Thread Matt Mansour
Hi A.B -

Mezzanine by default searches the models / hits the database directly. It
works very well, until your dataset starts to get very large or you have
tons of traffic coming in. Then you'll probably want to implement a
solution such as elastic search. But there is no need to implement elastic
search right out of the gate, unless you know your initial launch will have
500M+ records or tons of traffic.

Cheers,
Matt

On Fri, Nov 20, 2015 at 1:09 AM, A.B.  wrote:

> Is it done by elastic search? How are first hand experiences with the
> performance of Mezzanine search engine and how was it implemented?
>
> --
> 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] Cartridge Deploy Failing But Mezz Deploy Not

2015-11-12 Thread Matt Mansour
Nope!

Thanks Eduardo. I haven't tested yet, but I have a feeling that's exactly
what it is. I'll report back and confirm.

Cheers

On Thu, Nov 12, 2015 at 1:58 PM, Eduardo Rivas 
wrote:

> Is cartridge listed in your requirements file?
>
> --
> 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.


[mezzanine-users] Cartridge Deploy Failing But Mezz Deploy Not

2015-11-12 Thread Matt Mansour
Hi all - 

I haven't been around for a while. Nice to see mezzanine continue to grow!

I am using the shipped fabfile to deploy mezzanine 4.0.1 to an ec2 
instance.  The install and deploy works like a charm for a mezzanine 
project. However, when deploying  (fab deploy) a cartridge project  I get 
the error: 

ImportError: No module named cartridge

Has anyone else experienced this one? 

Cheers,
Matt


-- 
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.


[mezzanine-users] Re: Replace mezzanine search

2014-06-12 Thread Matt Mansour
Hi Craig -

I am almost done with something similar. I integrated Haystack and Elastic 
Search. I have a few minor tweaks to make but I mostly have it working 
following the docs below. I'll probably do a write up to consolidate these 
docs. 


http://nanvel.name/weblog/django-haystack-elasticsearch-example-project/

http://django-haystack.readthedocs.org/en/latest/tutorial.html


For the pip installs listed on the first doc I just grabbed the latest 
versions


On Thursday, June 12, 2014 5:09:58 PM UTC-7, Craig wrote:
>
> Want to replace /search view with my own custom view. Anyone know how to 
> do this?
>

-- 
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] Subclassing SiteRelated

2014-04-10 Thread Matt Mansour
I thought so, Thanks Josh!

On Wednesday, April 9, 2014 8:45:25 PM UTC-7, Josh Cartmell wrote:
>
> Yes, Mezzanine's multi tenancy features rely on the fields/managers added 
> by SiteRelated ;)
>
>
> On Wed, Apr 9, 2014 at 12:23 PM, Matt Mansour 
> 
> > wrote:
>
>> Howdy all - 
>>
>> With a quick glance at the core I think I know the answer but thought I'd 
>> post the question as well. 
>>
>> Would the best way to integrate an external django app - one that does 
>> not subclass Displayable -  into Mezzanine's multi-tenancy functionality be 
>> to change the models of the app to subclass "SiteRelated"  ?
>>
>> Best,
>> Matt
>>
>> -- 
>> 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[mezzanine-users] Subclassing SiteRelated

2014-04-09 Thread Matt Mansour
Howdy all - 

With a quick glance at the core I think I know the answer but thought I'd 
post the question as well. 

Would the best way to integrate an external django app - one that does not 
subclass Displayable -  into Mezzanine's multi-tenancy functionality be to 
change the models of the app to subclass "SiteRelated"  ?

Best,
Matt

-- 
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.


[mezzanine-users] Re: Mezzanine 3.0.8 released

2014-02-06 Thread Matt Mansour
Thanks all!

On Wednesday, February 5, 2014 12:50:42 PM UTC-8, Stephen McDonald wrote:
>
> Hi all, 
>
> It's been a busy week since 3.0.7 and Mezzanine 3.0.8 is now out with a 
> handful of minor bugfixes and improvements:
>
> - Improved support for thumbnails on remove storage backends
> - Fixed conditional validation of content fields via their status in 
> Displayable models
> - More static proxy fixes (fixes many reported issues loading tinymce 
> dialogs etc)
> - More unicode fixes around page processor slugs
> - Initial support for using the latest upstream Grappelli/Filebrowser (via 
> https://github.com/sephii/mezzanine-grappelli)
> - urlpatterns for mezzanine.accounts now follow the convention of defaults 
> for Django's LOGIN_URL/LOGOUT_URL settings (/account/ becomes /accounts/, 
> with the former redirecting to the latter as a fallback)
> - Mezzanine's runserver will now serve files under STATIC_ROOT during 
> development
> - Fixes for unicode filenames in mezzanine.galleries
>
> Big thanks to everyone who helped out this week.
>
>
> -- 
> Stephen McDonald
> http://jupo.org 
>

-- 
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/groups/opt_out.


[mezzanine-users] Re: HTTPS in sitemap.xml

2014-02-05 Thread Matt Mansour
Sam, that did the trick - 

To implement without touching the core I subclassed DisplayableSitemap, 
change the protocol var and added the sitemap url patterns from Mezzanine's 
main url.py into my app's url patterns

 urls.py

from mezzanine.conf import settings
from mezzanine.core.sitemaps import DisplayableSitemap

class HttpsDisplayableSitemap(DisplayableSitemap):
protocol=('https')

urlpatterns = patterns('myapp.views',
url("^$", "home", name="home"),
...
)

# Django's sitemap app.
if "django.contrib.sitemaps" in settings.INSTALLED_APPS:
sitemaps = {"sitemaps": {"all": HttpsDisplayableSitemap}}
urlpatterns += patterns("django.contrib.sitemaps.views",
("^sitemap\.xml$", "sitemap", sitemaps)
)

Thanks for pointing me in the right direction

-- 
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/groups/opt_out.


[mezzanine-users] HTTPS in sitemap.xml

2014-02-05 Thread Matt Mansour
Howdy all - 

I have an all 'https' site built in Mezzanine 1.4.9. I just noticed the 
sitemap.xml urls are using the protocul 'http' instead of 'https'.   I am 
301ing all 'http' to 'https', so it's not a huge deal. But I like to keep 
things as clean as possible. 

Is there a quick setting that will fix that? I tried setting 'https' in 
settings but that did not do it. 

Any quick thoughts before I dive into the code (I would be doing this 
already but I am not at my work machine)

Thanks,
Matt

-- 
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/groups/opt_out.


[mezzanine-users] Re: Mezzanine 3.0 and Cartridge 0.9 released

2013-12-24 Thread Matt Mansour
Great work Stephen and contributors. 
Thank you so much!

On Tuesday, December 24, 2013 6:30:45 AM UTC-5, Stephen McDonald wrote:
>
> Hi all,
>
> I've just released Mezzanine 3.0 and Cartridge 0.9 to PyPi.
>
> Like the 1.0 release of Mezzanine, this release represents a major round 
> of housekeeping in the software environment Mezzanine works with. 
> Specifically Mezzanine now supports:
>
> - Python 3.3 (as well as 2.6 and 2.7)
> - Django 1.6 (as well as 1.4 and 1.5)
> - Bootstrap 3
>
> You might be wondering about the jump from Mezzanine 1.4.16 directly to 
> 3.0 - we've gone with 3.0 as it represents the latest support for Bootstrap 
> 3 and more significantly, Python 3, an entirely new version of the Python 
> language. We also wanted to break away from lurking around similar version 
> numbers with Django, as this would confuse conversations where the various 
> versions of Mezzanine and Django were often discussed together.
>
> As well as the above major overhauls and also many bug-fixes, here's a 
> list of other enhancements also included in the Mezzanine release:
>
> - Better page handling when APPEND_SLASH is False
> - Better support for password-less authentication backends
> - Support for multiple SSL sites in default nginx conf
> - More flexible instance removal in default fabfile
> - Thumbnail template tags now accept args for controlling crop centering
> - Pagination (blog posts, Cartridge products) can now be disabled entirely
> - TinyMCE handling now includes a pre-populated list of titles/URLs (like 
> a sitemap) to link to 
> - Admin now includes a language selector when multiple languages are 
> defined
>
> The 0.9 release of Cartridge (along with new 0.3 versions of the grappelli 
> and filebrowser forks) simply bring everything up to date with all the 
> above.
>
> I want to offer a huge thanks to everyone who worked to make these 
> releases possible. My own involvement has somewhat been reduced to code 
> reviewing, merging, and packaging the releases, so all the above has been 
> entirely a community effort. Particular thanks goes to Ed Schofield for the 
> Python 3 work and Eduardo Rivas for the upgrade to Bootstrap 3 - both 
> extremely involved tasks. And also Sebastian Clemens who only joined 
> recently, but has made a large contribution in the Bootstrap 3 and 
> multi-lingual work. Thanks again also goes to the tireless effort of Josh 
> Cartmell, Ken Bolton, and everyone else who has helped out newcomers on the 
> mailing list and IRC - you people are the foundation of this project.
>
> Cheers,
> Steve 
>
>
> -- 
> Stephen McDonald
> http://jupo.org 
>

-- 
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/groups/opt_out.