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_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_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_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 <wamins...@gmail.com> 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 <paulhtremb...@gmail.com>
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, <e...@naturallyiq.com> 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.


[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-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] 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 <slackbabb...@gmail.com>
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.


[mezzanine-users] Is there a way to remove comments/ratings from everywhere?

2016-12-11 Thread Matt


I'm new to Mezzanine (and fairly new to Python). I'm looking to get away 
from Drupal and use something python-based.


Is there a way to disable comments/ratings from mezzanine completely? eg. 
in templates and in admin panel? From my research, this is the only thing 
I've found: http://bitofpixels.com/blog/disabling-mezzanine-comments/ – I 
also found another article saying this is not supported (although it was 
from 4 years ago).


I'm wondering if that link is my best option at this time (although that 
still leaves me with comment links in admin panel). I'm still learning the 
ropes so I may be missing something obvious. Thank you.

-- 
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" <laird.av...@gmail.com> 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
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" <slackbabb...@gmail.com> 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" <laird.av...@gmail.com> 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" <slackb...@gmail.com> 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" <laird...@gmail.com> 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.


[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] 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: 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.


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. <alen.ba...@gmail.com> 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.


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


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


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] Re: how to subclass BlogPost model, and replace in admin site

2015-09-05 Thread Matt Hughes
I think i should be a little more clear what im trying to do,
I have added a charfield to the BlogPost model, using 'EXTRA_MODEL_FIELDS' 
injection
the charfield is a comma separated list of web links
When the model is submitted, i need to check this field, and build a 
separate model entry for each link, and associate these entries to the 
blogpost



On Saturday, September 5, 2015 at 1:32:59 PM UTC-4, Matt Hughes wrote:
>
> Hi i would like to add some additional processing to the BlogPost model,
> but im having a difficulty trying to figure out how to properly subclass 
> it, and register it to the admin page.
>
> for now ive just done something simple like this in my models.py
>
> class MyBlogPost(BlogPost):
> pass
>
>
> and in my admin.py
>
> from mezzanine.blog.admin import BlogPostAdmin
> from mezzanine.blog.models import BlogPost
> from .models import MyBlogPost
>
> admin.site.unregister(BlogPost)
> admin.site.register(MyBlogPost, BlogPostAdmin)
>
>
> But the I just get an 'BlogPost is not registered' error, so im doing 
> something wrong
>
> So what the correct to replace BlogPost with my subclass?
>
> Im sure i had this figured out previously, but removed it temporarily, and 
> now cant remember how i did it.
> Trying to google for it like i did before hasn't gotten me anywhere.
>

-- 
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: how to subclass BlogPost model, and replace in admin site

2015-09-05 Thread Matt Hughes
i think i was approaching this wrong, i think i need to hook the save_model 
of BlogPostAdmin not BlogPost


On Saturday, September 5, 2015 at 1:32:59 PM UTC-4, Matt Hughes wrote:
>
> Hi i would like to add some additional processing to the BlogPost model,
> but im having a difficulty trying to figure out how to properly subclass 
> it, and register it to the admin page.
>
> for now ive just done something simple like this in my models.py
>
> class MyBlogPost(BlogPost):
> pass
>
>
> and in my admin.py
>
> from mezzanine.blog.admin import BlogPostAdmin
> from mezzanine.blog.models import BlogPost
> from .models import MyBlogPost
>
> admin.site.unregister(BlogPost)
> admin.site.register(MyBlogPost, BlogPostAdmin)
>
>
> But the I just get an 'BlogPost is not registered' error, so im doing 
> something wrong
>
> So what the correct to replace BlogPost with my subclass?
>
> Im sure i had this figured out previously, but removed it temporarily, and 
> now cant remember how i did it.
> Trying to google for it like i did before hasn't gotten me anywhere.
>

-- 
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 subclass BlogPost model, and replace in admin site

2015-09-05 Thread Matt Hughes
Hi i would like to add some additional processing to the BlogPost model,
but im having a difficulty trying to figure out how to properly subclass 
it, and register it to the admin page.

for now ive just done something simple like this in my models.py

class MyBlogPost(BlogPost):
pass


and in my admin.py

from mezzanine.blog.admin import BlogPostAdmin
from mezzanine.blog.models import BlogPost
from .models import MyBlogPost

admin.site.unregister(BlogPost)
admin.site.register(MyBlogPost, BlogPostAdmin)


But the I just get an 'BlogPost is not registered' error, so im doing 
something wrong

