Re: [mezzanine-users] Fabric deployment with ALLOWED_HOSTS wildcard issue

2016-10-31 Thread Geoffrey Eisenbarth
Yeah, that fixes the issue. I think I'm more likely to use fully qualified
entries in ALLOWED_HOSTS in most cases so that the illegal hosts check is
left intact, but it's good to know.

Thanks for your help!

On Mon, Oct 31, 2016 at 12:03 PM, Eduardo Rivas 
wrote:

> Yeah, the server name is working, the problem is that nginx is returning a
> 444 (a proprietary error code that means "drop this request altogether"
> https://httpstatuses.com/444). Whether or not a 444 is returned depends
> on a simple match against an ALLOWED_HOSTS regex, and that will not work
> with the dot notation https://github.com/stephenmcd/
> mezzanine/blob/master/mezzanine/project_template/deploy/
> nginx.conf.template#L23-L26
>
> Maybe just comment-out that block and see how it goes? That should disable
> the checks for illegal hosts on nginx and let everything reach Django.
>
>
> --
> 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/to
> pic/mezzanine-users/ElpLcvVVg8w/unsubscribe.
> To unsubscribe from this group and all its topics, 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] Fabric deployment with ALLOWED_HOSTS wildcard issue

2016-10-31 Thread Geoffrey Eisenbarth
Eduardo, 

I'll try to look more into it when I get a chance; I agree it seems to be 
an nginx issue, but it seems confusing as their 
(https://nginx.org/en/docs/http/server_names.html#wildcard_names) say they 
support the dot wildcard:

A special wildcard name in the form “.example.org” can be used to match 
> both the exact name “example.org” and the wildcard name “*.example.org”.
>




On Monday, October 31, 2016 at 11:44:35 AM UTC-5, Eduardo Rivas wrote:
>
> Hi Geoffrey. 
>
> I think your diagnoses is correct: Django supports the wildcard domain 
> syntax, but nginx doesn't. My recommendation would be to be explicit in 
> your ALLOWED_HOSTS (specifying a fully qualified domain name on each 
> entry). It my be worth adding a note stating that in the Deployment 
> section of the docs. 
>
>

-- 
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] Fabric deployment with ALLOWED_HOSTS wildcard issue

2016-10-29 Thread Geoffrey Eisenbarth
I've been investigating a situation where deploying through fabric returns 
a ``ERR_EMPTY_RESPONSE`` on Chrome (haven't tried other browsers). A bit of 
info on my setup and the issue:

   - Two domain names, geoffandkaty.com and everaftereisenbarth.com 
   registered through Google, using Digital Ocean DNS to point to my Digital 
   Ocean droplet (Debian Jessie)
  - Both have A name records @ to my droplet IP address
  - Both have CNAME records * pointing to * (which Digital Ocean filled 
  in as "geoffandkaty.com." and "everaftereisenbarth.com.")
   - Scenario One:
  - If I set ``ALLOWED_HOSTS`` in both settings.py and 
  local-settings.py to ``[".geoffandkaty.com", 
".everaftereisenbarth.com"]`` 
  I get the ``ERR_EMPTY_RESPONSE`` when trying to go to 
  http://www.geoffandkaty.com / http://geoffandkaty.com (and the same for 
  everaftereisenbarth.com).
   - Scenario Two:
  - If I set ``ALLOWED_HOSTS`` in both settings to 
  ``["geoffandkaty.com", "www.geoffandkaty.com", "everaftereisenbarth.com", 
  "www.everaftereisenbarth.com"]``, then everything works fine.
   
I know Django supports ".domain-name.com" syntax, so I initially thought 
that maybe nginx didn't, although I see in their docs 
 that they 
do. I notice in my sites-enabled/wedding.conf file that manually changing 
``server_name`` and the code for denying illegal host headers to the dot 
syntax creates the issue. Perhaps this is an issue with how I have my 
domain names set up on Digital Ocean?

This isn't really a pervasive issue for me anymore as I'm just going with 
the setup in Scenario Two, but I figured I'd make a post here before filing 
an issue on GitHub in case someone can tell me if this is an issue with my 
setup. 

I think the work that @EduaroRivas (not sure if this will tag him in this 
post?) has done on the fabric deployment is amazing, and I'm very grateful 
for it. Figured he might have some insight into this, but if anyone has any 
ideas, I'm all game. 