So what the correct to replace BlogPost with my subclass?

Im sure i had this figured out previously, but removed it temporarily, and 
now cant remember how i did it.
Trying to google for it like i did before hasn't gotten me anywhere.

-- 
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: EXTRA_MODEL_FIELDS - ForeignKey to self

2015-08-28 Thread Matt Hughes
anyway to implement this without changing 'boot/__init__' directly?

On Friday, February 20, 2015 at 4:50:57 PM UTC-5, Mathias Ettinger wrote:

 I guess it’s because both EXTRA_MODEL_FIELDS and strings referencing 
 classes as ForeignKey positional argument rely on the class_prepared 
 signal. But with it being only sent once, the ForeignKey doesn't have any 
 chance to catch the signal in time.

 For every other use case other than a self-referencing ForeignKey, either 
 the model being referenced has been created when the extra ForeignKey is 
 added and it can be resolved as a class right away, or the ForeignKey will 
 be able to resolve the class as soon as it send the class_prepared signal.
 In the case of a self-referencing extra ForeignKey, the ForeignKey is 
 added after the class_prepared signal has been fired but can't resolve the 
 string into a class yet because the model has not finished initializing. So 
 the ForeignKey connect to the class_prepared signal and wait for the class 
 that just fired it to fire it again. In vain.

 One solution could be to re-raise the class_prepared signal after extra 
 fields had been added to a model. To do so, you could change the 
 add_extra_model_fields function in mezzanine/boot/__init__.py to:
 def add_extra_model_fields(sender, **kwargs):
 
 Injects custom fields onto the given sender model as defined
 by the ``EXTRA_MODEL_FIELDS`` setting.
 
 model_path = %s.%s % (sender.__module__, sender.__name__)
 extra_fields = fields.get(model_path, {})
 if (extra_fields):
 for field_name, field in extra_fields.items():
 field.contribute_to_class(sender, field_name)
 del fields[model_path]
 # re-send the class_prepared signal so self-referencing ForeignKey 
 can catch up
 class_prepared.send(sender=sender)


 Le vendredi 20 février 2015 17:44:37 UTC+1, Kacper Kołodziej a écrit :

 Hi! I'm trying to create multi-level categories structure. I have added 
 ForeignKey to 'self' to BlogCategory. I've tried to do it in some different 
 ways: http://pastebin.com/77ex9ehe but none of them works. I always 
 receive error on syncdb:

 CommandError: One or more models did not validate:
 blog.blogcategory: 'parent_category' has a relation with model self, 
 which has either not been installed or is abstract.




-- 
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: Validating BlogPost model categories

2015-08-25 Thread Matt Hughes
Ok i think i might have figured it out, I needed to hook the save_related() 
method from BlogPostAdmin
not sure if this is the correct way tho, i just hooked into 
__getattribute__, and watched for any methods that looked useful

so i ended up adding the following to BlogPostAdmin

def save_related(self, request, form, formsets, change):
aaa = super(BlogPostAdmin, self).save_related(request, form, 
formsets, change)
cats = form.instance.categories.all()
parents = []
for a in cats:
maxx = 10
while a.parent_category != None and maxx  0:
parents.append(a.parent_category)
a = a.parent_category
maxx = maxx - 1
for a in parents:
form.instance.categories.add(a)
return aaa

not sure if i need the loop counter, i just get nervous when using while 
loops lol

On Tuesday, August 25, 2015 at 12:12:02 AM UTC-4, Matt Hughes wrote:


 Hi when i add a blog post via the admin page, how do i validate the 
 categories?

 Ive tried overriding the 'clean()' method of BlogPost, which does get 
 called, but not sure where to check for categories.

 when i submit a post via the admin, i want to make sure it has atleast one 
 category.
 I have also modified my blogcategory model to include a 'parent_category' 
 field, and i want the make sure the BlogPost also includes all 
 parent_categories, so post with also be listed under these parent_categories

 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.


[mezzanine-users] Validating BlogPost model categories

2015-08-24 Thread Matt Hughes

Hi when i add a blog post via the admin page, how do i validate the 
categories?

Ive tried overriding the 'clean()' method of BlogPost, which does get 
called, but not sure where to check for categories.

when i submit a post via the admin, i want to make sure it has atleast one 
category.
I have also modified my blogcategory model to include a 'parent_category' 
field, and i want the make sure the BlogPost also includes all 
parent_categories, so post with also be listed under these parent_categories

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] Rendering the canvas tag?

2014-10-30 Thread Matt Quinn
For me it was Django built-in templating system that was stripping my tags.
I solved this by using safe template filter.
{{ var | safe }}

here's the docs:
https://docs.djangoproject.com/en/dev/ref/templates/builtins/#std:templatefilter-safe

Hope this helps.
-matt

On Thu, Oct 30, 2014 at 7:21 PM, Ross Laird r...@rosslaird.com wrote:

 I'd like to render some charts, using Chart.js, but I can't seem to get
 the canvas tag to be preserved when I enter it into a rich text page. I
 have tinyMCE set up to accept all tags, and I have also added canvas to the
 ALLOWED_TAGS in defaults.py (thinking that this might not actually be a
 tinyMCE issue). But *something *continues to strip out these tags.
 Anybody have an idea what's going on?

 I suppose I might have to create a custom template for this, if I can't
 get it working through the interface.

 Ross

 --
 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] error happened when serving two mezzanine sites with nginx+uwsgi

2014-08-27 Thread Matt Gushee
Hi, Wesley--

I can't claim to be a uWSGI expert (can anyone? ;-) ), but I do have a
mezzanine site running with uWSGI  nginx. My setup is quite different
from yours (e.g. my OS is FreeBSD, and though I have only one
Django-based site, I'm also hosting a couple of other sites that are
not Python-based at all), so I don't know that my configuration will
help you.

But I do have a couple of questions for you.

1) Have you read this tutorial?
http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

2) Where is your uWSGI installed? Is it installed in your virtualenv,
or in your system-wide python library, or is a standalone build? The
above tutorial recommends installing it in your virtualenv. I am using
a system-wide standalone version, and it works fine; the main reason I
do that is because of the non-python sites. It may also be relevant
that unlike most Linux distros, FreeBSD does not assume that you have
Python installed at all, let alone what version of Python you have or
where it is located. Anyway, I have a wild guess about this: if you
are using a system-wide version of uWSGI integrated into the Python
library, perhaps it thinks your Python executable is 2.6.

Beyond that ... I'm hesitant to say that your config looks wrong, but
I'm unfamiliar with your approach - especially running multiple apps
with one uWSGI config, using the Nginx config to distinguish between
them. Where did you learn to do that? I run uWSGI in emperor mode,
with a separate config file for each application.

It does appear to me that some of the variables being passed from
Nginx are redundant. Although none of them seem obviously relevant to
your issue, I think eliminating duplication would make it easier to
reason about the problem. E.g. define PYHOME once in the uWSGI config
instead of twice in the Nginx config. Also,  a minor point, but are
you sure there is a variable called UWSGI_SCRIPT? I can't find it
listed in the uWSGI documentation (which may or may not mean it isn't
there ;-) ).

Hope that helps a bit.

--
Matt Gushee

On Wed, Aug 27, 2014 at 5:11 AM, Wesley nisp...@gmail.com wrote:

 Hi guys,