-- 
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] Why does Fabric deployment name the db user after the project?

2016-07-12 Thread Geoffrey Eisenbarth
Hey Eduardo, thanks for all your help with the Fabric implementation, it's 
been very appreciated! I'll check out your suggestions today, I think using 
fab restore to import my database is the way I should be going. 

On Monday, July 11, 2016 at 8:12:18 PM UTC-5, Eduardo Rivas wrote:
>
> I think the idea is to be consistent and predictable when it comes to 
> naming all things. The project directory, the database user, the 
> database itself, and all configuration files just use the project name 
> as identifier. I'm no security expert but I think that having one DB 
> user per site is safer than a single DB user with access to all site 
> databases. 
>
> In any case, I think you should be able to import the database as the DB 
> user "project_name", it's the owner of all tables as seen here: 
>
> https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/fabfile.py#L494-L501
>  
>
> Also, not sure if it helps but you can backup and restore your database 
> directly from fabric too. 
>
> fab backup:"mybackup.psql" 
> fab restore:"mybackup.psql" 
>
>
> https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/fabfile.py#L347-L367
>  
>
> Hope that helps. 
>

-- 
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] Why does Fabric deployment name the db user after the project?

2016-07-11 Thread Geoffrey Eisenbarth
I'm having some issues with postgre authentication, and I'm curious as to 
what the reasoning was behind the database user being named after the 
project instead of the username given in the Fabric settings dictionary. 
Now I have a password-less database user that doesn't line up with the user 
I created for Fabric deployment, and thus can't use peer and/or md5 
authentication (c.f. pg_hba.conf). 

Perhaps there's something I'm not doing correctly, but this issue is coming 
up when I import a pg_dump .sql file, I can't use ``psql -d project_name -U 
project_name -f dump.sql``, and since I can't import the database as the 
user ``project_name``, there are issues with migration since the psql user 
``project_name`` doesn't own all the tables in the database.

Am I doing something fundamentally wrong here?

Thanks for the input :)

-- 
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: Easy settings for including shipping / tax / quantity?

2016-04-25 Thread Geoffrey Eisenbarth
Joseph,

Thanks for the heads up! Working on implementing these now, very grateful.
I'll chime in later when I have these tested with my setup.

On Mon, Apr 25, 2016 at 7:13 AM, Joseph Mohan <skrupr...@gmail.com> wrote:

> Oh and for the quantiy:
> https://groups.google.com/forum/#!topic/mezzanine-users/7zBENlLbXwE
>
>
> On Monday, 25 April 2016 13:10:56 UTC+1, Joseph Mohan wrote:
>>
>> i'm in the middle of putting something together myself (no tax/shipping)
>>
>> you can set these in settings.py:
>>
>> SHOP_HANDLER_BILLING_SHIPPING = None
>> SHOP_HANDLER_TAX = None
>>
>> And that will remove them from the checkout (and payment)
>>
>> But I still had the problem of removing the billing/shipping form. It
>> feels a bit hacky but I overrid the checkout url to point to a custom view
>> of my own that forced a redirect to the payment stage:
>>
>> url("^shop/checkout/$", myviews.checkout_steps, name="shop_cart"),
>>
>>
>>
>> On Friday, 22 April 2016 14:17:03 UTC+1, Geoffrey Eisenbarth wrote:
>>>
>>> Well, this is embarrassing.
>>>
>>> After digging in a little more, it seems like the default behavior is to
>>> not show the shipping and tax forms in the cart / checkout if the amount is
>>> zero (I have SHOP_DEFAULT_SHIPPING_VALUE = 0 in settings.py), since the
>>> tax/shipping information is shown based on template tags defined in
>>> shop_tags.py as shipping_type, shipping_total, and tax_total. This seems to
>>> work correctly in Internet Explorer (11.0.9600.18282) and Firefox (45.02),
>>> but the "Flat Rate Shipping" and "Tax" entries are still showing up in my
>>> cart and in the order_totals.html template in Chrome (50.0.2661.87 m).
>>>
>>> Still looking for the culprit.
>>>
>>> On Friday, April 22, 2016 at 7:46:37 AM UTC-5, Geoffrey Eisenbarth wrote:
>>>>
>>>> (stephenmcd: thanks for redirecting me here)
>>>>
>>>> I'm using cartridge on a site that doesn't utilize shipping, tax, or
>>>> quantity (electronic subscriptions), and I'm going to implement three
>>>> boolean options into the settings for these situations today. Is there any
>>>> interest in this? Or a way to do this already factored into the code? I
>>>> know you can add custom shipping and tax calculation functions, but I don't
>>>> see how those correspond with the presence of the fields in the various
>>>> forms.
>>>>
>>>> As I see it, this could be easily implemented by just adding a few if
>>>> statements into a few templates. Thoughts / suggestions / disagreements?
>>>>
>>> --
> 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/UxaMRuCUu90/unsubscribe.
> To unsubscribe from this group and all its topics, 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: Easy settings for including shipping / tax / quantity?