I hit a problem when using nginx+uwsgi to serve two mezzanine sites upon
 one VPS.
 I use virtualenvwrapper to create a env with python2.7.6, note that
 system(centos6.5) has default python2.6.

 Here is my uwsgi.xml:
 uwsgi
   socket127.0.0.1:9000/socket
   listen100/listen
   mastertrue/master
   pidfile/usr/local/nginx/uwsgi.pid/pidfile
   processes8/processes
   pythonpath/home/Portal/pythonpath
   pythonpath/home/pythonpath
   modulewsgi/module
   profilertrue/profiler
   memory-reporttrue/memory-report
   enable-threadstrue/enable-threads
   logdatetrue/logdate
   limit-as6048/limit-as
   daemonize/home/django.log/daemonize
 /uwsgi

 here is django uwsgi files included in nginx conf:
 1. django_uwsgi.xml:
 server {
 listen  80;
 server_name happydiaosi.com;
 location / {
 uwsgi_pass   127.0.0.1:9000;
 include uwsgi_params;
 uwsgi_param UWSGI_CHDIR /home/Portal;
 uwsgi_param UWSGI_SCRIPT wsgi;
 uwsgi_param UWSGI_PYHOME /home/pyvirenvs/py276;
 #uwsgi_param UWSGI_PYHOME /home/pyvirenvs/easonportal;
 #uwsgi_param UWSGI_PYHOME /usr/lib64/python2.6;
access_log  off;
 }
 location /static/ {
 root/home/Portal/;
 access_log  off;
 log_not_found   off;
 autoindex on;
 }
  }

 2. django_uwsgi2.xml
 # Django project
 server {
 listen  80;
 server_name eason.happydiaosi.com;
 location / {
 uwsgi_pass   127.0.0.1:9000;
 include uwsgi_params;
 uwsgi_param UWSGI_CHDIR /home/EasonPortal;
 uwsgi_param UWSGI_SCRIPT wsgi;
 uwsgi_param UWSGI_PYHOME /home/pyvirenvs/py276;
 #uwsgi_param UWSGI_PYHOME /home/pyvirenvs/easonportal;
 #uwsgi_param UWSGI_PYHOME /usr/lib64/python2.6;
access_log  off;
 }
 location /static/ {
 root/home/EasonPortal/;
 access_log  off;
 log_not_found   off;
 }
  }

 So, after I start uwsgi and nginx, when access from browser, it raises:
 Traceback (most recent call last):
   File /home/EasonPortal/wsgi.py, line 16, in module
 from django.core.wsgi import get_wsgi_application
 ImportError: No module named django.core.wsgi

 actually, within the py276, I can import .
 So,here is sys.path of py276:
 (py276)[root@show python2.7]# python
 Python 2.7.6 (default, Aug 27 2014, 02:35:36)
 [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
 Type help, copyright, credits or license for more information.
 import sys
 [31326 refs]
 sys.path
 ['', '/home/pyvirenvs/py276/lib/python27.zip',
 '/home/pyvirenvs/py276/lib/python2.7',
 '/home/pyvirenvs/py276/lib/python2.7/plat-linux2',
 '/home/pyvirenvs/py276/lib/python2.7/lib-tk',
 '/home

Re: [mezzanine-users] Re: Email confirmation for admin-created users?

2014-07-17 Thread Matt Gushee
Hi, GM--

Thanks, I'll take a look at it.

On Thu, Jul 17, 2014 at 8:05 AM, gmflanagan cyclebelf...@gmail.com wrote:
 Hi Matt

 Here's an app that I put together, roughly copied from a current project:

 https://github.com/averagehuman/mezzanine-invites

 The idea is that, rather than creating users directly, you create invite
 codes which you give to your colleagues. Then you enable a custom auth
 backend which, when it detects a valid code having been entered, will
 automatically create a new user. It is then up to you to create an
 appropriate registration/login form incorporating a 'key' field. Eg. a form
 with

 + invite code
 + email
 + username
 + password
 + repeat password

 In my own use case, I'm printing out invitation codes and handing them to
 (possibly-not-very-computer-literate) people as a quick login/registration
 method, so my login form has a single 'invite_code' field. Also, I am
 allowing this code to be reused as a login token, but in your case if you
 are emailing this token then it ought to be one-shot, so you would have to
 arrange to set 'expired=True' after first use. (Or see the
 INVITE_CODES_ARE_REUSEABLE setting).

 YMMV, it's a bit rough, but there it is.

 gmflanagan

 averagehuman.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: Email confirmation for admin-created users?

2014-07-17 Thread Matt Gushee
Hi, Josh and all--

Well, I found out that if I set ACCOUNTS_APPROVAL_REQUIRED and
ACCOUNTS_VERIFICATION_REQUIRED to True, as per Stephen's message, I
can then create an inactive user, then go back and set their account
active, and they get a confirmation email. I'm a little confused by
the logic there: if you create and activate an account in separate
steps, a confirmation email is sent, but not if you create an account
that is active from the beginning. Is that intentional, or is it just
a side-effect of the logic for creating public accounts?

Anyway, I'm still looking for a more elegant solution, but this
two-step procedure will work for now.

On Wed, Jul 16, 2014 at 2:30 PM, Josh Cartmell joshcar...@gmail.com wrote:
 Hey Matt, an alternative idea would be to connect to the post save signal
 for User,
 https://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.post_save.

 If the user was created perform a password reset on them.  Here's the code
 in Mezzanine that does resets,
 https://bitbucket.org/stephenmcd/mezzanine/src/05319e2db0712eced56bfd7551fc6078119cbbc8/mezzanine/accounts/views.py?at=default#cl-137.
 Then the password reset email would allow them to choose a new password
 and login.

Okay ... I found the above documentation and code, and I sort of
understand ... I think I don't yet have a good grasp of how the
different parts of Django fit together, but anyway, if I do something
like this, what would be the best place to put the code? It doesn't
seem like something that should be an app ... or is it?

--
Matt Gushee

-- 
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] Email confirmation for admin-created users?

2014-07-16 Thread Matt Gushee
Hello, folks--

I am putting together my first Mezzanine (also my first Django) site
... it's taking longer than I expected, but it's mostly an enjoyable
experience, so I guess it's all good.

Anyway, I am trying to set up a simple online collaboration system.
And this is a business site, not an open community, and all users will
(a) be either clients or co-workers, and (b) require some degree of
privilege. So I expect that for the foreseeable future all accounts
will be created by an administrator (i.e., by me). I don't see a good
reason to allow self-service registration.

However, when a new user is created, I would like them to receive an
automated confirmation email containing a one-time login link.
Otherwise, I think I would need to send an email containing the user's
password in clear text. Um, no.

It appears that Mezzanine does not support this functionality out of
the box. Unless it is supposed to happen by default, and my test
server isn't set up correctly to enable the email to be sent (quite
possible). But from what I have read in the docs, it appears that
there is either self-service registration with optional email
confirmation, or admin registration without email. Is that right?

So, what would be the best solution for my case? I went hunting for
Django apps that will do what I need; django-registration and
django-allauth looked promising, but django-registration is no longer
maintained, and django-allauth seems like overkill and is apparently a
bit difficult to set up. On the other hand, I'd rather not reinvent
the wheel, especially when there are security implications.

Recommendations?

-- 
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: Email confirmation for admin-created users?

2014-07-16 Thread Matt Gushee
Hi again--

On Wed, Jul 16, 2014 at 1:47 PM, Eduardo Rivas jerivasmel...@gmail.com wrote:

 Lastly, remember you must have your email settings set correctly to be able
 to send notifications to your users and yourself. For example, you can use a
 Gmail account:
 EMAIL_HOST_USER = 'exam...@gmail.com'

... etc.

Good to know. I probably would have found the email settings on my
own, but I wasn't aware of them yet, so thank you.

--
Matt Gushee

-- 
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: Email confirmation for admin-created users?

2014-07-16 Thread Matt Gushee
Hi, Josh--

Awesome! That sounds like what I'm looking for. I don't fully
understand your suggestion, but I should be able to figure it out. If
not, I'll be back with more questions ... because I need this to work
;-)

BTW, any opinion on my question as to whether this should be a core
feature? I never expected I would say anything nice about a certain
other well-known CMS ... but Drupal does this out of the box, and it
seems pretty basic and desirable to me. Don't get me wrong: overall I
found Drupal to be a nightmare, and though Mezzanine/Django is posing
some unexpected challenges, so far the experience is anything but
nightmarish, so I'm not going back. However, this is one thing that
Drupal does right. IMHO.

Thanks,
Matt

On Wed, Jul 16, 2014 at 2:30 PM, Josh Cartmell joshcar...@gmail.com wrote:
 Hey Matt, an alternative idea would be to connect to the post save signal
 for User,
 https://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.post_save.

 If the user was created perform a password reset on them.  Here's the code
 in Mezzanine that does resets,
 https://bitbucket.org/stephenmcd/mezzanine/src/05319e2db0712eced56bfd7551fc6078119cbbc8/mezzanine/accounts/views.py?at=default#cl-137.
 Then the password reset email would allow them to choose a new password
 and login.

 In that way you could create a user in the admin interface and they would
 automatically receive an email that gave them access to their account.


 On Wed, Jul 16, 2014 at 4:26 PM, Matt Gushee m...@gushee.net wrote:

 Hi, Eduardo--

 Thanks for your quick reply!

 On Wed, Jul 16, 2014 at 1:27 PM, Eduardo Rivas jerivasmel...@gmail.com
 wrote:
  Hi Matt. Mezzanine supports user access control in a self-service
  configuration that might be useful for you. You can have your users
  request
  an account (fill in their details and password), but they will not be
  granted access to the site (they can't log in) until an authorized
  member
  clears their request.

 Yes, I saw that, but from a user experience perspective I don't find
 it satisfactory. For my users, having an account on my site is a just
 a means to an end, so it had better be as convenient as possible.
 *Telling* people to go to my site and do something that *I* want them
 to do, for reasons that may be unclear or unimportant to them, feels
 like a very 20th-century way of interacting online.

 Sounds like I might need to write some code. Which I don't really
 mind, but was hoping to avoid doing at this early stage. So I have a
 question: is this (email confirmations for admin-created accounts) a
 feature that should go into Mezzanine core? Or shall I plan on just
 extending the account management code for my own purposes?

 --
 Matt Gushee

 --
 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] Mezzanine project not playing nice with uWSGI