2016-04-22 Thread Geoffrey Eisenbarth
Well, this is embarrassing. 

After digging in a little more, it seems like the default behavior is to 
not show the shipping and tax forms in the cart / checkout if the amount is 
zero (I have SHOP_DEFAULT_SHIPPING_VALUE = 0 in settings.py), since the 
tax/shipping information is shown based on template tags defined in 
shop_tags.py as shipping_type, shipping_total, and tax_total. This seems to 
work correctly in Internet Explorer (11.0.9600.18282) and Firefox (45.02), 
but the "Flat Rate Shipping" and "Tax" entries are still showing up in my 
cart and in the order_totals.html template in Chrome (50.0.2661.87 m). 

Still looking for the culprit.

On Friday, April 22, 2016 at 7:46:37 AM UTC-5, Geoffrey Eisenbarth wrote:
>
> (stephenmcd: thanks for redirecting me here)
>
> I'm using cartridge on a site that doesn't utilize shipping, tax, or 
> quantity (electronic subscriptions), and I'm going to implement three 
> boolean options into the settings for these situations today. Is there any 
> interest in this? Or a way to do this already factored into the code? I 
> know you can add custom shipping and tax calculation functions, but I don't 
> see how those correspond with the presence of the fields in the various 
> forms.
>
> As I see it, this could be easily implemented by just adding a few if 
> statements into a few templates. Thoughts / suggestions / disagreements?
>

-- 
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] Easy settings for including shipping / tax / quantity?

2016-04-22 Thread Geoffrey Eisenbarth


(stephenmcd: thanks for redirecting me here)

I'm using cartridge on a site that doesn't utilize shipping, tax, or 
quantity (electronic subscriptions), and I'm going to implement three 
boolean options into the settings for these situations today. Is there any 
interest in this? Or a way to do this already factored into the code? I 
know you can add custom shipping and tax calculation functions, but I don't 
see how those correspond with the presence of the fields in the various 
forms.

As I see it, this could be easily implemented by just adding a few if 
statements into a few templates. Thoughts / suggestions / disagreements?

-- 
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: Cartridge with Stripe and Zebra is swallowing errors?

2016-04-13 Thread Geoffrey Eisenbarth
Yeah, I caught a few glimpses into that while trying to fix my problem. I 
might still dig into it to fix for others (but I'm weary if 
cartridge-stripe will be willing to pull), but this looks promising.  Just 
got it working, hoping to see it'll allow subscriptions and such through 
Zebra (or maybe it can all be done through Stripe's website?)

Thanks so much for pointing me to this, though!

On Wednesday, April 13, 2016 at 10:10:47 AM UTC-5, Ryne Everett wrote:
>
> I had the exact same thoughts until I found out that there is built-in 
> stripe support. It hasn't made a docs release yet, but here's my pr 
> documenting it: https://github.com/stephenmcd/cartridge/pull/284.
>
> On Wed, Apr 13, 2016 at 2:29 PM, Geoffrey Eisenbarth <
> geoffrey@gmail.com > wrote:
>
>> I just got the same errors with Mezzanine 4.1.0, stripe 1.32.0, Cartridge 
>> 0.11.0, and cartridge-stripe 0.1.3. Looks like cartridge-stripe hasn't been 
>> updated in forever, but I'll try to find the issue and make a pull request. 
>> At this point it might have been worth it to just go with Braintree, which 
>> seems to have more active developement wrt mezzanine and cartridge.
>>
>>
>> On Friday, June 7, 2013 at 7:46:50 PM UTC-5, Rob Lineberger wrote:
>>>
>>> The issue was an incompatibility with templates and Django 1.5.1.  Tim 
>>> Watts put in a fix and pushed the code so this issue is fixed.  Thanks for 
>>> the suggestions!
>>>
>>> On Wednesday, June 5, 2013 1:30:52 PM UTC-4, Rob Lineberger wrote:
>>>>
>>>> Still no dice. I started over with a clean virtualenv and installed 
>>>> zebra, cartridge-stripe, and then cartridge. Changed the settings.py file 
>>>> with my stripe dev tokens, then fired up the vanilla install.  When I add 
>>>> a 
>>>> red pony to the cart and checkout, I get the errors:
>>>>
>>>>
>>>>- (Hidden field last_4_digits) This field is required.
>>>>- (Hidden field stripe_token) This field is required.
>>>>
>>>>   According to the Cartridge Change Log, Stripe Integration was added 
>>>> in version 0.7.0 .  Do I need to explicitly install zebra and 
>>>> cartridge-stripe? I am missing a boat somewhere.
>>>>
>>> -- 
>> 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] Re: Cartridge with Stripe and Zebra is swallowing errors?