2014-07-08 Thread Matt Gushee
Thanks, Josh--

I think you were right. At any rate, I found the 'pythonpath' option
(uWSGI is a bit of a monster--it has literally hundreds of options),
so my uwsgi.ini now contains:

   pythonpath = /srv/http/salixmedia.com/test/salix_site

However, the urlconf problem I mentioned was a different story. That
seems to be caused by the debug toolbar, and I found a workaround in
this StackOverflow post: http://tinyurl.com/nsqfucc

   DEBUG_TOOLBAR_PATCH_SETTINGS = False

Anyway, appreciate the tip.

On Tue, Jul 8, 2014 at 7:38 AM, Josh Cartmell joshcar...@gmail.com wrote:
 Hey Matt, I don't have experience with uWSGI, it does seem like a python
 path issue.  Is salix_site definitely on the Python path in the scope of
 uWSGI running?  The django runserver command automatically adds your project
 to the python path, but that isn't necessarily the case with other server
 setups.


 On Mon, Jul 7, 2014 at 11:54 PM, Matt Gushee m...@gushee.net wrote:

 Hi, all--

 I have a Mezzanine site under development that I've been hacking on
 for about a week. I'm getting close to being able to deploy the first
 version, and I would like to run it under uWSGI. But uWSGI is having
 trouble finding certain components.

 I created the project in a virtualenv, using the simple command:

   mezzanine-project salix_site

 so the directory structure looks like:

   .../test/
 pyenv/
 [VIRTUALENV FILES]
 salix_site/
 __init__.py
 local_settings.py
 manage.py
 settings.py
 urls.py
 wsgi.py

 Actually, there's some additional stuff I've added, but I'm just
 trying to show that AFAIK the essential components are all there. I
 think I have only modified INSTALLED_APPS in settings.py, and added
 the SECRET_KEY, NEVERCACHE_KEY, and DATABASES variables in
 local_settings.py.

 My current uwsgi.ini file looks like:

  [uwsgi]
  plugins = python2
  chdir = /srv/http/salixmedia.com/test
  module = salix_site.wsgi
  callable = application
  virtualenv = /srv/http/salixmedia.com/test/pyenv
  master = true
  processes = 4
  socket = /tmp/salix-test.sock
  chmod-socket = 666
  vacuum = true

 And when I run 'uwsgi --ini uwsgi.ini', it appears to be finding the
 wsgi module, but then when I attempt to visit the site in my browser,
 I get this error:

  django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must
  not be empty.

 But, as I mentioned above, I did set SECRET_KEY in local_settings.py.
 This error suggests that the local settings are not available. So I
 tried modifying the local settings import statement in settings.py to
 read:

 try:
 from salix_site.local_settings import *

 Then I get a new error:

  django.core.exceptions.ImproperlyConfigured: The included urlconf
  salix_site.urls doesn't have any patterns in it

 Well, I don't know what to make of that. I didn't create any URL
 patterns, but my urls.py seems to import the default patterns from
 Mezzanine - and anyway, it works fine when I run the site directly
 with './manage.py runserver'.

 It appears to me that mezzanine is doing some kind of path/package
 name manipulation that uWSGI doesn't know about. Any idea what I can
 do about this?

 --
 Matt Gushee

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


[mezzanine-users] Mezzanine project not playing nice with uWSGI

2014-07-07 Thread Matt Gushee
Hi, all--

I have a Mezzanine site under development that I've been hacking on
for about a week. I'm getting close to being able to deploy the first
version, and I would like to run it under uWSGI. But uWSGI is having
trouble finding certain components.

I created the project in a virtualenv, using the simple command:

  mezzanine-project salix_site

so the directory structure looks like:

  .../test/
pyenv/
[VIRTUALENV FILES]
salix_site/
__init__.py
local_settings.py
manage.py
settings.py
urls.py
wsgi.py

Actually, there's some additional stuff I've added, but I'm just
trying to show that AFAIK the essential components are all there. I
think I have only modified INSTALLED_APPS in settings.py, and added
the SECRET_KEY, NEVERCACHE_KEY, and DATABASES variables in
local_settings.py.

My current uwsgi.ini file looks like:

 [uwsgi]
 plugins = python2
 chdir = /srv/http/salixmedia.com/test
 module = salix_site.wsgi
 callable = application
 virtualenv = /srv/http/salixmedia.com/test/pyenv
 master = true
 processes = 4
 socket = /tmp/salix-test.sock
 chmod-socket = 666
 vacuum = true

And when I run 'uwsgi --ini uwsgi.ini', it appears to be finding the
wsgi module, but then when I attempt to visit the site in my browser,
I get this error:

 django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not 
 be empty.

But, as I mentioned above, I did set SECRET_KEY in local_settings.py.
This error suggests that the local settings are not available. So I
tried modifying the local settings import statement in settings.py to
read:

try:
from salix_site.local_settings import *

Then I get a new error:

 django.core.exceptions.ImproperlyConfigured: The included urlconf 
 salix_site.urls doesn't have any patterns in it

Well, I don't know what to make of that. I didn't create any URL
patterns, but my urls.py seems to import the default patterns from
Mezzanine - and anyway, it works fine when I run the site directly
with './manage.py runserver'.

It appears to me that mezzanine is doing some kind of path/package
name manipulation that uWSGI doesn't know about. Any idea what I can
do about this?

--
Matt Gushee

-- 
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] Problem with custom page type

2014-07-05 Thread Matt Gushee
Hello, Mezzanites--

I am new to Mezzanine and Django (though not to Python, fortunately)
... I have worked through the Django and Mezzanine tutorials, and I am
starting to work on a real site.

(BTW, for some reason I was initially planning to build the site with
Drupal. Uergh. Mezzanine is really a breath of fresh air after that.)

One of the key features I want to implement is a kind of shared
workspace for a small group of collaborators (2-3 people at first, and
I'll be surprised if the number ever reaches 20), where people can
share documents and comment on each other's work. I think either a
blog or a forum could be used for this purpose, but neither is quite
right. I think the best thing would be a rich text page with comments.

So I determined to create a 'CommentedPage' type. Oh, and by the way,
I want to use the builtin threaded comments. I know, I know, Disqus.
Sorry, but I really do not want to use Disqus if I can help it.

Anyway, I think I have partially succeeded in implementing the new
page type; I can add a CommentedPage via the admin interface, but when
I try to view the result I get a template rendering error. Here's
what's going on:

1. Created a 'workspace' app.

 I haven't put it into pip-installable form yet, but it lives in a
separate directory. The structure looks like:

 test/
 pyenv/  # virtualenv stuff
 salix_site/# the actual site
 workspace/ # the app
 __init__.py
admin.py
models.py
templates/
workspace/
commentedpage.html
tests.py
views.py

2. Models.py looks like this:

from django.db import models
from mezzanine.pages.models import Page
from mezzanine.core.models import RichText
from mezzanine.generic.fields import CommentsField

   class CommentedPage(Page, RichText):
 comments = CommentsField()

3. Admin.py looks like this:

from django.contrib import admin
from mezzanine.pages.admin import PageAdmin
from .models import CommentedPage

admin.site.register(CommentedPage, PageAdmin)

4. And the template, commentedpage.html looks like this:

{% extends pages/page.html %}

{% load mezzanine_tags comments comment_tags %}

{% block main %}{{ block.super }}

{% editable page.commentedpage.content %}
{{ page.commentedpage.content|richtext_filters|safe }}
{% endeditable %}

{% comments_for page %}

{% endblock %}


When I attempt to view the page, I get:

AttributeError at /junk/my-ahh-commented-page-you-know/

'Page' object has no attribute 'comments'

... and a whole bunch more, but I'm not sure what is relevant.
However, a couple of relevant points:

* According to the Debug Toolbar, the 'commentedpage.html' template is
being called.

* However, the actual error appears to be happening in the builtin
'comments.html' template:

 Error during template rendering

 In template /PATH/TO/templates/generic/includes/comments.html,
error at line 16

... where line 16 reads:

{% comment_thread object_for_comments %}


Can anyone give me a hint as to what is going on here? Thanks!

--
Matt Gushee

-- 
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] Problem with custom page type

2014-07-05 Thread Matt Gushee
Ah! That was it, thank you!

I actually did read the section you mentioned, but evidently hadn't
fully absorbed it. The syntax does seem a bit counterintuitive, since
one normally expects a dotted name to represent an attribute of an
object. Oh, well, at least I've got it working now.