2016-04-13 Thread Geoffrey Eisenbarth
I just got the same errors with Mezzanine 4.1.0, stripe 1.32.0, Cartridge 
0.11.0, and cartridge-stripe 0.1.3. Looks like cartridge-stripe hasn't been 
updated in forever, but I'll try to find the issue and make a pull request. 
At this point it might have been worth it to just go with Braintree, which 
seems to have more active developement wrt mezzanine and cartridge.


On Friday, June 7, 2013 at 7:46:50 PM UTC-5, Rob Lineberger wrote:
>
> The issue was an incompatibility with templates and Django 1.5.1.  Tim 
> Watts put in a fix and pushed the code so this issue is fixed.  Thanks for 
> the suggestions!
>
> On Wednesday, June 5, 2013 1:30:52 PM UTC-4, Rob Lineberger wrote:
>>
>> Still no dice. I started over with a clean virtualenv and installed 
>> zebra, cartridge-stripe, and then cartridge. Changed the settings.py file 
>> with my stripe dev tokens, then fired up the vanilla install.  When I add a 
>> red pony to the cart and checkout, I get the errors:
>>
>>
>>- (Hidden field last_4_digits) This field is required.
>>- (Hidden field stripe_token) This field is required.
>>
>>   According to the Cartridge Change Log, Stripe Integration was added in 
>> version 0.7.0 .  Do I need to explicitly install zebra and 
>> cartridge-stripe? I am missing a boat somewhere.
>>
>

-- 
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] Check if page has child pages

2016-04-11 Thread Geoffrey Eisenbarth
Did anything like this ever get implemented into mezzanine? I was looking 
to do something similar, add a sidebar in the base.html if the given page 
has children. What was your fix?

On Wednesday, November 11, 2015 at 5:56:20 PM UTC-6, Neum Schmickrath wrote:
>
> Thanks for the reply Danny. The problem with both of those is they expect 
> to be in a recursive "for" loop so I'll get back multiple results depending 
> on how many children there are. I'll go ahead and create my own for now. 
> Just didn't want to be adding something that was already there :)
>
> On Wednesday, November 11, 2015 at 2:04:20 PM UTC-7, Danny S wrote:
>>
>> On 12/11/2015 5:22 AM, Neum Schmickrath wrote: 
>> > I have a layout I'm working on that has a sidebar that displays a 
>> > sub-menu of the child pages of the current page being viewed. On 
>> > category pages I can easily test if there are child categories by 
>> > using {% if child_categories %} and then showing the sidebar. On pages 
>> > is there a similar processor that I'm missing somehow? I don't want to 
>> > display an empty sidebar if there won't be any links there. 
>> > 
>> The navigation menu from the left hand side of Mezzanine default uses 
>> this: 
>>
>>
>> https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/pages/templates/pages/menus/tree.html#L20
>>  
>>
>> page.has_children_in_menu 
>>
>> Would this work? 
>>
>> There's also an attribute "has_children" set on the page in the 
>> page_menu template tag: 
>>
>>
>> https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/pages/templatetags/pages_tags.py#L84
>>  
>>
>> I'm sure both of these might point you in the right direction. 
>>
>> Seeya. Danny. 
>>
>>

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