On Sat, Jul 5, 2014 at 10:15 PM, Stephen McDonald st...@jupo.org wrote:
 Hi Matt,

 Have a read here, noting the reference to page.author, as Author is the
 page type:

 http://mezzanine.jupo.org/docs/content-architecture.html#displaying-custom-content-types

 You'll see you probably want something like:

 {% comments_for page.commentpage %}


 On Sun, Jul 6, 2014 at 2:00 PM, Matt Gushee m...@gushee.net wrote:

 Hello, Mezzanites--

 I am new to Mezzanine and Django (though not to Python, fortunately)
 ... I have worked through the Django and Mezzanine tutorials, and I am
 starting to work on a real site.

 (BTW, for some reason I was initially planning to build the site with
 Drupal. Uergh. Mezzanine is really a breath of fresh air after that.)

 One of the key features I want to implement is a kind of shared
 workspace for a small group of collaborators (2-3 people at first, and
 I'll be surprised if the number ever reaches 20), where people can
 share documents and comment on each other's work. I think either a
 blog or a forum could be used for this purpose, but neither is quite
 right. I think the best thing would be a rich text page with comments.

 So I determined to create a 'CommentedPage' type. Oh, and by the way,
 I want to use the builtin threaded comments. I know, I know, Disqus.
 Sorry, but I really do not want to use Disqus if I can help it.

 Anyway, I think I have partially succeeded in implementing the new
 page type; I can add a CommentedPage via the admin interface, but when
 I try to view the result I get a template rendering error. Here's
 what's going on:

 1. Created a 'workspace' app.

  I haven't put it into pip-installable form yet, but it lives in a
 separate directory. The structure looks like:

  test/
  pyenv/  # virtualenv stuff
  salix_site/# the actual site
  workspace/ # the app
  __init__.py
 admin.py
 models.py
 templates/
 workspace/
 commentedpage.html
 tests.py
 views.py

 2. Models.py looks like this:

 from django.db import models
 from mezzanine.pages.models import Page
 from mezzanine.core.models import RichText
 from mezzanine.generic.fields import CommentsField

class CommentedPage(Page, RichText):
  comments = CommentsField()

 3. Admin.py looks like this:

 from django.contrib import admin
 from mezzanine.pages.admin import PageAdmin
 from .models import CommentedPage

 admin.site.register(CommentedPage, PageAdmin)

 4. And the template, commentedpage.html looks like this:

 {% extends pages/page.html %}

 {% load mezzanine_tags comments comment_tags %}

 {% block main %}{{ block.super }}

 {% editable page.commentedpage.content %}
 {{ page.commentedpage.content|richtext_filters|safe }}
 {% endeditable %}

 {% comments_for page %}

 {% endblock %}


 When I attempt to view the page, I get:

 AttributeError at /junk/my-ahh-commented-page-you-know/

 'Page' object has no attribute 'comments'

 ... and a whole bunch more, but I'm not sure what is relevant.
 However, a couple of relevant points:

 * According to the Debug Toolbar, the 'commentedpage.html' template is
 being called.

 * However, the actual error appears to be happening in the builtin
 'comments.html' template:

  Error during template rendering

  In template /PATH/TO/templates/generic/includes/comments.html,
 error at line 16

 ... where line 16 reads:

 {% comment_thread object_for_comments %}


 Can anyone give me a hint as to what is going on here? Thanks!

 --
 Matt Gushee

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


[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 
 slackb...@gmail.comjavascript:
  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 javascript:.
 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: Why is PIL/Pillow not a dependency?

2014-02-12 Thread Matt Stevenson
I can confirm that installing via pip does indeed fail.

However, running `python setup.py install` does successfully append the 
`pillow` requirement: https://dpaste.de/obE1  -- and proceeds to install 
successfully (along with a `python manage.py createdb --install` also 
working fine).

Does pip import `install_requires` from the setup module without executing 
any logic?

On Thursday, 13 February 2014 07:12:54 UTC+11, Eduardo Rivas wrote:

 Hi everyone. Every time I try to create a new project with some initial 
 data I run:

 python manage.py createdb --noinput

 Which fails with the following error:
 django.core.exceptions.ImproperlyConfigured: Neither Pillow nor PIL could 
 be imported: No module named Image

 That is very explicit and simply requires running pip install pillow to 
 get if fixed. However, my questions are: Why is pillow needed during the 
 createdb process? How necessary is it to Mezzanine? Shouldn't it be a 
 dependency? I don't know if I've found a bug, or maybe there's some obvious 
 reason I'm overlooking.



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