Re: [mezzanine-users] Error save page.

2023-05-21 Thread Danny

Hi Alice,

This mailing list is no longer used for discussions, please use the 
Discussions feature on Github at 
https://github.com/stephenmcd/mezzanine/discussions


The issue you raise is a known one, although not fixed/released yet: 
https://github.com/stephenmcd/mezzanine/issues/2054


There is an incompatibility between Mezzanine 6.0.0 and Bleach 6.0.0. A 
workaround (as noted in the issue) is to downgrade Bleach in your 
requirements.txt to `bleach<6`


Best of luck,

Seeya. Danny.



On 22/05/2023 12:05 am, Alice Koh wrote:
Hi I am new to Mezzanine. I install Mezzanine 6.0.0. I am not sure if 
it is due to compatibility with django/python or some other issue but 
I cannot do a simple save page as below. Please assist.


Error.jpg
--
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/b4e7216a-09be-4788-8e02-a3d556179df0n%40googlegroups.com 
<https://groups.google.com/d/msgid/mezzanine-users/b4e7216a-09be-4788-8e02-a3d556179df0n%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/57b96b02-3587-0bb5-d70b-977ff2665f71%40gmail.com.


Re: [mezzanine-users] Mandatory authentication for users to access site

2022-11-26 Thread Danny

Some suggestions:

- Check the 'Login required' box on all Pages
- Update your base template to hide any "Sign Up" links
- add ACCOUNTS_APPROVAL_REQUIRED=True to your settings.py
( 
https://mezzanine.readthedocs.io/en/latest/configuration.html#accounts-approval-required 
)
This means that even of someone does sign up without your knowledge, 
you'll have to approve/activate the account manually as admin.
- Add the decorator @login_required to functions in views.py (and use 
these in urls.py as an override of the mezzanine defaults).
 See 
https://docs.djangoproject.com/en/4.1/topics/auth/default/#the-login-required-decorator


This is likely the biggest change, as you'll want to override the 
default Mezzanine blog behaviour so that it uses your URLs/views rather 
than the default ones.


Hope this helps.

Seeya. Danny.


On 24/11/2022 2:15 pm, John Tate wrote:

Hey Mezzanine Community,

I have been using Mezzanine CMS happily for my personal website for 
many years where I post blogs and such, open to the public.


I want to deploy another site on a subdomain where I can post blogs 
much the same but in a private matter, for people invited only. I 
basically intend to start with `pip install mezzanine --user` much 
like my personal site (but as another Linux user account), where most 
details were taken care of for me. I run Mezzanine because it got my 
site running quickly!


I just want to configure it so that a login is required to view any 
pages or blog posts whatsoever. I can't find much on doing this, and 
as far as changing mezzanine goes it is important the solution is the 
simplest one possible.


I also want it so user accounts and passwords to access this site are 
created by myself and myself only. Any registration features need to 
be disabled.


John
--
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/3a07d74a-d2ce-4257-8a62-dffc778d58bdn%40googlegroups.com 
<https://groups.google.com/d/msgid/mezzanine-users/3a07d74a-d2ce-4257-8a62-dffc778d58bdn%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/68a35cea-c2a0-50e4-3fd8-d15ba1ef464a%40gmail.com.


Re: [mezzanine-users] Cartridge v5.0.0-rc.1

2021-10-17 Thread Danny
There's an open pull request from petedermott here which does a lot of the
preliminary work: https://github.com/stephenmcd/cartridge/pull/346

You could potentially look at his fork along with your other changes to get
Cartridge up to date.

(I'm using a highly customised version of Cartridge for my site, but I made
use of Pete's work to update my own repo to get my custom Cartridge working
with Mezzanine 5.0.0-alpha1 and Django 2.2.x)

Hope this helps.

Seeya. Danny.

On Mon, 18 Oct 2021 at 00:10, Joseph Mohan  wrote:

> Is anybody currently working on bringing cartridge inline with mezzanine
> v5.0.0-rc.1
> <https://github.com/stephenmcd/mezzanine/releases/tag/v5.0.0-rc.1>
>
> If not, I'm happy to submit a PR, although having issues following the
> contribution instructions from
> https://github.com/stephenmcd/cartridge#contributing
>
> I'm unable to run:
>
> python setup.py develop
>
> And install the current master branch of mezzanine. I've tried changing
> cartridge/project_template/requirements.txt to
>
> Mezzanine==5.0.0a1 and Mezzanine==.dev0
>
> But I'm not really sure what I'm doing here (out of touch with python
> package management). Do I even need to bother with this step? The changes
> are all pretty simple import changes.
>
> BTW My changes in cartridge are working with the current master branch of
> mezzanine installed by :
>
> pip install git+https://github.com/stephenmcd/mezzanine
>
> Is this also correct?
>
> Not actually contributed to a public project before so forgive me if
> there's follow up questions I apoligise in advance.
>
> Joe
>
> --
> 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/f1dda0e3-842f-493f-8155-2c038362c099n%40googlegroups.com
> <https://groups.google.com/d/msgid/mezzanine-users/f1dda0e3-842f-493f-8155-2c038362c099n%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/CAKyDYnfzB8oZMJy6f59tY42E10uqM0ORt%3DFFiJaHwLDvGB2zjA%40mail.gmail.com.


Re: [mezzanine-users] cartridge list all products

2021-05-28 Thread Danny

On 29/05/2021 1:28 am, Ken Bolton wrote:



On Fri, May 28, 2021 at 4:56 AM ek ekke <mailto:ekk...@gmail.com>> wrote:


I am trying to list all products from cartridge, is that function
all ready in there and how can i call it from a template?
Don't want to write the view if it's all ready in there somewhere.


Check out the `Category` module, which is a subclass of Mezzanine's 
`Page`.


Simplest way is

Product.objects.all()

To get that in a template, you might need to write a template tag, e.g. 
I added something to my Orders Change List template so that I could 
filter orders by a specific product (and export the results to CSV). The 
basics are:


In admin.py (or forms.py):

def get_all_products():
    return [(p.id, p.title) for p in 
Product.objects.all().order_by('title')]


class OrderByProductForm(forms.Form):
    product = forms.ChoiceField(label="Export filtered orders containing",
    choices=[])

    def __init__(self, *args, **kwargs):
    super(OrderByProductForm, self).__init__(*args, **kwargs)
    self.fields["product"].widget = 
forms.Select(choices=get_all_products())


templatetags/myapp_tags.py:

@register.simple_tag
def export_order_by_product_form(request):
    querystring = request.GET.dict()
    return OrderByProductForm(queries=querystring)

And then in templates/admin/order_change_list.html:

{% extends "admin/change_list.html" %}
{% load admin_urls myapp_tags %}

{% block object-tools-items %}


   {% export_order_by_product_form request %}
   

{{ block.super }}
{% endblock %}

Note then i have also defined a view for "order_export" which uses the 
selected Form item to find the right orders and export them to CSV.


Hope this helps.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/08b321ba-261e-dea9-1866-c4d9dcdd84f1%40gmail.com.


[mezzanine-users] Re: Admin action drop-down 'required' preventing saving updates

2021-02-18 Thread Danny

Hi again everyone,

I think I finally got to the bottom of my problem.

The Select widget  used for this admin dropdown *does* have the 
'required' attribute by default, but there's Mezzanine javascript that 
removes this from this specific location in admin pages:


https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/static/mezzanine/js/admin/navigation.js#L6

In my case, the problem was that my website was hitting a Javascript 
error earlier on and thus this line wasn't executing properly or being 
skipped entirely. Part of this was that I had an old set of javascript 
files etc in 'static' on my webserver leftover from using Mezzanine 4.3.


Among other things,  I was missing the new jQuery version used by 
Mezzanine 5.0.0a1 and when I checked the developer console in my browser 
I could see a bunch of JS errors.


I manually ran python manage.py collectstatic, restarted the server, and 
now things appear to be working as expected.


So a word of advice for anyone else hitting similar upgrade issues: 
check the developer console in your browser for javascript errors, and 
make sure you have run collectstatic when you deploy!


Seeya. Danny.

On 18/02/2021 4:30 pm, Danny wrote:


Hi all,

This is possibly a Django-2.2.18 related problem, but I thought I'd 
see if anyone else has experienced this and had a workaround.


I recently updated my website to Mezzanine 5.0.0a1 and Django 2.2.18, 
and after some reasonably thorough local testing, deployed it to the 
live website.


One of my fellow admins discovered something odd, which I've now 
confirmed on both local and deployed sites.


At the top of an Admin change list page, there's the standard action 
drop down (usually containing 'Delete selected '). This is 
useful when you want to select some objects and delete them, but 
otherwise I've not customised it for any of the standard 
Mezzanine/Cartridge models I use.


What's now odd is that if you hit the 'Save' button at the bottom of 
the object list, a generic prompt pops up saying 'Please select an 
item in the list' pointing to this action drop down.


After some research, I discovered the following:

a) this pop up message is generic from HTML5, for a  form 
element that has the 'required' attribute: 
https://www.w3schools.com/TAGS/att_select_required.asp


b) this 'required' attribute is being added to the  element 
when the page is rendered, but only when DEBUG=False. That is, on my 
local development with DEBUG=True, the select element is not required 
(and Save works fine), but if I modify my local settings and set 
DEBUG=False, then required is forced on this element, and I get the 
same pop up as seen on the deployed server.


I've tried digging into the Django code to try and find out what's 
happening to render this field, but it seems to be fairly benign:


grapelli-safe template that renders the action drop down: 
https://github.com/stephenmcd/grappelli-safe/blob/master/grappelli_safe/templates/admin/actions.html#L3


django code that is the action form: 
https://github.com/django/django/blob/2.2.18/django/contrib/admin/helpers.py#L20


I'm not sure where the ChoiceField is being forced to required=True 
when DEBUG=False, nor how I can override this.


Any one got any ideas? Have you noticed this on your own deployments 
using Mezzanine 5.0.0a1?


Thanks for any help,

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/38160e1e-093b-92e1-89c3-070fb1d77c51%40gmail.com.


[mezzanine-users] Admin action drop-down 'required' preventing saving updates

2021-02-17 Thread Danny

Hi all,

This is possibly a Django-2.2.18 related problem, but I thought I'd see 
if anyone else has experienced this and had a workaround.


I recently updated my website to Mezzanine 5.0.0a1 and Django 2.2.18, 
and after some reasonably thorough local testing, deployed it to the 
live website.


One of my fellow admins discovered something odd, which I've now 
confirmed on both local and deployed sites.


At the top of an Admin change list page, there's the standard action 
drop down (usually containing 'Delete selected '). This is 
useful when you want to select some objects and delete them, but 
otherwise I've not customised it for any of the standard 
Mezzanine/Cartridge models I use.


What's now odd is that if you hit the 'Save' button at the bottom of the 
object list, a generic prompt pops up saying 'Please select an item in 
the list' pointing to this action drop down.


After some research, I discovered the following:

a) this pop up message is generic from HTML5, for a  form 
element that has the 'required' attribute: 
https://www.w3schools.com/TAGS/att_select_required.asp


b) this 'required' attribute is being added to the  element when 
the page is rendered, but only when DEBUG=False. That is, on my local 
development with DEBUG=True, the select element is not required (and 
Save works fine), but if I modify my local settings and set DEBUG=False, 
then required is forced on this element, and I get the same pop up as 
seen on the deployed server.


I've tried digging into the Django code to try and find out what's 
happening to render this field, but it seems to be fairly benign:


grapelli-safe template that renders the action drop down: 
https://github.com/stephenmcd/grappelli-safe/blob/master/grappelli_safe/templates/admin/actions.html#L3


django code that is the action form: 
https://github.com/django/django/blob/2.2.18/django/contrib/admin/helpers.py#L20


I'm not sure where the ChoiceField is being forced to required=True when 
DEBUG=False, nor how I can override this.


Any one got any ideas? Have you noticed this on your own deployments 
using Mezzanine 5.0.0a1?


Thanks for any help,

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/a46283a7-99de-02ad-628f-26b80459403b%40gmail.com.


Re: [mezzanine-users] Promotion from test.domain.com to www.domain.com

2020-03-06 Thread Danny

On 7/03/2020 2:14 am, James Morse wrote:

Greetings all,
I set up my first Mezzanine site for my wife to work on as 
test.domain.com with the intent of that being temporary. This was so 
her old static HTML "production" site wasn't affected until she was 
done.  Last night she finally finished the site and asked me to 
"launch it". I pointed her @ record and www.domain.com to the new 
server IP hosting the Mezzanine setup and after fixing the cert, I was 
surprised to see the base template site/theme without any of the 
content she worked on.  After searching similar but not identical 
scenarios, I now see that Mezzanine instantiates itself for each 
subdomain.  Is there some way to point all her subdomains to the 
content she's already worked so hard on?  If not, then is there 
perhaps a way to migrate the test.domain.com site content to the @ or 
www. subdomain "new" site?  I've seen the responses that reference 
using Nginx or similar to redirect all to x.domain.com but in this 
case I, of course, don't want her customers being redirected to 
"test.domain.com", so I need a different solution.

Thanks for your time and any help you can provide!


Have you logged into the admin, and updated the default 'Site' to the 
'www.domain.com'?  Mezzanine associates each page with a 'Site' so you 
can serve multiple subdomains with the same database and django instance 
- and the URL is used for this when not in test mode.


(Basically, go to www.domain.com/admin/sites/site/ and make sure that's 
correct - if not, edit it)


Does that help?

I have done this before to change a test.domain.com to a 
live.domain.com, and it seemed to work ok. The other option you can try 
is to just set it to domain.com.


There might be someone else with more Mezzanine knowledge than me who 
can help, but I think this the best place to start checking, especially 
if the test domain is still working.


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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/f81ff661-c016-4bc7-1ba7-d2fa45bcd742%40gmail.com.


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

2020-02-18 Thread Danny
Hi,

I do make use of a (modified version) of the included fabfile. However, I'm
using Python 3.6 on my dev and server machines, and use Fabric3 to do the
deployment. It works pretty well.
If this could be the supported version for Python3, that would be great.

Seeya. Danny.

On Wed, 19 Feb 2020 at 12:46, Mike Dewhirst  wrote:

> Ed
>
> I really appreciate your work and love Mezzanine and Fabric.
>
> I would like to see the fabfile kept in Mezzanine and enhanced slightly
> by removing repo specifics to make it repo-agnostic.
>
> I use and support a number of Subversion repos. I have done this for
> more than a decade and although I have occasionally tried, I don't have
> the brainspace or need for Git (or Hg) as well as svn. Occasionally I'm
> forced to use it so I have to resort to googling Git recipes. It isn't
> pleasant and I always need a stiff whisky afterwards.
>
> I once enhanced the fabfile to work with svn and was about to contribute
> it back to the project when a new release came out. That meant I needed
> to redo the work and I never did find the time to do it again. Since
> then I have been muddling along manually and my Mezz work has gradually
> diminished.
>
> I'd be happy to contribute to any svn stuff and test it.
>
> Cheers
>
> Mike
>
> On 19/02/2020 12: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
> > <https://github.com/stephenmcd/mezzanine/issues/1957> 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
> > <mailto: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
> > <
> https://groups.google.com/d/msgid/mezzanine-users/02b090b5-2d83-485d-aee3-f5997da14844%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/ab47f973-5e3d-9c91-5eb8-613279cbd147%40dewhirst.com.au
> .
>

-- 
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/CAKyDYnc2Se%3DnWYOuotzFrAx-Zf1%3D8m7N%3DcXr8r%2BMCtHgyJoRAg%40mail.gmail.com.


Re: [mezzanine-users] Compatibility with Django 2.2

2019-07-02 Thread Danny

Hi Jeff,

I'm kind of in the same boat - although my site is on Django 1.11 and I 
could probably leave it there, although there's some 2.x features I'd 
like to use.


To be honest, I'd recommend attempting No. 2) (fork and attempt to 
upgrade it yourself) - and yes, if your changes aren't going to break 
too many backwards compatibility things, a pull request when you're done 
may be useful.


Inspired by your post, I made a quick start on this yesterday, with 
mezzanine and cartridge, and after about 5 small fixes (and a bit of 
research), managed to get past the initial "createdb" step of setup. 
I've not pushed my changes back to my forks yet, but it wasn't too much 
effort to get this far. I'll summarise the changes below to get you 
started. There's probably more things to do based on actual operation of 
Mezzanine, but this should be enough to at least generate a new test site.


Hopefully with a number of people working on this we can support Django 
2.2 without also breaking Django 1.11 compatibility... A tricky task, no 
doubt!


Seeya. Danny.


Mezzanine changes:

core/templatetags/mezzanine_tags.py

TOKEN_BLOCK, TOKEN_COMMENT, TOKEN_VAR and TOKEN_TEXT are no longer 
members of django.template.base. Instead, import TokenType and replace 
the references with TokenType.BLOCK, TokenType.COMMENT etc.


project_template/project_name/settings.py

django.contrib.messages must be added to INSTALLED_APPS


Cartridge changes:

shop/models.py

Replace @models.permalink decorator on get_absolute_url() with using 
reverse inside the method, i.e.

    def get_absolute_url(self):
    return reverse("shop_product", args=(self.slug,))

project_template/settings.py

Remove django.contrib.auth.middleware.SessionAuthenticationMiddleware 
from list of middlewares. It's no longer required from Django 1.10 and 
has been removed in Django 2.0 (see 
https://docs.djangoproject.com/en/2.2/releases/2.0/#miscellaneous)


django.contrib.messages must be added to INSTALLED_APPS

shop/views.py

Replace from django.core.urlresolvers import reverse with from 
django.urls import reverse





On 18/06/2019 2:55 am, Jeff wrote:
I have recently created a related issue on github but didn't receive 
any response (https://github.com/stephenmcd/mezzanine/issues/1928). 
Basically Mezzanine compatibility with Django 2 is limited to 2.0 
which is no longer supported. Moreover that compatibility is not fully 
tested.


I need to upgrade a legacy site which is based on Mezzanine 3.4.1 and 
Django 1.8. Ideally we would like to upgrade to Django 2.2 because 
it's an LTS version and we could stay on that until April 2022.


There are a few options but I'm lacking information to make a good 
decision:


 1. wait until Mezzanine officially supports Django 2.2, but I have no
idea when or if that will happen. It seems to me, that at the
current pace it won't happen this year. (It's not a negative
judgement, I'm very grateful for being able to use a free and
mature CMS for many years on so many site!). Do you have any
roadmap or even some approximate schedule?
 2. fork Mezzanine and upgrade things myself but with a prioritisation
based on the need of my site. Hopefully I'd be able to contribute
back to the main repo. However I have no idea how much work would
be involved? Is it a 2 day job or a 2 week job? Do you have any
sense of how much work would is left, which Mezzanine components
need to be worked on for 2.2 compatibility?
 3. automate the migration of the content to another CMS, that would
be more sustainable but would also require quite a lot of
development. This is my least favourite option (because I can't
think of a better Django-CMS for my particular needs) but at least
I can accurately assess the development effort and time-frame.

Thanks in advance for any piece of information that could help me and 
my team better evaluate the situation.


Geoffroy

--
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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/72720423-ef8e-4e0e-982e-b39e555d27d4%40googlegroups.com 
<https://groups.google.com/d/msgid/mezzanine-users/72720423-ef8e-4e0e-982e-b39e555d27d4%40googlegroups.com?utm_medium=email_source=footer>.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mezzanine-users/961bfae8-8340-b139-cc

[mezzanine-users] Store credit / gift vouchers

2019-04-28 Thread Danny
Hi all,

I was just wondering if anyone had already done something that could add a
store credit or gift voucher feature to Cartridge?

The discount code system doesn't quite seem to work, as it's more about
providing a specific discount ($ or percentage) on a per-item basis, with
potentially a limit on the number of orders it can be used with.

This is different to a gift voucher or store credit which has a set amount
to start with, but whoever uses it then makes a purchase and has the amount
of their cart applied against the credit/voucher, which may go one of a few
ways:

a) cart total is less or equal to remaining credit --> amount to pay
becomes 0, and the credit is reduced by the cart total.
b) cart total is more than remaining credit -> amount to pay is discounted
by credit amount, credit is reduced to 0, and remaining amount should be
paid as part of checkout.

In this way, the credit/voucher can be a 'discount' the same as a discount
is. it's just the way it's applied that is different.

So... has anyone done something like this - or if not, are there things I'm
missing about it?

I'm considering implementing this in my fork of cartridge using a variant
of the discount code model - which I've already modified for my own
purposes - so that a code can be used per item, per order, or as a 'credit'
system. I think this is probably easier than creating an entirely new model
for the store credit idea.

Thanks for any input or insight you folks can give!

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.


Re: [mezzanine-users] How to resize image on upload ?

2018-11-24 Thread Danny

On 25/11/2018 3:43 am, Nicolas Pinault wrote:



Hi,

Le 14/10/2018 à 02:33, Danny a écrit :

On 13/10/2018 11:41 PM, 3...@drpi.fr wrote:

Hi,

When uploading images in blog post or in media library, I get an 
error saying the file size is too big.
I don't want to modify the file size limit, my images come from a 
DSLR generating big files.
What I'd like, this is to be able to resize uploaded images 
automatically.

I this possible ?


How would this work? In order for the server to do the resizing 
(which I guess is what you want, as that's where Pillow is 
installed), you'd have to upload the full file, and then allow the 
server to resize it - in which case, you're uploading the large file 
anyway, so you'd have to remove the file size limit to allow 
grapelli to upload that size file.


If you want to resize the file locally before uploading - why would 
this be a feature of Mezzanine, which is server-based? Can't you 
just resize the pictures yourself using any photo app on your local 
computer/device, and then do the upload?

There are 3 ways of doing the resize :
1) Server side. I have to authorize bigger files to be uploaded. 
Then, how do I resize the image ?


It looks like this is the best option.
So, how do I resize the image when it is uploaded ? 


Use Pillow to do the resizing (https://pillow.readthedocs.io/en/5.3.x/ 
)  but I'm not sure where in the Mezzanine code to put this - possibly 
as part of a filebrowser or grapelli fork?




--
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] How to resize image on upload ?

2018-10-13 Thread Danny

On 13/10/2018 11:41 PM, 3...@drpi.fr wrote:

Hi,

When uploading images in blog post or in media library, I get an error 
saying the file size is too big.
I don't want to modify the file size limit, my images come from a DSLR 
generating big files.

What I'd like, this is to be able to resize uploaded images automatically.
I this possible ?


How would this work? In order for the server to do the resizing (which I 
guess is what you want, as that's where Pillow is installed), you'd have 
to upload the full file, and then allow the server to resize it - in 
which case, you're uploading the large file anyway, so you'd have to 
remove the file size limit to allow grapelli to upload that size file.


If you want to resize the file locally before uploading - why would this 
be a feature of Mezzanine, which is server-based? Can't you just resize 
the pictures yourself using any photo app on your local computer/device, 
and then do the upload?


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.


Re: [mezzanine-users] Do not send a email, what's the problem?

2018-08-03 Thread Danny

On 2/08/2018 3:49 AM, Eugeniu Rotari wrote:

Hi

I probably missed something or do't understand ...
I see an email in the server logs, but does not come to the mail.
How to be? Help PLZ!!!

Have you set up the EMAIL_HOST, EMAIL_PORT, EMAIL_HOST_USER and 
EMAIL_HOST_PASSWORD settings?


https://docs.djangoproject.com/en/2.0/topics/email/

If you're not running a local SMTP server, you'll need to connect to a 
remote one.
All of my website's emails are sent via a Sendgrid account ( 
https://sendgrid.com ) which is free/good if your website is fairly low 
volume when it comes to sending email.


Hope this helps,

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.


Re: [mezzanine-users] Need to have the same page in multiple locations in the page tree, how link them?

2018-02-08 Thread Danny

On 8/02/2018 9:18 PM, Roger van Schie wrote:

Hi Everyone

I have a use case where the client basically wants a rich text field 
page to write about a certain product, but this product falls under 
different categories. Each category is higher up in the branch 
hierarchy, and they want that same page(the rich text field page) to 
be displayed in multiple categories.


My current thinking is to just create a custom page model that has a 
foreign key to the other page and put that in the page tree. Would 
this be the best approach?


An easier way to do it is to have the actual page at one place in the 
hierarchy, and then use a 'Link' page elsewhere to automatically go to 
this page. I've done this before, no troubles.


It will mean that when viewing the page it will always just have the one 
breadcrumb trail, but it will still be available from two places within 
the navigation menus.


Seeya. Dnany.

--
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] Other staff users unable to see old blog posts?

2018-01-05 Thread Danny

Hi all,

I've just discovered that other Staff users can't see any of the blog 
posts I've created (as superuser) over the past year in the admin. They 
have the correct permissions to add/edit/delete blog posts, and can 
definitely do so, but any past entries are not visible to them at all. 
I've even tested this myself with a different account with the same 
permissions as these other staff users.


Is this by design? i.e. that staff users can only see their own created 
blog posts? Or have I got something wrong in my setup?


Thanks,

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.


Re: [mezzanine-users] Case insensitive username login

2017-11-05 Thread Danny

On 5/11/2017 1:24 PM, Chris Hawes wrote:


I'm wondering if there is a reason 
|mezzanine.core.auth_backends.MezzanineBackend| doesn't support 
case-insensitive usernames for logging in? 
|mezzanine.accounts.forms.ProfileForm| enforces case-insensitive 
username uniqueness when registering, so it seems like it would be 
natural to allow them for logging in. It feels to me like a bug that 
it doesn't.



I bring this up because I've had users of my site write to me 
bewildered that they can't log in, and then it turns out they had 
capitalization in their username and just assumed that it wouldn't 
matter, as is the case on other sites.



If others do not agree that it is a bug, perhaps adding a setting for 
this would be appropriate. In any case I would be happy to work on a 
PR if there is agreement on a change.




I've certainly had the case where users have contacted me because they'd 
put some capitalisation in their original signup email address and then 
tried to log in using it in all lowercase -- and in the case of email 
addresses, case is DEFINITELY not important - so I don't know why it 
seems to be for the Mezzanine/Django login.


So if usernames are also not case sensitive, we should definitely fix it 
for both.


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.


Re: [mezzanine-users] How to setup a contact service?

2017-09-24 Thread Danny
On 25 September 2017 at 07:59, jenia mtl <jenia.iv...@gmail.com> wrote:

> Hello.
>
> How do I setup a contact service?
>

> Right now I get this error:
>
>POST /contact/ HTTP/1.1" 500 118061
>
>
> Do I need to implement the view myself that will be sending the email? Or
> is there a Django app for this?
>

Hi Jenia,

Do you mean a web form that people can fill in and send information to you?

Just create a Form page in your page hierarchy. If you've set up the
EMAIL_* related setting fields correctly, and your server can send email,
you can easily get the form contents emailed to you.

Mezzanine's default models/views make use of the Django SMTP backend to
send email. You will need to set up the appropriate fields in your settings:
https://docs.djangoproject.com/en/1.11/topics/email/#smtp-backend

You can use a local SMTP server, or sign up for one of the online ones that
allow you to post email messages via https, such as https://sendgrid.com

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.


Re: [mezzanine-users] Where is the login page?

2017-09-24 Thread Danny
Hi Jenia,

Cartridge and Mezzanine use the mezzanine.accounts app for public user
login.

See: http://mezzanine.jupo.org/docs/user-accounts.html

Note that if you create a Profile model that contains address fields that
match what the Cartridge checkout form wants, the checkout process will try
and copy those fields into the checkout form (see
https://github.com/stephenmcd/cartridge/blob/master/cartridge/shop/checkout.py#L118
)
This is quite a handy feature. The fields in the user profile should be
named "street", "city", "state", "postcode", "country" and "phone".

Accessing the user's profile is the same as it is in mezzanine, through the
/accounts/update/ URL.

Hope this helps,

Seeya. Danny.




On 25 September 2017 at 08:04, jenia mtl <jenia.iv...@gmail.com> wrote:

> Hello.
>
>
> I can't find the login page in Cartridge.
>
> For example, when the user wants to rate a product, they need to login.
>
> There should be some login functionality I suppose.
>
> Is it this: admin/login/?next=/admin/?
>
> If so, how do I set the button there at the bottom to be "Site" by default
> instead of "Admin".
>
> Should I create my own login page for that?
>
> And finally, how do users register? How do I differentiate users from
> admins?
>
>
> 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.
>

-- 
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, how can the user view their purchasing history?

2017-09-24 Thread Danny
On 25 September 2017 at 08:17, jenia mtl <jenia.iv...@gmail.com> wrote:

> Hello.
>
> How do I create the purchasing history page?
>

I just added this to my urls.py:

url("^account/orders/$", order_history, name="shop_order_history"),
(after including cartridge.shop.urls)

Then the history is at yoursite.com/account/orders/

You can create a Link in the page hierarchy that points to this URL so
people can see their order.

The template is here:
https://github.com/stephenmcd/cartridge/blob/master/cartridge/shop/templates/shop/order_history.html

So you can override what it contains by creating
yourapp/templates/shop/order_history.html

Customising this per user may depend on you adding specific stuff to the
template that reads fields of the current user's model object and working
things out that way (which you can probably do in a template tag if you
like, read up on Django template tags:
https://docs.djangoproject.com/en/1.11/howto/custom-template-tags/ )

Hope this helps.

Seeya. Danny.




>
> I suppose I'll need to create something along these lines:
>
> http://mezzanine.jupo.org/docs/content-architecture.
> html#creating-custom-content-types?
>
> But how can I make it display something different for each user? How do I
> customize it per user?
>


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

-- 
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] Redirect 301 NON www TO www

2017-09-04 Thread Danny

On 5/09/2017 12:35 AM, Matic Noč wrote:

All the changes I have done so far were in templates od deploy. I think I will 
just put www domain in DOMAINS and in nginx template make another server with 
non www domain which redirects to www domain:)

To do the redirect in nginx, you just need something like this in your 
project/deploy/nginx.conf template:


# redirect all requests on www subdomain to root domain
server {
    listen 80;
    server_name www.example.com;

    add_header Strict-Transport-Security "max-age=63072000; 
includeSubdomains; preload";

    add_header X-Frame-Options SAMEORIGIN;
    add_header X-Content-Type-Options nosniff;

    return 301 $scheme://example.com/$request_uri;
}

Of course, replace example.com with your domain name. (and add the 
necessary SSL lines if you want to redirect https://www.example.com to 
https://example.com)


Underneath this in the config, you can just have another server {} block 
to describe the example.com domain and push requests through to 
Django/Mezzanine.


If you're using fabric to deploy, then changing the template on your 
development machine should be enough, and a fab deploy will transfer 
these changes

across to your production server.

If you want to double check, be sure to log into the production server 
and have a look in /etc/nginx/sites-enabled and make sure that there's a 
conf file there that matches your template.


If it still appears to not be working, make sure that nginx has been 
restarted:

%> sudo service nginx restart

Or just reboot your production server.

Hope this helps,

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.


Re: [mezzanine-users] creating a page with a custom, or multiple, rich text fields

2017-03-13 Thread Danny
You can use something like Mezzanine Blocks
https://github.com/renyi/mezzanine-blocks to insert various "blocks" within
a page (nb not a Page, as such).
The blocks can be added to pages by a specific template tag and then you
treat each block as if it were its own Rich Text (or other) page, kind of.
Have a read of the readme file at that link.

There are other similar packages out there too.

Seeya. Danny.

On 14 March 2017 at 09:27, <mich...@mozillafoundation.org> wrote:

> I've read through the docs but I'm still not clear on how I can create a
> page with multiple rich text fields. I've tried
>
> from django.db import models
> from mezzanine.pages.models import Page, RichText
>
> class Club(Page, RichText):
> club_description = RichText("club description")
> # ...
>
> and then an admin.py with:
>
> from copy import deepcopy
> from django.contrib import admin
> from mezzanine.pages.admin import PageAdmin
> from .models import Club
>
> club_extra_fieldsets = (
> (None, {
> "fields": (
> "club_description",
> "...",
> )
> }),
> )
>
> class ClubAdmin(PageAdmin):
> inlines = ()
> fieldsets = deepcopy(PageAdmin.fieldsets) + club_extra_fieldsets
>
> admin.site.register(Club, ClubAdmin)
>
> But this does not give a rich text field when I hit up the admin and
> create a new "Club" page. Instead it errors out with a message that
> "club_description" is an unknown field. Is there any documentation on how
> to add multiple (or even one) rich text field to a page?
>
> -- Mike "Pomax" Kamermans
>
>
> --
> 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] displayable_link.js is not generated - development server

2017-01-26 Thread Danny

Hi Lucas,

I've also just noticed that the "Link List" feature is no longer working 
as of Mezzanine 4.2.2 (on either the admin side or the front end) and is 
still broken at HEAD.
It appears to be some ordering error with regards to when 
tinymce_setup.js is executed vs when the scripts in admin/base_site.html 
or editable_loader.html are parsed to set up the window.__link_list_url 
variable.


I've opened this issue: https://github.com/stephenmcd/mezzanine/issues/1728

However, Javascript is not my forte, so debugging this is a little 
beyond me. Hopefully someone else can assist.


[BTW, if you're worried about displayable_links.js not being generated 
properly, just visit admin/displayable_links.js directly - and if it 
returns you a lovely structure of links, then that isn't your issue.]


Best of luck,

Seeya. Danny.

On 25/01/2017 7:32 AM, Lucas Corso wrote:


Hello, I have more or less the same problem that Danny presents at:

--> 
https://groups.google.com/forum/#!searchin/mezzanine-users/displayable_links.js|sort:relevance/mezzanine-users/6ZgJtRF9VWk/6cR6p0cnAwAJ



In my case I'm running mezzanine on a development server, at first I 
thought it was some missing package, but then I realized that the 
problem was that displayable_link.js was not being generated when I 
clicked the link button on the panel Tools to publish.





<https://lh3.googleusercontent.com/-xJPQhfn95Fs/WIe-Y2DWnsI/AA0/4oXksV97trY6Iyyp_fawC5-6FKiwwBEnwCLcB/s1600/1.png>

What has worked so far is what clarifies Danny to delete templates / 
admin / base_site.html and if it works



<https://lh3.googleusercontent.com/-A0jOffWzUxU/WIe_kp2xY0I/AA8/cXB-dUmn16McVDb7IeN7FE395gpJ1c76wCLcB/s1600/2.png>

But some styles are lost in the administration site


<https://lh3.googleusercontent.com/-1l3NeW4-YgU/WIe_7Ya-rtI/ABA/3itvXt0JijEbUwg0iR_Rn19CtwzxaYQrQCLcB/s1600/3.png>

Compared to the normal style

<https://lh3.googleusercontent.com/-xt1RI2MmRJ0/WIfAUwSH0UI/ABE/GM1c6auKY5UOLgfVXy-vL82YzABvhN4EACLcB/s1600/4.png>

What could I do to fix it? Thanks for reading...




--
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 
<mailto: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] Is there a way to remove comments/ratings from everywhere?

2016-12-11 Thread Danny
Hi Matt,

The way I did it was to comment out/remove the sections of the templates
that dealt with comments in my customised templates.

So comments are still supported within the code base, but an end user can't
see them at all.

Hope this helps.

Seeya. Danny.

On 12 December 2016 at 07:03, Matt <mg.galli...@gmail.com> wrote:

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



-- 
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* -
http://ausdwcon.org
"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

-- 
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] TEMPLATE_ACCESSIBLE_SETTINGS

2016-11-11 Thread Danny

What you've got looks pretty good to me - I have something very similar.

It should be in defaults.py inside an app inside your project. The only 
difference with mine is that the TEMPLATE_ACCESSIBLE_SETTINGS call is at 
the bottom of the list, i.e. after the other settings have been registered.


Hope this helps.

Seeya. Danny.

On 11/11/2016 11:05 PM, JM M wrote:
Hi I'm having trouble showing up the settings for the social media 
here is the code, tried searching but no luck I read the comments 
below of the blog post but still don't work. Anyone want to help? thanks.

from mezzanine.confimport register_setting
from django.utils.translationimport ugettext_lazyas _

register_setting(
 name="TEMPLATE_ACCESSIBLE_SETTINGS", append=True, default=("SOCIAL_LINK_FACEBOOK", 
"SOCIAL_LINK_TWITTER", "SOCIAL_LINK_VIMEO"), )

register_setting(
 name="SOCIAL_LINK_FACEBOOK", label=_("Facebook link"), description=_("If present a Facebook icon 
linking here will be in the " "header."), editable=True, default="https://facebook.com/mezzatheme;, )

register_setting(
 name="SOCIAL_LINK_TWITTER", label=_("Twitter link"), description=_("If present a Twitter icon 
linking here will be in the " "header."), editable=True, default="https://twitter.com/mezzatheme;, )

register_setting(
 name="SOCIAL_LINK_VIMEO", label=_("VIMEO link"), description=_("If present a VIMEO icon linking 
here will be in the " "header."), editable=True, default="https://VIMEO.com/mezzatheme;, )

--
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 
<mailto: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] Cartrige custom shipping by country

2016-11-04 Thread Danny

On 5/11/2016 4:18 AM, Akhlaq Rao wrote:

Hello Danny,

I am not seeing these options when creating a variation, all I see the 
colour and size, do you now how do I enable these variations?


- Product Variations now have weight, and boolean "pickup 
available"/"shipping available" options


Thanks,
Akhlaq



In my ProductVariation  model, I've added these as fields. They are not 
product options (which is what colour/size are in the default settings).
When you edit the details on a variation, you can add things like price, 
sale price etc; What I've done is add weight, pickup available and 
shipping available as other fields there.


https://gist.github.com/molokov/36ab544df43efb224719d300761612a4#file-models-py-L8

If all you want to do is add shipping rules based on country, you don't 
need these fields - I just have them because we sell some items that are 
"virtual"
(e.g. tickets) that have no weight; and we have other items that can 
only be picked up (and never shipped).


Seeya. Danny.




On Thu, Nov 3, 2016 7:31 PM, Danny molo...@gmail.com 
<mailto:molo...@gmail.com> wrote:


On 4/11/2016 5:31 AM, akos1234 wrote:

Hello everyone,

I am trying to attempt to create the shipping for my site.

I was looking at this post -


http://mezzanine-users.narkive.com/AOk7Y6Kl/cartrige-custom-shipping-by-country-and-product-category

which I thought was at the right track. I need to set shipping
cost for countries as well as different cost for quantity.

If more than 5 items bought, the calculation of shipping would
cost more than one item.

However, Melvyn Sopacua

*su*ggested something I did not quiet understand.

here as quoted -

If this is the extent of your shipping rules, you may get away
with this
approach. From experience with other shopping carts, I highly
suggest you
implement a rule-based approach as opposed to a property approach.
Approach like an email filter:
- You define a state formulated by a set of conditions
- Which result in one or more actions
- And has post-processing flags, like "stop further rule
processing if used"

The implementation is more complex, but the resulting flexibility
is worth it
and much of the code can be reused for different types of
business logic, like
follow-up emails, discounts and available payment methods:
- Send a "please review our product" reminder, if customer has
not reviewed
and has received product x days ago.
- Give 10% cart discount to customers who have spent at least x
ammount last
year and don't apply any other cart discount rules
- Offer "Pay within 30 days" payment method only to customers of
the customer
group "B2B" with credit limit > order ammount
- Don't offer 24 hour delivery if shipper api qualifies customer
address as
'rural'

My 2c.
--
Has anyone done the shipping and is it possible to view the code?



I've got some custom shipping rules in my variation of Cartridge
(along with a number of other changes).
I've tried to summarise all the shipping rule related changes in
this gist:
https://gist.github.com/molokov/36ab544df43efb224719d300761612a4

Essentially:
- Product Variations now have weight, and boolean "pickup
available"/"shipping available" options
- There's a ShippingRule model which allows you to define the
rules within admin.
  The rules define a) a weight range, b) whether you care about
the pickup/shipping options, and c) a country regexp - and a
corresponding price. The order of the rules is important.
- Users are presented with valid shipping options in a drop down
during the payment step of checkout (after entering their shipping
address). If there's no matching rule, an error will be shown.

What I have is probably beyond what you need, and as you can see
I've touched the code in a lot of places (and mind you, this was
over a year ago, so my cartridge fork isn't quite up to date with
the latest master), but hopefully it will point you in the right
direction.

The changes to checkout.py (especially
shippingrule_billship_handler) and models.py/admin.py are probably
the key things you may need.

Hope this helps a little.

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
<mailto: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 gro

Re: [mezzanine-users] Cartrige custom shipping by country

2016-11-03 Thread Danny

On 4/11/2016 5:31 AM, akos1234 wrote:

Hello everyone,

I am trying to attempt to create the shipping for my site.

I was looking at this post -

http://mezzanine-users.narkive.com/AOk7Y6Kl/cartrige-custom-shipping-by-country-and-product-category

which I thought was at the right track. I need to set shipping cost 
for countries as well as different cost for quantity.


If more than 5 items bought, the calculation of shipping would cost 
more than one item.


However, Melvyn Sopacua

*su*ggested something I did not quiet understand.

here as quoted -

If this is the extent of your shipping rules, you may get away with this
approach. From experience with other shopping carts, I highly suggest you
implement a rule-based approach as opposed to a property approach.
Approach like an email filter:
- You define a state formulated by a set of conditions
- Which result in one or more actions
- And has post-processing flags, like "stop further rule processing if 
used"


The implementation is more complex, but the resulting flexibility is 
worth it
and much of the code can be reused for different types of business 
logic, like

follow-up emails, discounts and available payment methods:
- Send a "please review our product" reminder, if customer has not 
reviewed

and has received product x days ago.
- Give 10% cart discount to customers who have spent at least x 
ammount last

year and don't apply any other cart discount rules
- Offer "Pay within 30 days" payment method only to customers of the 
customer

group "B2B" with credit limit > order ammount
- Don't offer 24 hour delivery if shipper api qualifies customer 
address as

'rural'

My 2c.
--
Has anyone done the shipping and is it possible to view the code?



I've got some custom shipping rules in my variation of Cartridge (along 
with a number of other changes).

I've tried to summarise all the shipping rule related changes in this gist:
https://gist.github.com/molokov/36ab544df43efb224719d300761612a4

Essentially:
- Product Variations now have weight, and boolean "pickup 
available"/"shipping available" options
- There's a ShippingRule model which allows you to define the rules 
within admin.
  The rules define a) a weight range, b) whether you care about the 
pickup/shipping options, and c) a country regexp - and a corresponding 
price. The order of the rules is important.
- Users are presented with valid shipping options in a drop down during 
the payment step of checkout (after entering their shipping address). If 
there's no matching rule, an error will be shown.


What I have is probably beyond what you need, and as you can see I've 
touched the code in a lot of places (and mind you, this was over a year 
ago, so my cartridge fork isn't quite up to date with the latest 
master), but hopefully it will point you in the right direction.


The changes to checkout.py (especially shippingrule_billship_handler) 
and models.py/admin.py are probably the key things you may need.


Hope this helps a little.

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.


Re: [mezzanine-users] Cartridge: Skip payment step when cart total is 0

2016-07-25 Thread Danny
It should potentially also apply if a voucher/discount code brings the
total down to 0 - that's a scenario that should be tested.

On 26 July 2016 at 09:55, Stephen McDonald  wrote:

> I added an issue here: https://github.com/stephenmcd/cartridge/issues/303
>
> On Tue, Jul 26, 2016 at 6:31 AM, Stephen McDonald  wrote:
>
>> Sounds like something we should implement in cartridge.
>>
>> On 26 Jul 2016 6:28 AM, "Rémi"  wrote:
>>
>>> Hello,
>>>
>>> I have a site with downloadable products. Some of them are free and are
>>> part of the regular chekout flow (I do some processing once the order is
>>> complete, to record downloads and such). I'm looking for an easy way to
>>> skip the payment step if the cart is equal to zero (only contains free
>>> products). Does anyone ever encounter such scenario?
>>>
>>> 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] how to set profile fileld in 'add user' admin page

2016-07-04 Thread Danny

On 4/07/2016 6:53 PM, muin wrote:


Hi,

I have add a sms_myprofile table which store mobile phone number 
following the document 
‘http://mezzanine.jupo.org/docs/user-accounts.html#profiles’ , It 
works fine on front page and modifu user admin page. But I can not add 
the field 'mobile_phone' to 'add user' admin page (the path is 
‘admin/auth/user/add/’). Can anyone help me? Thanks!


There has been some odd behaviour with the profile fields in the admin 
view with the tagged version of Mezzanine (sometimes none, sometimes 
duplicate), which has been fixed on Mezzanine master. See 
https://groups.google.com/forum/#!topic/mezzanine-users/3QmiqfNZjUM and 
https://github.com/stephenmcd/mezzanine/issues/1449 for example.


Could you try the latest grapelli-safe and mezzanine from GitHub master 
and see if it resolves your issue?


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.


Re: [mezzanine-users] Customize model field not possible ?

2016-05-10 Thread Danny

On 5/11/2016 12:24 AM, David Unric wrote:
I'd like replace field type for billing/shipping country, at 
cartridge.shop.models.Order model.
Instead of plain CharField I'd like use CountryField from 
django_countries.


Is that possible with Mezzanine and how ?

settings.EXTRA_MODEL_FIELDS does not work, it throws an exception same 
named field already exists. It sounds logical as it serves for 
/extending/ models, not replacing.
I can't also find a setting to specify alternate class for Order model 
so it seems subclassing won't be an option.


Any better idea then a fuzzy conversion to/from CountryField in custom 
form ?


It's not all that difficult. I've done something similar with a custom 
OrderForm class in cartridge-braintree (now maintained by Henri)

https://github.com/henri-hulski/cartridge_braintree/blob/master/cartridge_braintree/forms.py#L77-L83

So basically:
- Create a subclass of OrderForm
- Override the country field widgets
- and in urls.py, use this Order Form as the one used by the shop (pass 
form_class=myapp.forms.MyOrderForm, when calling the shop/checkout views)
   (Old style would be to use SHOP_CHECKOUT_FORM_CLASS but that's not 
recommended for Django 1.8 onwards)



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.


Re: [mezzanine-users] IO Error on Upload - Firefox but not Chrome

2016-04-22 Thread Danny

On 23/04/2016 1:42 AM, Rodrigo Gadea wrote:

Resurrecting this... :)

Has anyone found the issue? I'm having the same problem, on a 
production env Firefox uploads throws an IOError while Chrome works 
OK. In dev env, Firefox uploads works fine... :S




I also had this. As people have mentioned, moving to the HTML5 uploader 
worked fine, which is being used by Mezzanine master.


Seeya. Danny.


Any hint? :)

Thanks,
Rodrigo

On Wednesday, October 7, 2015 at 4:32:43 AM UTC-3, iain ross wrote:


I suffered from this problem a while back but unfortunately I never
took notes at the time :-(

I seem to remember the problem didn't occur when I was running the
Django server on localhost but it did happen when I was running it on
another host on my LAN. When I moved to production with Gunicorn and
webserver the problem didn't occur. Though there was a similar issue
for users on slower connections doing large uploads in production. I
avoided that problem by adding --timeout=300 to Gunicorn.

I was, and still am, using a stock Firefox with only HTTP headers and
Firebug add-ons.

-- 


Regards,
Iain.

--
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 
<mailto: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 is the best way to edit sections/part of a page?

2016-04-13 Thread Danny

On 14/04/2016 3:08 AM, Sebastian Wain wrote:

Hi,

We plan to migrate our current Mezzanine based site 
(http://www.nektra.com) to a typical modern (multiple) one-page design 
but I can't find an easy way to edit individual website sections on a 
single page except developing our own extensions. I have checked 
mezzanine-blocks and mezzanine-onepage but they don't work with the 
latest Mezzanine version.


Is there any existing alternative to those modules?



I have a fork of mezzanine-blocks which I've updated to work with Django 
1.9 (the changes are few):

https://github.com/molokov/mezzanine-blocks

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.


Re: [mezzanine-users] Figuring out how to implement user-defined product sort order in Cartridge

2016-04-07 Thread Danny
On 8 April 2016 at 13:21, Sam W <demon@gmail.com> wrote:

> So I end up doing a lot of weird stuff with Cartridge, but something a bit
> more normal has been plaguing me recently; user-defined sort orders for
> products in Cartridge's categories.
>
> Basically, clients' sales staff want to be able to manually drag and drop
> products in categories to change their initial order when the page loads.
> At the moment, they're doing all sorts of stuff to achieve this, including
> unloading and reloading products so that "recently added" does what they
> want. D:
>
> Obviously this is not a normal feature in Cartridge for a bunch of
> reasons, but I was wondering if anyone else had run into this before, and
> if so how you worked around it.
>
> As I'm already customising cartridge, that's the approach I'll likely end
> up taking. It seems like the ideal way to do it is to make products
> orderable with respect to categories and then find a way to add a
> product-order widget to the category page in the admin that will update the
> category-respective order of products when edited. The latter part is the
> most difficult part of the implementation for me, as adding custom widgets
> to the grappelli is not exactly my strong suite. Does anyone have any
> advice on that subject?
>
>
I've customised cartridge as well, and one of the things I did was add an
'ordering' field to the model (I did at first try subclassing Orderable but
it wasn't successful). Then in the Products Admin, I've allowed the
ordering field to be visible/editable so an admin can numerically change
the order of the products. This isn't per category, it's overall, but it's
enough for me.

In the category template, I've removed the sort dropdown, so the only order
that products appear in is the default (which I've set to be based on
'ordering') and that way the products appear in the order I want them.

It's a simple and crude solution, but it's enough for me.

I think if you want drag-and-drop ordering you may want to *start* by
making the Product class subclass Orderable, but to provide that drag-drop
feature, you'll have to adapt the TabularDynamicInline javascript behaviour
to apply to a top level model (rather than an inline). I could never get
the drag/drop ordering to work on any top-level model, so I just gave up
and decided to use numeric ordering as it was simpler for me.

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.


Re: [mezzanine-users] how to limit display data on template?

2016-04-06 Thread Danny

On 7/04/2016 10:14 AM, winarto saputro wrote:

hi all
i'm new in django and mezzanine
i have already create custom model "partners".
i use this {% partner in page.homepage.partners.all %} and it work fine.
but i want to display only 5 data.
anyone have idea how to do that?

thanks
sorry for my bad english :)


Well, Googling "django limit loop" brought me these two links, so at 
least one should hopefully help you:


http://stackoverflow.com/questions/992230/django-for-loop-counter-break
 - most upvoted answer suggests using the 'slice' filter in your loop

http://stackoverflow.com/questions/8373964/django-template-for-loop-print-limited-data-using-for-loop
 - uses slice in the second answer, but in the 'step' rather than the 
'end' parameter.


If you're familiar with Python slices for lists, this should be easy 
enough to comprehend, it's just applying it to Django templates.


Hope this helps,

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.


Re: [mezzanine-users] Re: Link List / displayable_links not working on deployed admin

2016-03-12 Thread Danny

On 13/03/2016 2:46 PM, Eduardo Rivas wrote:


Are you deploying with git, hg, or rsync? If you have committed 
removals, they should be applied on production if using one of the VCS 
methods.




Turns out I'm using rsync. I'm looking into the --delete option, which 
might do the trick for me. I'm modifying my fabfile to suit, and adding 
a "diff" task which essentially runs rsync with --delete and -n 
(dry-run) to show me the diffs between the local and remote repositories.


In any case, it's a little trick - I can kind of understand why the 
default rsync options don't include --delete (after all, you'd have to 
be careful to not delete stuff on the production server which you may 
need) but I can't believe it tripped me up. I guess seeing a difference 
between my dev and production behaviour should have been a tipoff...


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.


Re: [mezzanine-users] Re: Error 500 display_links.js Tinymce NGINX

2016-02-06 Thread Danny

I'm also seeing this issue, using Django 1.9.1 and Mezzanine 4.1.0

I've got exactly the same traceback. I'll do some investigation.

Seeya. Danny.



On 5/02/2016 10:24 PM, Cajoline wrote:

I solved my problem,
the problem occured with mezzanine 4.1 and django 1.8, for resolve it 
i change the django and mezzanine  version to 4.0.1 and 1.8  for 
Django, it's work


Le vendredi 5 février 2016 11:27:14 UTC+1, Cajoline a écrit :

Hi,

I have a error 500 in NGNIX serveur (not in local), when i click
the link button Tinymce, i paste my traceback:

any idea ? i use Mezzanine 4.1 and Django 1.9

Thank you !

Traceback

|

Traceback(most recent call last):



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/django/core/handlers/base.py",line
149,inget_response


response =self.process_exception_by_middleware(e,request)



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/django/core/handlers/base.py",line
147,inget_response


response
=wrapped_callback(request,*callback_args,**callback_kwargs)



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/mezzanine/core/views.py",line
192,indisplayable_links_js


forurl,obj
inDisplayable.objects.url_map(for_user=request.user).items():



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/mezzanine/core/managers.py",line
366,inurl_map


home =self.model(title=_("Home"))



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/django/db/models/base.py",line
408,in__init__


val =field.get_default()



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/django/db/models/fields/related.py",line
906,inget_default


ifisinstance(field_default,self.remote_field.model):


TypeError:isinstance()arg 2must be a type ortuple of types

|




--
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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

For more options, visit https://groups.google.com/d/optout.



--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
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: Error 500 display_links.js Tinymce NGINX

2016-02-06 Thread Danny

Ahh, now  I see it was already fixed by Stephen the other day:
https://github.com/stephenmcd/mezzanine/pull/1516
https://github.com/stephenmcd/mezzanine/commit/94d57294bcc1e934fdd723546be7ea15bb9dcd1a

Cajoline, you may want to update your Mezzanine to the latest master 
from github, it will solve your issue.


Seeya. Danny.


On 7/02/2016 8:43 AM, Danny wrote:

I'm also seeing this issue, using Django 1.9.1 and Mezzanine 4.1.0

I've got exactly the same traceback. I'll do some investigation.

Seeya. Danny.



On 5/02/2016 10:24 PM, Cajoline wrote:

I solved my problem,
the problem occured with mezzanine 4.1 and django 1.8, for resolve it 
i change the django and mezzanine  version to 4.0.1 and 1.8  for 
Django, it's work


Le vendredi 5 février 2016 11:27:14 UTC+1, Cajoline a écrit :

Hi,

I have a error 500 in NGNIX serveur (not in local), when i click
the link button Tinymce, i paste my traceback:

any idea ? i use Mezzanine 4.1 and Django 1.9

Thank you !

Traceback

|

Traceback(most recent call last):



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/django/core/handlers/base.py",line
149,inget_response


response =self.process_exception_by_middleware(e,request)



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/django/core/handlers/base.py",line
147,inget_response


response
=wrapped_callback(request,*callback_args,**callback_kwargs)



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/mezzanine/core/views.py",line
192,indisplayable_links_js


forurl,obj
inDisplayable.objects.url_map(for_user=request.user).items():



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/mezzanine/core/managers.py",line
366,inurl_map


home =self.model(title=_("Home"))



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/django/db/models/base.py",line
408,in__init__


val =field.get_default()



File"/home/cajoline/.virtualenvs/meca_escartin/lib/python3.4/site-packages/django/db/models/fields/related.py",line
906,inget_default


ifisinstance(field_default,self.remote_field.model):


TypeError:isinstance()arg 2must be a type ortuple of types

|




--
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] Flash removed from media library

2016-02-02 Thread Danny
On 3 February 2016 at 08:55, Eduardo Rivas <jerivasmel...@gmail.com> wrote:

> Nice!
>
> Just gave it a try and it seems to be working fine. I really like that the
> file picker dialog shows previews of images now.
>
> I've noticed that selecting with Shift and Control is not working. It
> looks like you have to click the Browse button every time you want to add a
> file. Can we get the keyboard assisted selection back?
>
> That's on Firefox on Ubuntu.
>
>
The file picker dialog is entirely up to your browser/operating system.
Yes, the new upload only supports a single file at a time, but you can add
several before hitting "upload".
I do like that it allows "All Files" in the dialog, and will give you an
error if you pick one that doesn't match a supported extension (in your
Filebrowser settings). You'll also get a prompt if choosing a file with a
name that already exists, asking if you wish to overwrite the existing one.
(If not, you need to rename either the existing file or the new one prior
to uploading).

It would be nice to add further features to this - such as multiple file
select - but I think what @crisbeto did was a very good first step, with
things fairly simple, moving away from Flash to HTML5.

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.


Re: [mezzanine-users] Anyone got a quickfix/hack for the upload button in filebrowser

2016-02-01 Thread Danny

On 2/02/2016 1:51 AM, Joseph Mohan wrote:
Thanks, Going to dive in, Bit of an amateur so if I come up with 
anything useful i'll put it up in the group for someone better to have 
a look!!


Kristiyan Kastadinov forked filebrowser-safe a little while ago and 
added HTML5 based uploading, removing the Flash stuff.

https://github.com/crisbeto/filebrowser-safe
His pull request hasn't been pulled back into the main repo yet, but 
I've created my own fork combining Kristiyan's and the main one from 
Stephen,

and it's working well for me.

See also https://github.com/stephenmcd/filebrowser-safe/issues/33 and 
https://github.com/stephenmcd/filebrowser-safe/pull/54


YMMV, but you can give it a shot and use this fork/PR instead of the 
main release from PyPI.


Seeya. Danny.



Cheers. Joe

On Mon, Feb 1, 2016 at 3:07 PM, Eduardo Rivas <jerivasmel...@gmail.com 
<mailto:jerivasmel...@gmail.com>> wrote:


Nothing that I've personally tried, but it might be a good idea to
look into how the upstream Filebrowser handles the uploads, since
they are now Flash-free.

Current upload template:

https://github.com/sehmaschine/django-filebrowser/blob/master/filebrowser/templates/filebrowser/upload.html

Issue tracking the transition away from Flash:
https://github.com/sehmaschine/django-filebrowser/issues/22


-- 
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/nEhzHvnOkyg/unsubscribe.
To unsubscribe from this group and all its topics, send an email
to mezzanine-users+unsubscr...@googlegroups.com
<mailto:mezzanine-users%2bunsubscr...@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 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

For more options, visit https://groups.google.com/d/optout.



--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
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] Blog post pagination broken

2016-01-23 Thread Danny

Hi all,

I updated my site to Mezzanine 4.1.0/Django 1.9 yesterday and mostly it 
went fairly smoothly.


This morning, however, I was getting errors from the blog app, specifically:

~
Internal Server Error: /blog/
Traceback (most recent call last):
  File 
"/home/danny/.virtualenvs/ausdwcon-navi/local/lib/python2.7/site-packages/django/core/handlers/base.py", 
line 140, in get_response
response = middleware_method(request, callback, callback_args, 
callback_kwargs)
  File 
"/home/danny/.virtualenvs/ausdwcon-navi/local/lib/python2.7/site-packages/mezzanine/pages/middleware.py", 
line 95, in process_view

return view_func(request, *view_args, **view_kwargs)
  File 
"/home/danny/.virtualenvs/ausdwcon-navi/local/lib/python2.7/site-packages/mezzanine/blog/views.py", 
line 58, in blog_post_list

settings.MAX_PAGING_LINKS)
  File 
"/home/danny/.virtualenvs/ausdwcon-navi/local/lib/python2.7/site-packages/mezzanine/utils/views.py", 
line 158, in paginate

page_range = page_range[start:start + max_paging_links]
TypeError: sequence index must be integer, not 'slice'
~~~

I've determined this is happening because I have more than 50 blog posts 
in the database, and we display 5 per page with max_paging_links set to 10.
When there's 50 or fewer blog posts to display, the error doesn't occur  
- this is because the code doesn't enter the "if len(page_range) > 
max_paging_links:" part of the paginate() function. (You can probably 
check this by changing BLOG_POSTS_PER_PAGE or MAX_PAGING_LINKS in the 
admin settings/miscellaneous - both are editable)


In any case, I did some tracking down - page_range should be a Django 
Paginator Page object, which can take a slice as its index parameter
(See e.g. https://code.djangoproject.com/ticket/23140, 
https://code.djangoproject.com/ticket/23190, 
https://code.djangoproject.com/ticket/23088)
However, it appears that when I'm getting this exception, the page_range 
object is of type xrange() - which can't take a slice.


So is there a problem somewhere in mezzanine/utils/views.py that should 
be fixed? Or have I made a mistake myself somewhere else?
I'm using Python 2.7.6, so if it's a Python 2 vs 3 thing, we should 
probably make sure the code works on both.


My workaround for now will be to change MAX_PAGING_LINKS in my site 
settings to something larger.


Thanks for any help,

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.


Re: [mezzanine-users] BUG: duplicate profile info under admin user panel

2016-01-13 Thread Danny

On 14/01/2016 12:58 PM, Joel Gwynn wrote:

I'm also noticing this problem in admin.  What's the fix?


This is the fix from that pull request:
https://github.com/stephenmcd/mezzanine/commit/f91022d6b5f8baecb06ceb8a9479302af1bdfbfc

It's on Mezzanine master, just not in 4.0.1.




On Thursday, October 29, 2015 at 11:39:02 PM UTC-4, Danny S wrote:

Ok, this is fixed in this pull request:
https://github.com/stephenmcd/mezzanine/pull/1450
<https://github.com/stephenmcd/mezzanine/pull/1450>

One other thing I noticed which this fixed - without this change,
on a new user created in the admin, the profile fields would only
appear once, but never saved the data entered into them. Only when
I entered data via SITE/accounts (not in admin) was the data
saved, and then I saw duplicate profile fields.

After making my changes, I added another new user via the admin,
and their profile data saved in the admin first try :)

Seeya. Danny.

On 30 October 2015 at 11:52, Danny <mol...@gmail.com
> wrote:


On 30 October 2015 at 09:55, Stephen McDonald <st...@jupo.org
> wrote:

I can actually reproduce this using latest grappelli-safe

The patch resolved the issue for the site permission
field, but I get duplicate fields for profile fields.

Not sure what the solution is but I've opened an issue here:

https://github.com/stephenmcd/mezzanine/issues/1449
<https://github.com/stephenmcd/mezzanine/issues/1449>


Hi Stephen,

I can also confirm - I've updated to the latest grapelli-safe
and although Site Permissions is no longer duplicated, the
profile fields are.

I'd be interested in a solution too, if anyone manages to work
it out.

Seeya. Danny.



On Fri, Oct 30, 2015 at 7:33 AM, Ryne Everett
<rynee...@gmail.com > wrote:

As I said in the other email, this is easy enough
to solve in the template, see

https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7

<https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7>
 for
how the duplicate SitePermissions was solved.


I don't think that's the link you think it is. That
patch removes the javascript hack (which is what
you're referring to as the "solution") but turned out
to also be the wrong solution and was never merged.

The correct solution to that specific issue turned out
to be
https://github.com/stephenmcd/grappelli-safe/pull/56
<https://github.com/stephenmcd/grappelli-safe/pull/56> and
(assuming the duplicate field is a tabular inline)
upgrading to grappelli-safe master may solve this
issue as well.

    On Thu, Oct 29, 2015 at 3:12 PM, Danny
<mol...@gmail.com > wrote:

On 30/10/2015 12:39 AM, Chi-Cheong Weng wrote:

I still see this in the latest dev build. At the
bottom of
http://127.0.0.1:8000/admin/auth/user/2/
<http://127.0.0.1:8000/admin/auth/user/2/>, I see
my user profile info (i.e. phonenumber and
company) appear twice.


Hi Chi-Cheong,

As I said in the other email, this is easy enough
to solve in the template, see

https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7

<https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7>
for how the duplicate SitePermissions was solved.

for mine, I just added the following line
immediately after that change in my app's copy of
templates/admin/base_site.html:
$("#id_myprofile-__prefix__-id").parent().remove();

My profile module is named 'myprofile' so you'd
probably have to use 'userprofile' instead.

Hope this helps,

Seeya. Danny.


See screen capture. This is seen even in the
latest dev branch.

My user profile module is as follows:
AUTH_PROFILE_MODULE = "userprofiles.UserProfile"
cat userprofiles/models.py
from django.db import models
from django.contrib.auth.models import User
from django.utils.tran

Re: [mezzanine-users] Mezzanine-Onepage Duplicate Fieldsets

2016-01-08 Thread Danny

On 8/01/2016 11:31 PM, George M wrote:

I'm not sure this is the issue, but:


home_fieldsets = deepcopy(HomePageAdmin.fieldsets)
home_fieldsets[0][1]["fields"].insert(1, "in_opd")
HomePageAdmin.fieldsets = home_fieldsets


Here you are deepcopying HomePageAdmin.fieldsets, then changing it.



about_fieldsets = deepcopy(PageAdmin.fieldsets)
about_fieldsets[0][1]["fields"].insert(1, "in_opd")
AboutAdmin.fieldsets = about_fieldsets


Here, and for the rest, you're copying PageAdmin.fieldsets.

Do you think that could be an issue?

The other thing you could try to debug the problem is chuck in some 
prints of the fieldsets values in admin.py when you're changing them, 
just to see what the duplicate entry might be.


Hope this helps

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.


Re: [mezzanine-users] Contact form

2015-12-09 Thread Danny

On 9/12/2015 8:43 PM, Alexander Benatti wrote:
Hello, I'm trying to create a contact form with mezzanine, I'd like 
that this form is sent using json and email. How can I do this?


Mezzanine's Page subclass Form can be used to create forms quite easily. 
At the moment, it purely sends the form contents as email
(optionally to the person who filled it in, plus cc's you add in the 
admin). However, it shouldn't be too difficult to add extra behaviour

at the same point.

Here's where the forms are emailed:
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/forms/page_processors.py

The page processors are handled by the Page middleware:
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/pages/middleware.py

It should be possible for you to copy/inherit from the form page 
processor, and make your own modifications, overriding the one

in Mezzanine.

Hope this helps.

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.


Re: [mezzanine-users] Email from forms...

2015-12-04 Thread Danny

On 5/12/2015 3:19 AM, Sarah Hein wrote:
I feel silly, but I swear I've tried to fix this on my own and by 
checking the docs...


Working to deploy Mezzanine with Python 3.4 onto a Digital Ocean VPS. 
Trying to mimic the Fabric deploy the best I can, and have it set up 
with PostgresQL, Supervisord, Nginx, and Gunicorn. Everything seems to 
be working as expected so far.


The only hiccup is that I can't get the form to automatically send me 
emails. I've filled in the various settings via the admin panel, and 
I've added the following to settings.py (following Ross 
Laird'sexcellent guide 
<http://www.rosslaird.com/blog/customizing-mezzanine/>):


|
##
# SEND EMAIL #
##
# enable email via gmail
EMAIL_HOST ='smtp.gmail.com'
EMAIL_PORT =587
EMAIL_HOST_USER ='sarah.is.a.super.common.n...@gmail.com'
EMAIL_HOST_PASSWORD ='passwordsarefun'
EMAIL_USE_TLS =True
DEFAULT_FROM_EMAIL ='sarah.is.a.super.common.n...@gmail.com'
|


Prior to changing all of these settings, I would get an error message 
when I tried to use the form to send an email. Now I get a success 
message following form submission, and I can see the entries under 
"View Entries" from the admin panel. I just never get an email. I 
don't get it. Is Google blocking me? Is there another program I was 
supposed to have installed and integrated? I feel bad clogging up the 
mailing list, as I bet it's something simple I'm missing, but I'm out 
of ideas on how to fix this.


Given that the email is *from* you and *to* you, check your Gmail "All 
Mail" or "Sent Mail" folder, just to ensure it's not being automatically 
filed there, rather than in your inbox.


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.


Re: [mezzanine-users] Re: Issues Getting Category

2015-11-26 Thread Danny

On 27/11/2015 4:33 AM, R.J. Jackson wrote:

Hi, thank you it was helpful.

I have a follow up question, lets say I wanted to do a check to see if 
category is == to a string, how can I do that?


Why  not read up on Django template tags?
https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#if

There's several examples there using both == and %ifequal, see which one 
works best for you.


Seeya. Danny.



I have tried using the if tag but it doesn't work.

On Wednesday, November 25, 2015 at 6:09:42 PM UTC-5, Nkansah Rexford 
wrote:


Perhaps the blog_post_list.html file might be of help. In mine, I
find this:
|
{% with blog_post.categories.all as categories %}
  {% if categories %}
...
{% for category in categories %}
{{
category }}{% if not forloop.last %}, {% endif %}
{% endfor %}
  {% endif %}
{% endwith %}
|

That hopefully gives an idea how to fetch a category.

And remember, you wouldn't expect to find a category object or
objects if one isn't already created.

--
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 
<mailto: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] Displaying excerpt content on blog homepage

2015-11-26 Thread Danny

On 27/11/2015 7:52 AM, Eduardo Rivas wrote:
The blog post list template displays blurbs using {{ 
blog_post.description_from_content }}, which will get you the first or 
so elements of the post. The full content is available as {{ 
blog_post.content }}.


Don't forget to add the appropriate filters!

Here's the reference for what Eduardo mentioned - just create your own 
version of this template and change this line.

https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/blog/templates/blog/blog_post_list.html#L112

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.


Re: [mezzanine-users] mezzanine_block

2015-11-23 Thread Danny

On 23/11/2015 8:59 PM, Asrik wrote:

Hello,
Iam new to Mezzanine, was trying to figure out how to make editable 
containers on my home page as i have a single page site.
I got to see 2 options mezzanine-blocks and mezzyblocks. i tried 
mezzanine-blocks https://github.com/renyi/mezzanine-blocks

followed steps as metioned but i get an error saying
'block_tags' is not a valid tag library: Template library block_tags 
not found

Is there something iam missing,how can i add tag in my library.
do we have any version compatibility for using mezzanine-blocks.



I'm using mezzanine blocks straight from my github source, it's working 
fine. Admittedly I made a fork earlier in the year and added Django 1.8 
style migrations to it,

but that's it. I don't have the changed renyi made for 0.9.3 on Sep 10 2015.

I'm going to assume that you've added 'mezzanine_blocks' to your 
INSTALLED_APPS (mine's near the bottom of the list, after all the 
mezzanine apps) and that you've run makemigrations and migrate...


That being said, the presence of the migrations shouldn't affect the 
loading of the template tags...


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.


Re: [mezzanine-users] Check if page has child pages

2015-11-11 Thread Danny

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.


Re: [mezzanine-users] Re: TinyMCE4 - Problems on deployed site

2015-11-10 Thread Danny

On 11/11/2015 7:02 AM, Cody Pettit wrote:

Hi Danny,

Did you ever figure out what your issue was/is? We are facing a 
similar issue.


We can't select an image from the Media Library to insert into a page 
(or form). It's not even working for us in development with DEBUG = True.


We can, however, select and insert an image into a Gallery Page.

The image/button needed to select and insert an image just isn't there 
when we are trying to insert into a page/form.


Mostly, the issue is accessing parts of the site across the HTTP/HTTPS 
boundary. If you  have HTTPS enabled for the admin side of things,
then accessing the Media Library when editing on the HTTP site doesn't 
work, and if you're editing in the Admin side, you can't get the Link 
List of pages because it's under a HTTP URL.


My overall solution was to make my entire site HTTPS... not elegant, I 
know, but probably better in this security conscious world :)


If you do go down this route, I found this page quite useful in setting 
up my nginx configuration to ensure all avenues are taken care of:

https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html

Seeya. Danny.




Appreciate any help!

Thanks,

Cody



--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
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] BUG: duplicate profile info under admin user panel

2015-10-29 Thread Danny
Thanks Ryne, I'll fix my hack as well then :)

On 30 October 2015 at 07:03, Ryne Everett <ryneever...@gmail.com> wrote:

> As I said in the other email, this is easy enough to solve in the
>> template, see
>>
>> https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7
>>  for
>> how the duplicate SitePermissions was solved.
>
>
> I don't think that's the link you think it is. That patch removes the
> javascript hack (which is what you're referring to as the "solution") but
> turned out to also be the wrong solution and was never merged.
>
> The correct solution to that specific issue turned out to be
> https://github.com/stephenmcd/grappelli-safe/pull/56 and (assuming the
> duplicate field is a tabular inline) upgrading to grappelli-safe master may
> solve this issue as well.
>
> On Thu, Oct 29, 2015 at 3:12 PM, Danny <molo...@gmail.com> wrote:
>
>> On 30/10/2015 12:39 AM, Chi-Cheong Weng wrote:
>>
>> I still see this in the latest dev build. At the bottom of
>> http://127.0.0.1:8000/admin/auth/user/2/, I see my user profile info
>> (i.e. phonenumber and company) appear twice.
>>
>> Hi Chi-Cheong,
>>
>> As I said in the other email, this is easy enough to solve in the
>> template, see
>>
>> https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7
>> for how the duplicate SitePermissions was solved.
>>
>> for mine, I just added the following line immediately after that change
>> in my app's copy of templates/admin/base_site.html:
>> $("#id_myprofile-__prefix__-id").parent().remove();
>>
>> My profile module is named 'myprofile' so you'd probably have to use
>> 'userprofile' instead.
>>
>> Hope this helps,
>>
>> Seeya. Danny.
>>
>> See screen capture. This is seen even in the latest dev branch.
>>
>> My user profile module is as follows:
>> AUTH_PROFILE_MODULE = "userprofiles.UserProfile"
>> cat userprofiles/models.py
>> from django.db import models
>> from django.contrib.auth.models import User
>> from django.utils.translation import ugettext as _
>> from phonenumber_field.modelfields import PhoneNumberField
>> from companies.models import Company
>>
>> class UserProfile(models.Model):
>> user = models.OneToOneField(User, unique=True,
>> verbose_name=_('user'), related_name='user_profile')
>> phonenumber = PhoneNumberField(null=True, blank=True)
>> company = models.ForeignKey(Company, null=True)
>>
>> def __unicode__(self):
>> return u'%s %s (%s), %s' % (self.user.first_name,
>> self.user.last_name, self.user.username, self.phonenumber)
>>
>>
>> --
>> 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.
>>
>>
>>
>> --
>> *Danny Sag*
>> Chairperson
>> Round World Events SA, Inc
>> City of Small Gods Terry Pratchett Fan Club -
>> <http://cityofsmallgods.org.au>http://cityofsmallgods.org.au
>>
>> *Nullus Anxietas VI - The Australian Discworld Convention* -
>> http://ausdwcon.org
>> "The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017
>>
>> --
>> 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.
>



-- 
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* -
http://ausdwcon.org
"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

-- 
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] InterfaceError exception thrown while trying to add new user from admin panel

2015-10-29 Thread Danny

Hi Chi-Cheong,

My site uses AUTH_PROFILE_MODULE (yeah, I know it's deprecated), and 
although I haven't experienced your particular issue, I did notice that
in the Admin pages, editing a User showed the profile fields twice 
(somewhat similar to this issue: 
https://github.com/stephenmcd/mezzanine/issues/1366 )


I ended up solving my issue by copying and modifying the base_site.html 
template similarly to what solved #1366, here:

https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7

It may be that you may need to do something similar, but I'm really not 
sure.


Hope this helps,

Seeya. Danny.


On 29/10/2015 4:15 PM, Chi-Cheong Weng wrote:

Mezzanine version: 4.0.1

I can consistently reproduce a bug where if AUTH_PROFILE_USER is 
configured, adding a new user from the admin panel will cause 
mezzanine to throw InterfaceError exception. I can sign in a new user 
from the user panel and it works fine. It only throws exception when I 
tried adding a new user from the admin panel.


To reproduce the problem, just download and install the latest 
mezzanine and then add two apps userprofiles and configure 
AUTH_PROFILE_USER=userprofiles.UserProfile


cat userprofiles/models.py

from django.db import models


from django.contrib.auth.models import User

from django.utils.translation import ugettext as _

from phonenumber_field.modelfields import PhoneNumberField


class UserProfile(models.Model):

user = models.OneToOneField(User, unique=True, 
verbose_name=_('user'), related_name='user_profile')


phonenumber = PhoneNumberField(null=True, blank=True)


Environment:


Request Method: POST
Request URL: http://127.0.0.1:8000/admin/auth/user/add/

Django Version: 1.8.5
Python Version: 2.7.6
Installed Applications:
(u'mezzanine.boot',
 u'django.contrib.auth',
 u'django.contrib.contenttypes',
 u'django.contrib.redirects',
 u'django.contrib.sessions',
 u'django.contrib.sites',
 u'django.contrib.sitemaps',
 u'mezzanine.conf',
 u'mezzanine.core',
 u'mezzanine.generic',
 u'mezzanine.pages',
 u'mezzanine.blog',
 u'mezzanine.forms',
 u'mezzanine.galleries',
 u'mezzanine.twitter',
 u'mezzanine.accounts',
 u'userprofiles',
 u'filebrowser_safe',
 u'grappelli_safe',
 u'django.contrib.admin',
 u'django.contrib.staticfiles',
 u'django_comments')
Installed Middleware:
(u'django.contrib.sessions.middleware.SessionMiddleware',
 u'django.middleware.common.CommonMiddleware',
 u'django.middleware.csrf.CsrfViewMiddleware',
 u'django.contrib.auth.middleware.AuthenticationMiddleware',
 u'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 u'django.contrib.messages.middleware.MessageMiddleware',
 u'django.middleware.clickjacking.XFrameOptionsMiddleware',
 u'mezzanine.core.request.CurrentRequestMiddleware',
 u'mezzanine.core.middleware.RedirectFallbackMiddleware',
 u'mezzanine.core.middleware.TemplateForDeviceMiddleware',
 u'mezzanine.core.middleware.TemplateForHostMiddleware',
 u'mezzanine.core.middleware.AdminLoginInterfaceSelectorMiddleware',
 u'mezzanine.core.middleware.SitePermissionMiddleware',
 u'mezzanine.pages.middleware.PageMiddleware')


Traceback:
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/core/handlers/base.py" 
in get_response
  132. response = wrapped_callback(request, 
*callback_args, **callback_kwargs)
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/contrib/admin/options.py" 
in wrapper
  616. return self.admin_site.admin_view(view)(*args, 
**kwargs)
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/utils/decorators.py" 
in _wrapped_view

  110. response = view_func(request, *args, **kwargs)
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/views/decorators/cache.py" 
in _wrapped_view_func

  57. response = view_func(request, *args, **kwargs)
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" 
in inner

  233. return view(request, *args, **kwargs)
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/utils/decorators.py" 
in _wrapper

  34. return bound_func(*args, **kwargs)
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/views/decorators/debug.py" 
in sensitive_post_parameters_wrapper

  76. return view(request, *args, **kwargs)
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/utils/decorators.py" 
in bound_func
  30. return func.__get__(self, type(self))(*args2, 
**kwargs2)
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/utils/decorators.py" 
in _wrapper

  34. return bound_func(*args, **kwargs)
File 
"/home/ubuntu/Envs/testdb/local/lib/python2.7/site-packages/django/utils/decorators.py" 
in _

Re: [mezzanine-users] BUG: duplicate profile info under admin user panel

2015-10-29 Thread Danny
On 30 October 2015 at 09:55, Stephen McDonald <st...@jupo.org> wrote:

> I can actually reproduce this using latest grappelli-safe
>
> The patch resolved the issue for the site permission field, but I get
> duplicate fields for profile fields.
>
> Not sure what the solution is but I've opened an issue here:
>
> https://github.com/stephenmcd/mezzanine/issues/1449
>
>
Hi Stephen,

I can also confirm - I've updated to the latest grapelli-safe and although
Site Permissions is no longer duplicated, the profile fields are.

I'd be interested in a solution too, if anyone manages to work it out.

Seeya. Danny.





> On Fri, Oct 30, 2015 at 7:33 AM, Ryne Everett <ryneever...@gmail.com>
> wrote:
>
>> As I said in the other email, this is easy enough to solve in the
>>> template, see
>>>
>>> https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7
>>>  for
>>> how the duplicate SitePermissions was solved.
>>
>>
>> I don't think that's the link you think it is. That patch removes the
>> javascript hack (which is what you're referring to as the "solution") but
>> turned out to also be the wrong solution and was never merged.
>>
>> The correct solution to that specific issue turned out to be
>> https://github.com/stephenmcd/grappelli-safe/pull/56 and (assuming the
>> duplicate field is a tabular inline) upgrading to grappelli-safe master may
>> solve this issue as well.
>>
>> On Thu, Oct 29, 2015 at 3:12 PM, Danny <molo...@gmail.com> wrote:
>>
>>> On 30/10/2015 12:39 AM, Chi-Cheong Weng wrote:
>>>
>>> I still see this in the latest dev build. At the bottom of
>>> http://127.0.0.1:8000/admin/auth/user/2/, I see my user profile info
>>> (i.e. phonenumber and company) appear twice.
>>>
>>> Hi Chi-Cheong,
>>>
>>> As I said in the other email, this is easy enough to solve in the
>>> template, see
>>>
>>> https://github.com/ryneeverett/mezzanine/commit/801b66152b96f1ec0e14a52127484065742552b7
>>> for how the duplicate SitePermissions was solved.
>>>
>>> for mine, I just added the following line immediately after that change
>>> in my app's copy of templates/admin/base_site.html:
>>> $("#id_myprofile-__prefix__-id").parent().remove();
>>>
>>> My profile module is named 'myprofile' so you'd probably have to use
>>> 'userprofile' instead.
>>>
>>> Hope this helps,
>>>
>>> Seeya. Danny.
>>>
>>> See screen capture. This is seen even in the latest dev branch.
>>>
>>> My user profile module is as follows:
>>> AUTH_PROFILE_MODULE = "userprofiles.UserProfile"
>>> cat userprofiles/models.py
>>> from django.db import models
>>> from django.contrib.auth.models import User
>>> from django.utils.translation import ugettext as _
>>> from phonenumber_field.modelfields import PhoneNumberField
>>> from companies.models import Company
>>>
>>> class UserProfile(models.Model):
>>> user = models.OneToOneField(User, unique=True,
>>> verbose_name=_('user'), related_name='user_profile')
>>> phonenumber = PhoneNumberField(null=True, blank=True)
>>> company = models.ForeignKey(Company, null=True)
>>>
>>> def __unicode__(self):
>>> return u'%s %s (%s), %s' % (self.user.first_name,
>>> self.user.last_name, self.user.username, self.phonenumber)
>>>
>>>
>>> --
>>> 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.
>>>
>>>
>>>
>>> --
>>> *Danny Sag*
>>> Chairperson
>>> Round World Events SA, Inc
>>> City of Small Gods Terry Pratchett Fan Club -
>>> <http://cityofsmallgods.org.au>http://cityofsmallgods.org.au
>>>
>>> *Nullus Anxietas VI - The Australian Discworld Convention* -
>>> http://ausdwcon.org
>>> "The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017
>>>
>>> --
>>> 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 e

Re: [mezzanine-users] Re: registering new settings for templates

2015-10-15 Thread Danny
I suspect Nkansah is referring to this setting:

http://mezzanine.jupo.org/docs/configuration.html#template-accessible-settings

But yes, perhaps TEMPLATE_ACCESSIBLE_SETTINGS should be referenced in the
docs at the point that talks about register_setting()



On 16 October 2015 at 13:03, Ryne Everett <ryneever...@gmail.com> wrote:

> If something is missing please enlighten us. What did you learn?
>
> On Thu, Oct 15, 2015 at 9:28 PM, Nkansah Rexford <seanmav...@gmail.com>
> wrote:
>
>> got it working. Yet another missing piece from 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.
>>
>
> --
> 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.
>



-- 
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* -
http://ausdwcon.org
"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

-- 
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] dj-stripe vs cartridge-stripe

2015-09-17 Thread Danny

On 16/09/2015 4:24 AM, William Dai wrote:

Need some guidance here.

I am thinking to have e-commerce enabled and am wondering whether we 
should go with dj-stripe to get it working with cartridge, or go with 
the built-in cartridge-stripe integration.  which way is the right way 
to go?


I have seen dj-stripe group very active but I have no idea the hidden 
challenges to get payment working fine and secure.


Any comments appreciated.


Hi William,

I haven't used Stripe or cartridge-stripe, but my guess would be that 
cartridge-stripe would be a good place to start. It does look out of 
date, so you may need to fork it and make your own updates.


I've had to create some cartridge integration for payment processors 
from scratch (wrapped around other modules) which wasn't *too* difficult:

https://github.com/molokov/cartridge_braintree  (for Mez 3)
https://github.com/molokov/cartridge-pinpayments (for Mez 4)

However both these payment processors have a nice easy Javascript based 
way to submit Credit Card Info from client to *their* servers without 
the numbers ever passing into plain text on our servers - which makes 
the PCI compliance factors for our servers much simpler. I don't know if 
stripe has such a mechanism.
From that point of view, it was as simple as making sure the HTML/JS 
generated from cartridge's templates & OrderForm matched what was 
expected from the examples on their websites; that and rewriting the 
payment handler (which is easy in Cartridge)


If Stripe has as simple a mechanism, perhaps you can look at my 
cartridge-pinpayments as an example, and wrap dj-stripe in a similar to 
way that I've wrapped django-pinpayments.


Hope this helps,

Seeya. Danny.


--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
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 - SHOP_CHECKOUT_FORM_CLASS setting is deprecated

2015-09-03 Thread Danny

On 4/09/2015 9:51 AM, James Lewis wrote:


Hi Danny, I have made the changes you mentioned and now I am getting 
the following error:




File "/home/jameslewis/webapps/myshop/scooter/scooter/urls.py" in 


33. name="shop_checkout", kwargs=dict(form_class=MyOrderForm)),


Exception Type: NameError at /

Exception Value: name 'MyOrderForm' is not defined




Is that the name of your Form, though? Have you done "from ... import 
MyOrderForm" in urls.py?


I'll need some more context.

I am sure it's something silly, but I've checked stackoverflow and 
can't find anything?



Many Thanks


James :-)



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.


Re: [mezzanine-users] Re: Cartridge - SHOP_CHECKOUT_FORM_CLASS setting is deprecated

2015-09-03 Thread Danny

On 4/09/2015 10:24 AM, James Lewis wrote:
Hi Danny thanks for replying so quickly, I am not sure what the name 
of my form is.  Would I already have an order form within cartridge or 
would I have to build one specifically to work with stripe?




Hang on, you've (previously) updated SHOP_CHECKOUT_FORM_CLASS and yet 
you don't know what the name of your form class is?

It's whatever you used to have under SHOP_CHECKOUT_FORM_CLASS.

As for using Stripe as your payment processor, you'll either have to 
find any existing implementation or write one yourself.


If you're using https://github.com/readevalprint/cartridge-stripe
then you can see that the name of the class is 
"cartridge_stripe.forms.OrderForm" so that would be your reference for 
urls.py,


e.g

from cartridge_stripe.forms import OrderForm

url("^shop/checkout/$", "cartridge.shop.views.checkout_steps",
name="shop_checkout", kwargs=dict(form_class=OrderForm)),

Your original email never mentioned what you'd set 
SHOP_CHECKOUT_FORM_CLASS to, so I'd assumed you'd written your own Order 
Form class in your own app

and were doing it that way...

Seeya. Danny.



Many Thanks

James

On Fri, Sep 4, 2015 at 1:23 AM, Danny <molo...@gmail.com 
<mailto:molo...@gmail.com>> wrote:


    On 4/09/2015 9:51 AM, James Lewis wrote:


Hi Danny, I have made the changes you mentioned and now I am
getting the following error:



File "/home/jameslewis/webapps/myshop/scooter/scooter/urls.py" in



33.   name="shop_checkout", kwargs=dict(form_class=MyOrderForm)),


Exception Type: NameError at /

Exception Value: name 'MyOrderForm' is not defined




Is that the name of your Form, though? Have you done "from ...
import MyOrderForm" in urls.py?

I'll need some more context.


I am sure it's something silly, but I've checked stackoverflow
and can't find anything?


Many Thanks


James :-)



Seeya. Danny.
-- 
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/DQX3K3jdojE/unsubscribe.
To unsubscribe from this group and all its topics, send an email
to mezzanine-users+unsubscr...@googlegroups.com
<mailto: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 
<mailto: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: Cartridge - SHOP_CHECKOUT_FORM_CLASS setting is deprecated

2015-09-01 Thread Danny

On 2/09/2015 7:19 AM, James Lewis wrote:
I have tried this and it is still not working, I have tried all the 
different urls on this group and I am still getting the same errors. 
 What else do you have to change to stop this error appearing; is 
there not any changes I need to make in forms.py, settings or anything 
else?  Sorry but I am really struggling on this for some reason




Have you removed SHOP_CHECKOUT_FORM_CLASS from your settings.py? The 
urls.py changes *replace* the need for this deprecated setting.


eg. instead of
SHOP_CHECKOUT_FORM_CLASS = "myapp.forms.MyOrderForm"
in settings.py,  you do:

|from myapp.forms import MyOrderForm # ... urlpatterns += patterns('', # 
Use your special OrderForm class url("^shop/checkout/$", 
"cartridge.shop.views.checkout_steps", name="shop_checkout", 
kwargs=dict(form_class=MyOrderForm)), # Cartridge URLs. ("^shop/", 
include("cartridge.shop.urls")), # ... )|


in urls.py

HTH. HAND.

Seeya. Danny.


Thanks

James
On Friday, July 11, 2014 at 6:07:43 PM UTC+1, Tristan Barry wrote:

Good afternoon! I am working on a project where we would like to
use Cartridge for an online store. Out of the box it looks great;
but I'd like to modify the checkout form. Reading through the
documentation it sounded like I could sub-class the OrderForm
class in 'cartridge.shops.forms'. When going through these steps I
saw this message:

"The SHOP_CHECKOUT_FORM_CLASS setting is deprecated - please
define your own urlpattern for the checkout_steps view, passing in
your own form_class argument."

But I'm running into problems right off the start. Does this mean
I can just write my own URL pattern for *only* the checkout form?
Something like this?

url("^shop/checkout/$", "myproject.views.checkout_steps", name =
"checkout_steps")
?

Or do I need to remove the cartridge urls pattern:
  url(r"^shop/", include("cartridge.shop.urls")),
and replace it with a modified version of 'cartridge.shop.urls'?
This doesn't seem very DRY?

Can anyone offer any hints on how to get started?  Should the
OrderForm class still be sub-classed to assist with making this
all 'work'? Any help??


--
You received this message because you are subscribed to the Google 
Groups "Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to mezzanine-users+unsubscr...@googlegroups.com 
<mailto:mezzanine-users+unsubscr...@googlegroups.com>.

For more options, visit https://groups.google.com/d/optout.



--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

"The Discworld Grand Tour" - Adelaide SA, August 4-6, 2017

--
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: Basic PostgreSQL installation

2015-08-25 Thread Danny

On 26/08/2015 12:32 AM, Richard Jackson wrote:

snip

3) Within the 'settings.py' file alter the DATABASES text to read as 
below:


DATABASES = {

'default': {

'ENGINE': 'django.db.backends.postgresql_psycopg2',

'NAME': 'test_db',

'USER': 'test_user',

'PASSWORD': '',

'HOST': '127.0.0.1',

'PORT': '5432',

}

}



Just to check - is DATABASES being overridden in local_settings.py? 
After all, for Mezzanine, local_settings is usually where you'll define 
the actual database (so you can e.g. use sqlite for dev and postgresql 
for the deployed site via the local_settings template in the deploy 
directory)


Check your project root for 'dev.db' because it's just highly possible 
that the database is being created within sqlite instead of postgresql 
if you haven't updated DATABASES in local_settings.py


Can you see anything obviously incorrect with the above? Is there any 
easy way to actually find what database is being used at present?




python manage.py shell
import settings
settings.DATABASES

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.


Re: [mezzanine-users] I just deployed my mezzanine website using fab all and the website is empty (database not found)

2015-07-29 Thread Danny

On 29/07/2015 4:53 PM, Bhavani Shankar wrote:
I figured there's a problem in detecting the postgresql database. I 
went to local_settings.py and saw that the user and name of the 
database were set to the project's name. (different from my local 
machine) How can I fix this?


If you're deploying using Fabric and Mezzanine's fabfile, that's 
standard (database name and user are same as project name). You can set 
the database password

in your FABRIC dictionary on your dev machine's local_settings.py.

If you wish to change this, you could edit your project's copy of 
fabfile.py and change the places where it creates the database and its 
user, but you may also
need to ensure the local_settings.py template you use updates DATABASES 
appropriately as well. (in the deploy directory)


Deployment doesn't copy across database contents (and nor should it) 
because generally you want your dev database to be different to production.
If you do want to transfer across the data, read up on the 'dumpdata' 
and 'loaddata' commands (from manage.py/django_admin) and if they fail, 
you can always use Postgresql's own pg_dump / psql commands to copy the 
data across.


Hope this helps.

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.


Re: [mezzanine-users] Re: TinyMCE4 - Problems on deployed site

2015-07-24 Thread Danny

On 25/07/2015 1:04 AM, Josh Cartmell wrote:
Hey Danny I'm not too sure what's going on, but is your site actually 
serving from an IP address like 33.33.33.33? Is there some sort of 
mixture of ip and domain[s]?




Hi Josh,

Yes, 33.33.33.33 is the host-accessible IP of my vagrant VM, and it's 
what I've got in ALLOWED_HOSTS (and the nginx.conf file), so I don't 
think it's the IP that's the problem. For vagrant deployment, I'm not 
using a hostname.


Relevant line from my Vagrantfile: config.vm.network private_network, 
ip: 33.33.33.33


Seeya. Danny.

On Thu, Jul 23, 2015 at 11:46 PM, Danny molo...@gmail.com 
mailto:molo...@gmail.com wrote:


Replying to myself again...

I thought I'd try this with a brand new site, using the latest
Mezzanine/Cartridge stuff from master prior to the 4.0.1 release.

BTW... it's still a problem :D

Setup steps:
1. mezzanine-project -a cartridge mez401
2. Edit requirements.txt to be:
git+git://github.com/stephenmcd/grappelli-safe.git
http://github.com/stephenmcd/grappelli-safe.git
git+git://github.com/stephenmcd/filebrowser-safe.git
http://github.com/stephenmcd/filebrowser-safe.git
git+git://github.com/stephenmcd/mezzanine.git
http://github.com/stephenmcd/mezzanine.git
git+git://github.com/stephenmcd/cartridge.git
http://github.com/stephenmcd/cartridge.git
3. Edit mez401/settings.py, uncomment the SSLRedirectMiddelware line
4. Edit mez401/local_settings.py, set up FABRIC dictionary to
deploy to my vagrant VM
5. fab all
Hooray, deployment works, and I can visit the site and log in to
admin.
6. Admin-Settings, set Enable SSL to true.

Now, to test the TinyMCE issues:
On Admin side, create a new page, select some text, click the
Insert/Edit Link button... nothing happens (no popup)
Upload some pictures to the Media Library

On main site, edit a page using yellow EDIT button, click the
Insert/Edit Image button.
Dialog pops up, click browse button (folder/magnifying glass) next
to Source
Next screen pops up saying Select image to insert but the rest
of it is blank - I'm not even seeing the Media Library browser here.

Browser debug console has the error message: Load denied by
X-Frame-Options:
https://33.33.33.33/admin/media-library/browse/?pop=5type=image
does not permit cross-origin framing. unknown

Can anyone help please?

Surely this is a standard setup for most websites? (admin, shop
etc under https and the main site not) Can we get this fixed
before the 4.0.1 release?

Thanks,

Seeya. Danny.



On 23 July 2015 at 17:15, Danny molo...@gmail.com
mailto:molo...@gmail.com wrote:

I'm now convinced that both of my issues are https/SSL related.

The media library image select works under https but not http,
because the Media library browser is under the /admin path
(which is https)
The insert/edit link box relies on displayable_links.js which
is http, so it works through the 'front' side but not under admin.

Has anyone managed to get this working on a site with SSL
enabled for the /admin path?

Seeya. Danny.


On 23/07/2015 1:08 PM, Danny wrote:

Hi all,

I'm hoping someone can either replicate my issue or help me
debug it.

Using Mezzanine master (as of 23/7/15), on my deployed site,
I can't select an image from the Media Library to insert it
into a page when Inserting/Editing an image.
This is editing via the main site's Yellow EDIT buttons, not
on the admin side. (on the Admin side, it works)

i.e. this button:


The javascript error shown in the Firebug console is Error:
Permission denied to access property tinymce on
FB_TinyMCE4.js line 4, col 8

That script is, with line 4 in bold:
var FileBrowserDialogue = {
fileSubmit : function (FileURL) {
parentWin = (!window.frameElement 
window.dialogArguments) || opener || parent || top;
*tinymce = tinyMCE = parentWin.tinymce;*
self.editor = tinymce.EditorManager.activeEditor;
self.params = self.editor.windowManager.getParams();
parentWin.document.getElementById(self.params.input).value =
FileURL;
self.editor.windowManager.close(parentWin);
}
};

The same actions work perfectly fine when running
development/DEBUG=True.

The other problem that still persists in Mezzanine 4 (and has
been around for a while, even with earlier TinyMCE versions),
is that the Insert/Edit Link dialog does not pop up if
editing a Page on the Admin side - I suspect this is because
it is behind https/SSL here, and something is going wrong there.

The error given in Firebug is Blocked loading mixed active

[mezzanine-users] Re: TinyMCE4 - Problems on deployed site

2015-07-23 Thread Danny
Replying to myself again...

I thought I'd try this with a brand new site, using the latest
Mezzanine/Cartridge stuff from master prior to the 4.0.1 release.

BTW... it's still a problem :D

Setup steps:
1. mezzanine-project -a cartridge mez401
2. Edit requirements.txt to be:
git+git://github.com/stephenmcd/grappelli-safe.git
git+git://github.com/stephenmcd/filebrowser-safe.git
git+git://github.com/stephenmcd/mezzanine.git
git+git://github.com/stephenmcd/cartridge.git
3. Edit mez401/settings.py, uncomment the SSLRedirectMiddelware line
4. Edit mez401/local_settings.py, set up FABRIC dictionary to deploy to my
vagrant VM
5. fab all
Hooray, deployment works, and I can visit the site and log in to admin.
6. Admin-Settings, set Enable SSL to true.

Now, to test the TinyMCE issues:
On Admin side, create a new page, select some text, click the Insert/Edit
Link button... nothing happens (no popup)
Upload some pictures to the Media Library

On main site, edit a page using yellow EDIT button, click the Insert/Edit
Image button.
Dialog pops up, click browse button (folder/magnifying glass) next to Source
Next screen pops up saying Select image to insert but the rest of it is
blank - I'm not even seeing the Media Library browser here.

Browser debug console has the error message: Load denied by
X-Frame-Options:
https://33.33.33.33/admin/media-library/browse/?pop=5type=image does not
permit cross-origin framing. unknown

Can anyone help please?

Surely this is a standard setup for most websites? (admin, shop etc under
https and the main site not) Can we get this fixed before the 4.0.1 release?

Thanks,

Seeya. Danny.



On 23 July 2015 at 17:15, Danny molo...@gmail.com wrote:

  I'm now convinced that both of my issues are https/SSL related.

 The media library image select works under https but not http, because the
 Media library browser is under the /admin path (which is https)
 The insert/edit link box relies on displayable_links.js which is http, so
 it works through the 'front' side but not under admin.

 Has anyone managed to get this working on a site with SSL enabled for the
 /admin path?

 Seeya. Danny.


 On 23/07/2015 1:08 PM, Danny wrote:

 Hi all,

 I'm hoping someone can either replicate my issue or help me debug it.

 Using Mezzanine master (as of 23/7/15), on my deployed site, I can't
 select an image from the Media Library to insert it into a page when
 Inserting/Editing an image.
 This is editing via the main site's Yellow EDIT buttons, not on the admin
 side. (on the Admin side, it works)

 i.e. this button:


 The javascript error shown in the Firebug console is Error: Permission
 denied to access property tinymce on FB_TinyMCE4.js line 4, col 8

 That script is, with line 4 in bold:
 var FileBrowserDialogue = {
 fileSubmit : function (FileURL) {
 parentWin = (!window.frameElement  window.dialogArguments) ||
 opener || parent || top;
 *tinymce = tinyMCE = parentWin.tinymce;*
 self.editor = tinymce.EditorManager.activeEditor;
 self.params = self.editor.windowManager.getParams();
 parentWin.document.getElementById(self.params.input).value =
 FileURL;
 self.editor.windowManager.close(parentWin);
 }
 };

 The same actions work perfectly fine when running development/DEBUG=True.

 The other problem that still persists in Mezzanine 4 (and has been around
 for a while, even with earlier TinyMCE versions), is that the Insert/Edit
 Link dialog does not pop up if editing a Page on the Admin side - I suspect
 this is because it is behind https/SSL here, and something is going wrong
 there.

 The error given in Firebug is Blocked loading mixed active content
 http://mydomain.com/displayable_links.js;
 http://mydomain.com/displayable_links.js
 Is there a workaround for loading the Filebrowser/TinyMCE content when
 behind https?

 There used to be an issue with the 'asset_proxy' prefix that could be
 solved by substituting the SLL Middleware, but I don't think that's the
 smart thing to do.

 These two are possibly the last hurdles I need resolved before upgrading
 my site to Mezzanine 4.

 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.


[mezzanine-users] Re: TinyMCE4 - Problems on deployed site

2015-07-23 Thread Danny

I'm now convinced that both of my issues are https/SSL related.

The media library image select works under https but not http, because 
the Media library browser is under the /admin path (which is https)
The insert/edit link box relies on displayable_links.js which is http, 
so it works through the 'front' side but not under admin.


Has anyone managed to get this working on a site with SSL enabled for 
the /admin path?


Seeya. Danny.

On 23/07/2015 1:08 PM, Danny wrote:

Hi all,

I'm hoping someone can either replicate my issue or help me debug it.

Using Mezzanine master (as of 23/7/15), on my deployed site, I can't 
select an image from the Media Library to insert it into a page when 
Inserting/Editing an image.
This is editing via the main site's Yellow EDIT buttons, not on the 
admin side. (on the Admin side, it works)


i.e. this button:


The javascript error shown in the Firebug console is Error: 
Permission denied to access property tinymce on FB_TinyMCE4.js line 
4, col 8


That script is, with line 4 in bold:
var FileBrowserDialogue = {
fileSubmit : function (FileURL) {
parentWin = (!window.frameElement  window.dialogArguments) 
|| opener || parent || top;

*tinymce = tinyMCE = parentWin.tinymce;*
self.editor = tinymce.EditorManager.activeEditor;
self.params = self.editor.windowManager.getParams();
parentWin.document.getElementById(self.params.input).value = FileURL;
self.editor.windowManager.close(parentWin);
}
};

The same actions work perfectly fine when running development/DEBUG=True.

The other problem that still persists in Mezzanine 4 (and has been 
around for a while, even with earlier TinyMCE versions), is that the 
Insert/Edit Link dialog does not pop up if editing a Page on the Admin 
side - I suspect this is because it is behind https/SSL here, and 
something is going wrong there.


The error given in Firebug is Blocked loading mixed active content 
http://mydomain.com/displayable_links.js;
Is there a workaround for loading the Filebrowser/TinyMCE content when 
behind https?


There used to be an issue with the 'asset_proxy' prefix that could be 
solved by substituting the SLL Middleware, but I don't think that's 
the smart thing to do.


These two are possibly the last hurdles I need resolved before 
upgrading my site to Mezzanine 4.


Seeya. Danny.

--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - 
http://cityofsmallgods.org.au


*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

The Discworld Grand Tour - Adelaide SA, August 4-6, 2017



--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

The Discworld Grand Tour - Adelaide SA, August 4-6, 2017

--
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] Easy way to grab data from an installed app in the templates

2015-07-15 Thread Danny

On 16/07/2015 7:30 AM, Brandon Keith Biggs wrote:

Hello,
Is there an easy way to create template variables and functions 
without modifying the site urls?

Perhaps in mezzanine_tags or something?
A variable like
{{ mezzanine.my_app.my_variable }}
would be fine.
Is this what page can help with? I want to use these variables in my 
custom theme.

thank you,


I think what you might be looking for is to create your own setting, and 
then use it in a template, right?


http://mezzanine.readthedocs.org/en/latest/configuration.html

Basically:
In your app, create a defaults.py, and use register_setting() to create 
the variable you want.
It can be editable in the admin if you like, or just configurable via 
settings/local_settings.py


Then you'll need to update TEMPLATE_ACCESSIBLE_SETTINGS so that your new 
setting is listed there,

making it accessible within templates.

And then you should be able to just reference {{settings.variable}} in 
any template that has mezzanine_tags loaded.


For example, I have in my app's defaults.py:

register_setting(
name=SOCIAL_FACEBOOK,
description=Link to Facebook Page. Include http prefix.,
editable=True,
default=,
)
register_setting(
name=TEMPLATE_ACCESSIBLE_SETTINGS,
append=True,
default=(SOCIAL_FACEBOOK,),
)

And then in my base.html:

{% load mezzanine_tags ... %}
...
{% if settings.SOCIAL_FACEBOOK %}
a href={{ settings.SOCIAL_FACEBOOK }}Facebook/a
{% endif %}

So this allows me to add a link to my Facebook page in the admin 
(Settings section) and have that link show up on every page of the site 
via the base.html template.


Seeya. Danny.


--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

The Discworld Grand Tour - Adelaide SA, August 4-6, 2017

--
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 4.0 is released

2015-07-09 Thread Danny
On 10 July 2015 at 10:27, Stephen McDonald st...@jupo.org wrote:




 On Fri, Jul 10, 2015 at 9:40 AM, Danny molo...@gmail.com wrote:

 On 10 July 2015 at 08:34, Stephen McDonald st...@jupo.org wrote:

 Hi all,

 The new 4.0 release of Mezzanine is finally up on PyPI after 10 months
 since the last release - a lot has happened! The project site (
 mezzanine.jupo.org) hasn't been upgraded yet, that will happen shortly.



 Congratulations to Stephen and all contributors! I look forward to
 upgrading soon![1]

 Seeya. Danny.
 [1] My site relies on Cartridge, so I'm going to wait until that's
 brought up to date as well, I know it can't be far behind.


 You should be good to go using the dev branch of Cartridge - the only work
 left to do with it is bring it up to date when creating new projects, which
 presumably doesn't affect you. I've just deployed latest Mezzanine +
 Cartridge dev branch plus Django 1.8 to the project site and it works.


Thanks, I'll give it a shot this weekend.

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.


Re: [mezzanine-users] creating projects with latest build

2015-07-09 Thread Danny
If you look in
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/management/commands/createdb.py
You'll see it should create the default admin user as 'admin' with password
'default'.

Try to log in to the admin side with that.

Although, I would have thought that unless you specified --noinput it would
have prompted you for this sort of information... maybe that's changed.

Seeya. Danny.

On 10 July 2015 at 12:28, Brandon Keith Biggs brandonkeithbi...@gmail.com
wrote:

  Hello,
 I just created a project with the latest build and I did not get asked to
 create a super-user. There are also no setting files in my project. I did:
 mezzanine-project project1
 cd project1
 python manage.py createdb
 python manage.py runserver

 and my site went up perfectly, but no super-user was set.
 thanks,

 --
 Brandon Keith Biggs http://www.brandonkeithbiggs.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.
 For more options, visit https://groups.google.com/d/optout.




-- 
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* -
http://ausdwcon.org
The Discworld Grand Tour - Adelaide SA, August 4-6, 2017

-- 
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 4.0 is released

2015-07-09 Thread Danny
On 10 July 2015 at 08:34, Stephen McDonald st...@jupo.org wrote:

 Hi all,

 The new 4.0 release of Mezzanine is finally up on PyPI after 10 months
 since the last release - a lot has happened! The project site (
 mezzanine.jupo.org) hasn't been upgraded yet, that will happen shortly.



Congratulations to Stephen and all contributors! I look forward to
upgrading soon![1]

Seeya. Danny.
[1] My site relies on Cartridge, so I'm going to wait until that's brought
up to date as well, I know it can't be far behind.

-- 
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: Trouble with django version

2015-06-22 Thread Danny

On 20/06/2015 5:11 PM, Mathias Ettinger wrote:
To complete my previous answer you can specify the commit you wish to 
use to pip instead of HEAD/master


Cartridge was still compatible with mezzanine before the merge of PR 
#1265 and will be as soon as we report the changes back to it.


Just use a commit number that is before this merge (for instance the 
one I gave you previously) and you will have compatibility:


pip install -e 
git+https://github.com/stephenmcd/mezzanine.git@the_commit_you_d_like_to_get#egg=Mezzanine 
https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fstephenmcd%2Fmezzanine.git%23egg%3DMezzanine-mastersa=Dsntz=1usg=AFQjCNHCsSEd9DN-Hl0kGx_jPQbE_KD2Eg
pip install -e 
git+https://github.com/stephenmcd/cartridge.git#egg=Cartridge 
https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fstephenmcd%2Fmezzanine.git%23egg%3DMezzanine-mastersa=Dsntz=1usg=AFQjCNHCsSEd9DN-Hl0kGx_jPQbE_KD2Eg




This is definitely the way to go. I have the following line in my 
requirements.txt and am using it with cartridge[1] without any issues 
against Django 1.8.2


-e 
git+https://github.com/stephenmcd/mezzanine.git@23c1375fc4b8de400a75a4a0d1ec19e941164d76#egg=Mezzanine



Seeya. Danny.
[1] I'm working with my own fork of cartridge, my last merge from 
stephenmcd/master was 7178e4f8825e2e83bd34369beb7f9b646f476439






Le samedi 20 juin 2015 08:42:27 UTC+2, Aman Garg a écrit :

As I mentioned earlier, the problem is that when using the
development version, I am unable to install cartridge for that
version. It seems cartridge is only compatible presently with the
release version.

On Saturday, 20 June 2015 02:38:43 UTC+5:30, Mathias Ettinger wrote:

By the time cartridge gets updated as well, you could try
using a compatible version of mezzanine. Like

https://github.com/stephenmcd/mezzanine/tree/a0df8300ed943fdae89b6f517f8ad54986ac9afd

https://github.com/stephenmcd/mezzanine/tree/a0df8300ed943fdae89b6f517f8ad54986ac9afd

--
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 
mailto:mezzanine-users+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

The Discworld Grand Tour - Adelaide SA, August 4-6, 2017

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

2015-06-13 Thread Danny

On 14/06/2015 3:31 AM, automotive...@gmail.com wrote:

Trying to figure out how to change the url for the search results page.

I see
|
form action={% url search %}
|

and that forms domain.com/search_results.html/?q=query

but I would much rather have: domain.com/search?=query

Been searching thru docs and can't seem to find what I need to do 
that, can someone point in the right direction?


The URL 'search' is defined here:
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/urls.py#L24

which uses the view named search defined here:
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/views.py#L106

Which uses a template called search_results.html

I suspect if you look through that function you can probably work out 
how it's changing the URL in your browser,
and if you want to change it, you may need to copy and rename the 
template, and then override the url to pass in your template name instead.


HTH. HAND.

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.


Re: [mezzanine-users] postgres content/data syncing between development production

2015-06-09 Thread Danny

On 9/06/2015 11:47 PM, Ken Bolton wrote:

Hi Vikraw,

Sorry if I added to the confusion.

Mezzanine does not move content for you. The commands I pointed out 
can be interpreted and extrapolated into normal command-line commands 
to do database backup and restore. Moving the backups is an exercise 
left up to the reader.



Hi Vikraw,

If you want to dump the database straight from postgresql on your local 
development server, you can run pg_dump or pg_dumpall there, (and then 
psql on the deployed server), but it's mostly designed to do an entire 
database or *all* databases.


The other alternative would be to use python manage.py dumpdata on your 
dev server and the loaddata equivalent on the deployed server - check 
the help for dumpdata to see how to dump just the tables for one app, or 
even one table itself.


(e.g. you'll want to dump and load shop.products but probably not 
shop.orders)


I found this site quite useful for a few different dumpdata/loaddata 
options:

https://coderwall.com/p/mvsoyg/django-dumpdata-and-loaddata

Seeya. Danny.



hth.

ken

On Tue, Jun 9, 2015 at 10:07 AM, vikraw vik...@gmail.com 
mailto:vik...@gmail.com wrote:


So, what i understand is that both backup and restore tasks are
run on the Depoyment/remote machine.
when i do - fab deploy
  backup is taken (last.db) before any other tasks.
  restore is never called for task deploy

South schema migrations are added to the directories in apps.
these are uploaded to github and applied to remote machine. then a
migrate command is run.

But i am still confused how does the local database changes
(adding new products) are applied to remote database? Is this also
taken care by South (data migration..)..
Because for me whenever i add a new page Or a product it never
appears on the remote machine unless I copy my local database to
remote manually

Not sure what is not working for me.. Is it South migrations or
another issues.
-- 
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
mailto: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 
mailto: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: No such table error

2015-05-31 Thread Danny
Have you run 'python manage.py makemigrations theme' to create the
migrations for your app in the first place?
Do this before running 'python manage.py migrate theme'.

Hope this helps.

On 1 June 2015 at 08:40, Jean de la Croix Ki kigui.j...@gmail.com wrote:

 I've taken a look in my database and saw that there isn't the table
 inside. Be sure, I've executed syncdb and I've done the migrations as
 recommended with south so I don't understand why the table is not there...
 Thanks for your help.


 On Sunday, 31 May 2015 21:03:53 UTC, Jean de la Croix Ki wrote:

 Hi group, I need your help to solve the next error. I don't understand
 what is happenning... First, here is what looks my modelclass
 Chambre(models.Model):categorie =
 models.CharField(max_length=255, help_text=)nombre =
 models.IntegerField()

 and second, the error I get:

 OperationalError at /admin/theme/chambre/

 no such table: theme_chambre

 Request Method:GETRequest 
 URL:http://127.0.0.1:8000/admin/theme/chambre/Django
 Version:1.6.7Exception Type:OperationalErrorException Value:

 no such table: theme_chambre

 Exception 
 Location:/usr/lib64/python3.3/site-packages/django/db/backends/sqlite3/base.py
 in execute, line 452Python Executable:/usr/bin/python3Python Version:
 3.3.2Python Path:

 ['/home/jea/Sites/ibahotel',
  '/usr/lib/python3.3/site-packages/setuptools-5.7-py3.3.egg',
  '/usr/lib/python3.3/site-packages/pip-1.5.6-py3.3.egg',
  '/usr/lib64/python33.zip',
  '/usr/lib64/python3.3',
  '/usr/lib64/python3.3/plat-linux',
  '/usr/lib64/python3.3/lib-dynload',
  '/usr/lib64/python3.3/site-packages',
  '/usr/lib/python3.3/site-packages',
  '/home/jea/Sites']



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




-- 
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* -
http://ausdwcon.org
The Discworld Grand Tour - Adelaide SA, August 4-6, 2017

-- 
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] [Django] ERROR: Invalid HTTP_HOST header: 'domain.com'.You may need to add u'domain.com'

2015-05-30 Thread Danny

On 31/05/2015 1:34 PM, vikraw wrote:
I know there exists a similar post/thread before and I have posted 
there also, but I didn't see any solutions to stop getting those 
messages. I am getting around 20-30 such emails in a day



snip

I am getting the errors for my server's IP address
 Invalid HTTP_HOST header: 'x.x.x.x'. You may need to add u'x.x.x.x' 
to ALLOWED_HOSTS.


BUT also for  so many suspicious names like this
- Invalid HTTP_HOST header: '4331780'.You may need to add u'4331780' 
to ALLOWED_HOSTS.
-  Invalid HTTP_HOST header: 'testp1.piwo.pila.pl'.You may need to add 
u'testp1.piwo.pila.pl' to ALLOWED_HOSTS.
-  Invalid HTTP_HOST header: 'www.cloud.ph'.You may need to add 
u'www.cloud.ph' to ALLOWED_HOSTS


All of them say the following

No stack trace available
Request repr() unavailable.


These emails are generally rather unhelpful, especially because of the 
lack of back trace - which means you don't really know which URL was 
used that caused the error (prior to Django 1.6, I would see the 
backtrace and it appeared that it was bots attempting to access, e.g. 
admin.php which don't exist on a Django server).


If you're happy to just ignore them, you can get nginx to do that for 
you so that the requests don't even hit Django/Mezzanine.


I put the following in my nginx configuration file and haven't received 
an email like that since:


# deny illegal host headers

if ($host !~* ^mydomain.com$ ) {

return 444;

}

Of course, you'll need to update this based on the domains you do want 
to allow.

See e.g. http://stackoverflow.com/a/17477436/653093

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.


Re: [mezzanine-users] Price Rounding Off Issues

2015-05-24 Thread Danny
:.
For more options, visit https://groups.google.com/d/optout
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 
mailto:mezzanine-users+unsubscr...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* - 
http://ausdwcon.org

The Discworld Grand Tour - Adelaide SA, August 4-6, 2017

--
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 page summary with a link to the whole page

2015-05-22 Thread Danny

On 23/05/2015 9:12 AM, Jean de la Croix Ki wrote:

Hi group;
I want to know how is it possible to create page and just put it 
summary and a link to it on my home page. How to achieve this ?




My home page shows some of the summaries of the blog posts on the front 
page - you could probably do this in your template
for other pages as well. The key thing, I think,  is the 
'truncatewords_html' filter that Django provides, it allows you show a 
short snippet from another page/other content.


In my index.html template:

{% block main %}

{% blog_recent_posts 3 as recent_posts %}
{% if recent_posts %}
div class=panel
h2a href=/blogLatest News/a/h2
{% for blog_post in recent_posts %}
h3
a href={{ blog_post.get_absolute_url }}{{ blog_post.title }}/a
/h3
h6 class=post-meta
{% trans Posted by %}: {% with blog_post.user as author %} a 
href={% url blog_post_list_author author %}{{ 
author.get_full_name|default:author.username }}/a {% endwith %}
{% blocktrans with sometime=blog_post.publish_date|timesince %}{{ 
sometime }} ago{% endblocktrans %}

/h6
div class=recent-summary
{{ blog_post.content|safe|truncatewords_html:100 }}
p class=blog-list-detail
a href={{ blog_post.get_absolute_url }}{% trans read more %}/a
/p
/div
{% endfor %}
pa href=/blogiRead more news/i/a/p
/div
{% endif %}

{% endblock %}

Hope this helps!

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.


[mezzanine-users] The Orderable move buttons

2015-05-14 Thread Danny

Hi all,

I'm doing a new development using Mezzanine master and Django 1.8.1, and 
I've got a model that derives from Orderable,

with appropriate admin stuff set up for it too.

In Mezzanine 3.1.10, the _order field was just an integer, so it was 
easy to edit, but with the latest mezzanine, it's now been replaced with 
the wonderful drag-and-drop arrows. Except, for my new model, they don't 
drag and drop!


Is there something I'm missing with respect to admin setup, or 
templates/css/js that I need to add so that the new model has the same 
drag/drop functionality as e.g. pages or the inlines for form fields?


I did have a look at, e.g. 
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/static/mezzanine/js/admin/dynamic_inline.js#L43 
but am not sure if there's something subtle I'm missing that I need to 
do to make it work.
Is it possible I need to install grapelli_safe from github master as 
well? (I haven't done that yet, just using what's on PyPi)


Thanks,

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.


Re: [mezzanine-users] The Orderable move buttons

2015-05-14 Thread Danny
On 15 May 2015 at 09:49, Stephen McDonald st...@jupo.org wrote:




 That is a problem - the admin support is only designed for inlines.

 I think there was a thread on here just the other day about a third party
 lib for top-level ordering.


Think I found it, Eduardo mentioned django-admin-sortable.

https://github.com/iambrandontaylor/django-admin-sortable

I'll have a look how that one works.

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.


Re: [mezzanine-users] The Orderable move buttons

2015-05-14 Thread Danny
On 15 May 2015 at 09:21, Stephen McDonald st...@jupo.org wrote:



 On Fri, May 15, 2015 at 7:45 AM, Danny molo...@gmail.com wrote:

 Hi all,

 I'm doing a new development using Mezzanine master and Django 1.8.1, and
 I've got a model that derives from Orderable,
 with appropriate admin stuff set up for it too.

 In Mezzanine 3.1.10, the _order field was just an integer, so it was
 easy to edit, but with the latest mezzanine, it's now been replaced with
 the wonderful drag-and-drop arrows. Except, for my new model, they don't
 drag and drop!


 These have always been drag/drop - the previous behaviour you've seen was
 a bug. Likely candidate is JavaScript not being hosted correctly. Anyway
 you're now seeing what should have always worked :-)


Yeah, I realised that - but the bug earlier made it easy to modify the
order :D





 Is there something I'm missing with respect to admin setup, or
 templates/css/js that I need to add so that the new model has the same
 drag/drop functionality as e.g. pages or the inlines for form fields?


 Take a look at the models and admin classes in mezzanine.forms that makes
 full use of this, particularly the admin class for your inlines:
 https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/forms/admin.py#L38



I think the problem I'm facing is that the Orderable object is a top-level
model, not something that's inlined within another model - so it doesn't
need the Add another part that the Tabular/Stacked Inline Admin templates
provide, nor do I need to do the re-ordering within another model.

It's probably more akin to Pages, but without the need for the nested
hierarchy. I've a feeling I may need to create a new template/javascript
that behaves like the inline ordering js, but works on items that are not
inlines. I'll do some more investigation.

Seeya. Danny.




 I did have a look at, e.g.
 https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/core/static/mezzanine/js/admin/dynamic_inline.js#L43
 but am not sure if there's something subtle I'm missing that I need to do
 to make it work.
 Is it possible I need to install grapelli_safe from github master as
 well? (I haven't done that yet, just using what's on PyPi)

 Thanks,

 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.




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




-- 
*Danny Sag*
Chairperson
Round World Events SA, Inc
City of Small Gods Terry Pratchett Fan Club - http://cityofsmallgods.org.au

*Nullus Anxietas VI - The Australian Discworld Convention* -
http://ausdwcon.org
The Discworld Grand Tour - Adelaide SA, August 4-6, 2017

-- 
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] Filetypes for Media Library

2015-03-25 Thread Danny

Hi all,

Probably a very simple question, but where are the filetypes for the 
Media Library defined, and can I override them?


If I go into my Media Library, and choose to Upload a file, the file 
browser window I'm presented with has the following options:


*.html; *.py; *.js; *.css; *.jpg; *.jpeg; ... and several more

However, some useful ones are missing (like MS Word's docx) and
even this selected list fails to show up PDFs in my current directory 
even though *.pdf is one of the options (I suspect it's too long for 
Windows liking).


The other bad thing is that the file type drop down doesn't have the 
All Files (*.*) option that you may be used to seeing.


I'm sure that there would be a nice easy setting somewhere that controls
this, the question is: where is it?

Thanks,

Seeya. Danny.

--
Email: molo...@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.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Filetypes for Media Library

2015-03-25 Thread Danny
Thanks Josh, super helpful :D Works like a charm - the name of the 
settings to put in my own settings.py are FILEBROWSER_EXTENSIONS and 
FILEBROWSER_SELECT_FORMATS but that was fairly obvious from the code you 
pointed to.


I find it somewhat curious that, for, e.g. the Media Library upload, the 
file dialog shows a concatenation of all the EXTENSIONS available 
(rather than just say All Files), whereas if you choose to upload an 
image for a product, it actually gives All Files rather than 
restricting it to images...


Haven't tried the Gallery, but given your pointer to the code, I'd 
assume there it's restricted to Images...


Seeya. Danny.

On 26/03/2015 12:53 AM, Josh Cartmell wrote:

Hi Danny, they are defined here:
https://github.com/stephenmcd/filebrowser-safe/blob/master/filebrowser_safe/settings.py#L43

You can override either EXTENSIONS or SELECT_FORMATS or both in your
projects settings.py file.  The SELECT_FORMS are what filebrowser uses
to determine what are valid extensions for a particular FileField.  For
example, in Mezzanine's galleries,
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/galleries/models.py#L120,
the format of the image FileField is set to Image.

Good luck!

On Wed, Mar 25, 2015 at 2:34 AM, Danny molo...@gmail.com
mailto:molo...@gmail.com wrote:

Hi all,

Probably a very simple question, but where are the filetypes for the
Media Library defined, and can I override them?

If I go into my Media Library, and choose to Upload a file, the file
browser window I'm presented with has the following options:

*.html; *.py; *.js; *.css; *.jpg; *.jpeg; ... and several more

However, some useful ones are missing (like MS Word's docx) and
even this selected list fails to show up PDFs in my current
directory even though *.pdf is one of the options (I suspect it's
too long for Windows liking).

The other bad thing is that the file type drop down doesn't have the
All Files (*.*) option that you may be used to seeing.

I'm sure that there would be a nice easy setting somewhere that controls
this, the question is: where is it?

Thanks,

Seeya. Danny.

--
Email: molo...@gmail.com mailto:molo...@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+unsubscribe@__googlegroups.com
mailto:mezzanine-users%2bunsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/__optout
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
mailto:mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.




--
Email: molo...@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.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] How to hide product unavailable for purchase on the web page?

2015-02-04 Thread Danny

On 5/02/2015 4:27 PM, Wesley wrote:

Hi guys,
   I have a question that,how to hide product with unavailable for
purchase on the page?

I see that, it's showing on the page, but only says no in stock when
click into the detail product page.

So, how to directly make it hidden from product list on the page?

I tried to select draft or even make it out-of-date, but get the same
behavior.



Draft is the way to go - only admin users will see it then.

Log out of your account (or view your site in a different browser) and 
you'll notice that the product isn't listed.


Seeya. Danny.


--
Email: molo...@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.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] TabularDynamicInlineAdmin and Orderable

2015-01-23 Thread Danny
Try putting Orderable as the first baseclass, I think that's what's 
worked for me in past.


On 24/01/2015 8:25 AM, Sam Kingston wrote:

Hi guys,

Should TabularDynamicInlineAdmin allow ordering on an inline class whose
model subclasses Orderable?

For instance, *admin.py*:

from mezzanine.core.admin import TabularDynamicInlineAdmin

from .models import Card

class CardInlineAdmin(TabularDynamicInlineAdmin):
 model = Card.pages.through

from mezzanine.pages.admin import PageAdmin
PageAdmin.inlines += (CardInlineAdmin,)

*models.py*:

class Card(Displayable, RichText, Orderable):
 pages = models.ManyToManyField(Page)

 class Meta:
 ...

This yields the correct Tabular inline on the PageAdmin model, but
doesn't let me drag'n'drop to order.

Am I going about this the wrong way?

Thanks

Sam

--
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
mailto:mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.




--
Email: molo...@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.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Re: PyCharm Unable to Install Mezzanine

2014-10-28 Thread Danny

On 29/10/2014 6:53 AM, chuck wrote:

I also ran into an error. Below is the 'dump' from my attempt.  Would know
to know to get around this.

Install packages failed: Error occurred when installing package Mezzanine.



snip


 building 'PIL._imaging' extension


It seems to fall over when building PIL/pillow, as the traceback shows.

The actual ValueError is being thrown from within the distutils there,
when it's looking for the MSVC compiler, trying to find a vcvarsall.bat 
to run.


Do you have Microsoft Visual C++ installed? If not, download the Express
version (I guess 2012 or 2013, whatever's the latest) and install it
and see if you can install pillow first, before trying for Mezzanine.

I've not tried running Mezzanine on Windows before, but it's probably 
possible (it's much easier on Linux, however).


It might be that pillow doesn't build with the latest MSVC++ which might 
mean you need to find an older version (like 2010), which is a bit

trickier to find via Microsoft's website.

Hope this helps.

Seeya. Danny.



 Traceback (most recent call last):
   File string, line 1, in module
   File C:\Users\cmedcoff\AppData\Local\Temp\pycharm-
packaging2251339524416707976.tmp\pillow\setup.py, line 757, in module
 zip_safe=True,
   File C:\Python27\Lib\distutils\core.py, line 151, in setup
 dist.run_commands()
   File C:\Python27\Lib\distutils\dist.py, line 953, in run_commands
 self.run_command(cmd)
   File C:\Python27\Lib\distutils\dist.py, line 972, in run_command
 cmd_obj.run()
   File C:\Users\cmedcoff\MezzVE\lib\site-
packages\setuptools\command\install.py, line 53, in run
 return _install.run(self)
   File C:\Python27\Lib\distutils\command\install.py, line 563, in run
 self.run_command('build')
   File C:\Python27\Lib\distutils\cmd.py, line 326, in run_command
 self.distribution.run_command(command)
   File C:\Python27\Lib\distutils\dist.py, line 972, in run_command
 cmd_obj.run()
   File C:\Python27\Lib\distutils\command\build.py, line 127, in run
 self.run_command(cmd_name)
   File C:\Python27\Lib\distutils\cmd.py, line 326, in run_command
 self.distribution.run_command(command)
   File C:\Python27\Lib\distutils\dist.py, line 972, in run_command
 cmd_obj.run()
   File C:\Python27\Lib\distutils\command\build_ext.py, line 337, in
run
 self.build_extensions()
   File C:\Users\cmedcoff\AppData\Local\Temp\pycharm-
packaging2251339524416707976.tmp\pillow\setup.py, line 613, in
build_extensions
 build_ext.build_extensions(self)
   File C:\Python27\Lib\distutils\command\build_ext.py, line 446, in
build_extensions
 self.build_extension(ext)
   File C:\Python27\Lib\distutils\command\build_ext.py, line 496, in
build_extension
 depends=ext.depends)
   File C:\Python27\Lib\distutils\msvc9compiler.py, line 473, in
compile
 self.initialize()
   File C:\Python27\Lib\distutils\msvc9compiler.py, line 383, in
initialize
 vc_env = query_vcvarsall(VERSION, plat_spec)
   File C:\Python27\Lib\distutils\msvc9compiler.py, line 299, in
query_vcvarsall
 raise ValueError(str(list(result.keys(
 ValueError: [u'path']



--
Email: molo...@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.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] User's choice of shipping method in cartridge

2014-10-23 Thread Danny S
Thanks for this Josh.

I managed to get an implementation working using the ideas you have 
suggested.

Seeya. Danny.

On Thursday, 9 October 2014 01:11:55 UTC+10:30, Josh Cartmell wrote:

 Hey Danny, I don't have code available that I could let you look at right 
 now, but I have done something similar.

 To do this I made a custom order form for Cartridge using the setting 
 SHOP_CHECKOUT_FORM_CLASS.

 Make it inherit from the default OrderForm and then add a field allowing 
 the user to select a shipping method:

 from cartridge.shop.forms import OrderForm

 class CustomOrderForm(OrderForm):
 shipping_method = forms.ChoiceField(choices=SHIPPING_CHOICES)

 The following will assume you have the checkout steps split.


1. In your shipping handler calculate the cost of each shipping 
method, at that point I would store it in the session, since the user 
hasn't selected a shipping method yet, don't set the shipping.
2. In the init for your Custom order form check if you are on the 
payment step and if the session data that is stored by the shipping 
handler, is present, if so update the choices for shipping method to have 
their associated costs.
At this point I would probably delete the data from the session in 
case the user later goes back in the checkout process and changes their 
address.
3. Display the shipping method select on the payment screen.
4. In the payment handler do the normal payment stuff, but also call 
the Cartridge set_shipping method
^ that's not exactly what you are supposed to do, but I don't think 
there is anything preventing you from calling set_shipping not in the 
shipping handler.

 In my case, I didn't have the checkout steps split and didn't precalculate 
 the shipping costs, I just let the user see the shipping cost on order 
 confirm page but I think the above should work to do what you want.

 On Tue, Oct 7, 2014 at 6:19 PM, Danny S mol...@gmail.com javascript: 
 wrote:

 Hi,

 I was just wondering if anyone has previously implemented an add-on to 
 cartridge which allows a user to select the shipping method?

 I know that with a billship_handler I could use a shipping address to 
 determine the available types of shipping and their costs, but what if 
 there's a choice of more than one?
 e.g Pick up (free), basic ($X), express ($Y).

 Ideally, after the user has completed their address info, they would be 
 presented with a dropdown to choose their preferred shipping method, and 
 then that gets added to the cart total
 before moving to the payment step of checkout.

 If anyone has done something similar, is it possible for me to take a 
 look at your code?

 Thanks,

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


Re: [mezzanine-users] Mezzanine.generic issues with South

2014-09-14 Thread Danny

On 15/09/2014 6:05 AM, Avery Laird wrote:

Hi,

I'm having an issue with migrating certain apps. The problem seems to be
well known, although I find myself unsure about how to fix it. I get the
following message when trying to migrate:

Your project contains migrations that include one of the fields
 from mezzanine.generic in its Migration.model dict: possibly
 KeywordsField, CommentsField or RatingField. These migratons no
 longer work with the latest versions of Django and South, so you'll
 need to fix them by hand. This is as simple as commenting out or
 deleting the field from the Migration.model dict.
 See http://bit.ly/1hecVsD for an example.

The unsynced apps are:
  - zeni_core
  - cartridge.shop
  - mezzanine.conf
  - mezzanine.core
  - mezzanine.generic
  - mezzanine.blog
  - mezzanine.forms
  - mezzanine.pages
  - mezzanine.galleries
  - mezzanine.twitter
  - mezzanine_events

 From what I understand, I must comment out all references
to KeywordsField, CommentsField or RatingField in the apps
Migration.model dictionary (all apps except for mezzanine ones).
However, after a cursory search through a single apps migration files, I
found multiple instances in just a single migration file, of which there
where about 25 files, and that's just a single app. Am I searching for
the wrong thing? Do I have to go through and make all those changes by
hand, or is there a way to streamline the process? Any help or insight
would be greatly appreciated!


I think this was to do with a Django upgrade.

Go through the files in your migrations folder and comment out the lines 
referencing keywords, comments or ratings. You should hopefully only 
have to do this in your custom app.


(I have a customised fork of cartridge and had to do it there, but you 
might be able to get away with only doing it in your app zeni_core)


Seeya. Danny.



Thanks,

Avery



--
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
mailto:mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.




--
Email: molo...@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.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] NoneType takes no arguments when registering settings

2014-07-10 Thread Danny


On 10/07/2014 10:07 PM, Fredrik Blomqvist wrote:

I'm trying to register a couple of settings, but as soon as I try to set
one of them (in the admin interface) I get a NoneType takes no
arguments error, until I restart the server (the settings are all empty
after that, aka nothing gets saved).


I'm assuming these are in your defaults.py?

Add default= to the new settings, that might be the only trick required.

BTW, your TEMPLATE_ACCESSIBLE_SETTINGS call probably doesn't need 
description or editable, as you've got the append=True so it'll

take those properties from the one defined before.

I've pasted some of my code below yours quoted below.

HTH. HAND.

Seeya. Danny.



Here's the code:

from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import register_setting


register_setting(
 name=TEMPLATE_ACCESSIBLE_SETTINGS,
 description=_(Sequence of setting names available within
templates.),
 editable=False,
 default=(SOCIAL_LINK_FACEBOOK, SOCIAL_LINK_INSTAGRAM),
 append=True,
)
register_setting(
 name=SOCIAL_LINK_FACEBOOK,
 label=_(Facebook link),
 description=_(If present a Facebook icon linking here will be
in the header.),
 editable=True,
)
register_setting(
 name=SOCIAL_LINK_INSTAGRAM,
 label=_(Instagram link),
 description=_(If present a Instagram icon linking here will be
in the header.),
 editable=True,
)



And here is the traceback:

Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.6.5
Python Version: 3.4.0
Installed Applications:
('mezzanine.boot',
  'django.contrib.auth',
  'django.contrib.contenttypes',
  'django.contrib.redirects',
  'django.contrib.sessions',
  'django.contrib.sites',
  'django.contrib.sitemaps',
  'django.contrib.staticfiles',
  'theme',
  'mezzanine.conf',
  'mezzanine.core',
  'mezzanine.generic',
  'mezzanine.blog',
  'mezzanine.forms',
  'mezzanine.pages',
  'mezzanine.galleries',
  'mezzanine.twitter',
  'filebrowser_safe',
  'south',
  'grappelli_safe',
  'django.contrib.admin',
  'django.contrib.comments')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
  'django.middleware.locale.LocaleMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware',
  'django.middleware.common.CommonMiddleware',
  'django.middleware.csrf.CsrfViewMiddleware',
  'django.contrib.messages.middleware.MessageMiddleware',
  'mezzanine.core.request.CurrentRequestMiddleware',
  'mezzanine.core.middleware.RedirectFallbackMiddleware',
  'mezzanine.core.middleware.TemplateForDeviceMiddleware',
  'mezzanine.core.middleware.TemplateForHostMiddleware',
  'mezzanine.core.middleware.AdminLoginInterfaceSelectorMiddleware',
  'mezzanine.core.middleware.SitePermissionMiddleware',
  'mezzanine.pages.middleware.PageMiddleware')

Traceback:
File

/home/fgblomqvist/.virtualenvs/mezzanine-test-env3/lib/python3.4/site-packages/django/core/handlers/base.py
in get_response
   105. response = middleware_method(request,
callback, callback_args, callback_kwargs)
File

/home/fgblomqvist/.virtualenvs/mezzanine-test-env3/lib/python3.4/site-packages/mezzanine/pages/middleware.py
in process_view
   103. response = view_func(request, *view_args,
**view_kwargs)
File

/home/fgblomqvist/.virtualenvs/mezzanine-test-env3/lib/python3.4/site-packages/mezzanine/pages/views.py
in page
   100. return render(request, templates, extra_context or {})
File

/home/fgblomqvist/.virtualenvs/mezzanine-test-env3/lib/python3.4/site-packages/mezzanine/utils/views.py
in render
   163. context_instance = RequestContext(request, dictionary)
File

/home/fgblomqvist/.virtualenvs/mezzanine-test-env3/lib/python3.4/site-packages/django/template/context.py
in __init__
   169. self.update(processor(request))
File

/home/fgblomqvist/.virtualenvs/mezzanine-test-env3/lib/python3.4/site-packages/mezzanine/conf/context_processors.py
in settings
   45. settings_dict[k] = getattr(settings, k, )
File

/home/fgblomqvist/.virtualenvs/mezzanine-test-env3/lib/python3.4/site-packages/mezzanine/conf/__init__.py
in __getattr__
   184. self._load()
File

/home/fgblomqvist/.virtualenvs/mezzanine-test-env3/lib/python3.4/site-packages/mezzanine/conf/__init__.py
in _load
   148. setting_value = type_fn(setting_obj.value)
Exception Type: TypeError at /
Exception Value: NoneType takes no arguments


Regards, Fredrik



My code is basically this:


from django.conf import settings
from

Re: [mezzanine-users] Re: [Django] ERROR: Invalid HTTP_HOST header: 'domain.com'.You may need to add u'domain.com' to..

2014-05-26 Thread Danny
Hi Jared,

I don't think that's Federico's issue.

I have my ALLOWED_HOSTS set to the domain name(s) I allow, but quite often
will get the error email with my site's IP address, which is not in
ALLOWED_HOSTS (as I don't want people accessing the site using the IP). I
suspect it's some malicious bot out there trying to run some sort of
exploit on the site, and the error from Django is just an indication that
this is happening.

Prior to Django 1.6, I would get these errors as proper error reports with
a full traceback, sent to me via Error stack (I have some handlers set up
in my code for this). Usually the access was to admin.php or some other
non-existent PHP file. However, since moving to Django 1.6/Mezzanine 3.x
only the email errors come directly from Django - with a repr()
unavailable message instead of a traceback, and the handlers set up in my
settings.py are completely skipped.

I'm not sure what changed so that this sort of error is not passed to my
custom error handler, but it's not something that's easy to replicate for
testing purposes, so I'm basically just ignoring the messages...

Any pointers as to how to get these error messages sent with a proper
traceback, or to be passed to my error handler (and thus to ErrorStack)
would be greatly appreciated.

All the best,

Seeya. Danny.


On 27 May 2014 07:53, Jared Nielsen nielsen.ja...@gmail.com wrote:

 Hi Federico,
 If you're using NGINX you can add a rewrite to your sites .conf file.

 http://jarednielsen.com/blog/how-to-configure-server-name-redirect-in-nginx/
 I was receiving the same error (and an inbox full of Django notices) but
 fixed it with the solution linked above.
 Cheers.

 On Monday, May 26, 2014 5:34:23 AM UTC-6, Federico Bruni wrote:

 I've been getting this error message since I've deployed my mezzanine
 website:
 [Django] ERROR: Invalid HTTP_HOST header: 'domain.com'.You may need to
 add u'domain.com' to ALLOWED_HOSTS

 where domain.com is most of the times the IP of the server, few times a
 secondary domain which redirects to the main one and one time www.fbi.gov:-)

 I've read the pages below, so I think that I can just ignore the error
 (I'm sure that my ALLOWED_HOSTS is restrictive).
 I guess that I can wait for Django = 1.7b4 in Mezzanine and then I won't
 get any error message. Right?

 http://stackoverflow.com/questions/15238506/djangos-
 suspiciousoperation-invalid-http-host-header
 https://code.djangoproject.com/ticket/19866
 https://github.com/django/django/commit/d228c1192ed59ab0114d9eba82ac99
 df611652d2 (added in django 1.7b4)

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




-- 
molo...@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.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Form page submit handler?

2014-05-21 Thread Danny

On 22/05/2014 1:48 PM, Wesley wrote:

Hi guys,
   I got a question regarding form page, that, what's the view function
to handle form submit within the Form page?

I wanna customize the view function but didn't find the right place.



https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/forms/page_processors.py

function form_processor seems to handle form submission  emailing.


Thanks.
Wesley


HTH. HAND.

Seeya. Danny.
--
Email: molo...@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.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Edit pages using external editor

2014-05-11 Thread Danny

Hi Frank,

I use the It's All Text extension for Firefox, which allows you to 
edit any web page multiline text box in the text editor of your choice - 
very handy when filling out comment boxes on websites too!


It works fairly well when editing the raw HTML of a Mezzanine/Django page.

Seeya. Danny.

On 12/05/2014 3:13 AM, Ken Bolton wrote:

Hi Frank,

This came up a year ago, and the information in this thread is still
valid, afaik:
https://groups.google.com/d/msg/mezzanine-users/2p4YXL9EgXk/4azf9QJqYjIJ

hth,
ken


On Sun, May 11, 2014 at 5:31 AM, Frank Gilsdorf fr...@gilsdorf.de
mailto:fr...@gilsdorf.de wrote:

Hi,

Is there any way on editing 'raw' HTML pages using an external editor?

At the moment I am switching to HTML and copy-and-pasting the source
into my editor. Afterwards I'm pasting it back. But this is way too
complicated.

--
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
mailto:mezzanine-users%2bunsubscr...@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
mailto:mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.




--
Email: molo...@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.
For more options, visit https://groups.google.com/d/optout.


Re: [mezzanine-users] Tried 3-4 heroku deployment tutorials but stuck on each one.

2014-03-25 Thread Danny
Biggest problem I had with Heroku is that it doesn't have any
permanent storage - each time you redeploy, you're creating your
project/app/static from scratch. It doesn't work so well with
Mezzanine's ability to upload media files. There is a way of hooking
things in with Amazon S3 but I never managed to get it to work with
any Django project, so I ended up giving up on Heroku.

(Also the, SSL add-on pack is quite expensive!)

On 26 March 2014 09:34, Kyle Pennell kpenn...@gmail.com wrote:
 Hey Josh,
 Was hoping to stick to Heroku because it's free and I didn't want to scatter
 my apps around too much.  But I'm open to other ideas.


 On Tuesday, March 25, 2014 4:35:56 PM UTC-6, Josh Cartmell wrote:

 Hey Kyle, I've never used Heroku, are you set on using it?

 The fabfile that comes bundled with Mezzanine will deploy to a vanilla
 ubuntu VPS and is basically completely automated.

 I also have had good success hosting Mezzanine on Webfaction and can
 deploy there fairly easily.


 On Tue, Mar 25, 2014 at 11:36 AM, Kyle Pennell kpen...@gmail.com wrote:

 Hey all,
 Would love to get some help here if you could.  Hit the wall on what I
 can do/try.

 I'm just trying to deploy a basic mezzanine setup on Heroku.  I've tried
 Josh's tutorial, Ben's Tutorial, searched Stackoverflow, here, etc.  Going
 on 10 hours trying.  Hit unique and interesting bugs on each one.

 So I'm trying Steven Elliot's tutorial.  I reasoned that it was the
 newest (15 days ago) and might work better.  He's been extremely helpful on
 Twitter.

 Hit this roadblock here:

 (mezzenv)kpennell@vm-0:~/mezz-site$ python manage.py collectstatic

 /home/kpennell/mezz-site/mezzenv/local/lib/python2.7/site-packages/mezzanine/utils/conf.py:51:
 UserWarning: You haven't defined the ALLOWED_HOSTS settings, which Django
 1.5 requires
 . Will fall back to the domains configured as sites.
   warn(You haven't defined the ALLOWED_HOSTS settings, which 

 /home/kpennell/mezz-site/mezzenv/local/lib/python2.7/site-packages/mezzanine/utils/conf.py:59:
 UserWarning: TIME_ZONE setting is not set, using closest match: Etc/UTC
   warn(TIME_ZONE setting is not set, using closest match: %s % tz)
 Traceback (most recent call last):
   File manage.py, line 29, in module
 execute_from_command_line(sys.argv)
   File
 /home/kpennell/mezz-site/mezzenv/local/lib/python2.7/site-packages/django/core/management/__init__.py,
 line 399, in execute_from_command_line
 utility.execute()
   File
 /home/kpennell/mezz-site/mezzenv/local/lib/python2.7/site-packages/django/core/management/__init__.py,
 line 392, in execute
 self.fetch_command(subcommand).run_from_argv(self.argv)
   File
 /home/kpennell/mezz-site/mezzenv/local/lib/python2.7/site-packages/django/core/management/__init__.py,
 line 261, in fetch_command
 commands = get_commands()
   File
 /home/kpennell/mezz-site/mezzenv/local/lib/python2.7/site-packages/django/core/management/__init__.py,
 line 107, in get_commands
 apps = settings.INSTALLED_APPS
   File
 /home/kpennell/mezz-site/mezzenv/local/lib/python2.7/site-packages/django/conf/__init__.py,
 line 54, in __getattr__
 self._setup(name)
   File
 /home/kpennell/mezz-site/mezzenv/local/lib/python2.7/site-packages/django/conf/__init__.py,
 line 49, in _setup
 self._wrapped = Settings(settings_module)
   File
 /home/kpennell/mezz-site/mezzenv/local/lib/python2.7/site-packages/django/conf/__init__.py,
 line 128, in __init__
 mod = importlib.import_module(self.SETTINGS_MODULE)
   File
 /home/kpennell/mezz-site/mezzenv/local/lib/python2.7/site-packages/django/utils/importlib.py,
 line 40, in import_module
 __import__(name)
   File /home/kpennell/mezz-site/settings.py, line 442, in module
 set_dynamic_settings(globals())
   File
 /home/kpennell/mezz-site/mezzenv/local/lib/python2.7/site-packages/mezzanine/utils/conf.py,
 line 184, in set_dynamic_settings
 shortname = db[ENGINE].split(.)[-1]
 KeyError: u'ENGINE'


 So something with collect static doesn't work.  Something to do with
 set_dynamic_settings.  I copied his tut verbatim and cloned the project he
 gave me and both hit the snag there.

 I can post the code here if you want but thought pushing to github would
 be easier:

 https://github.com/kpennell/mezz-try



 Any ideas?


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



-- 
molo...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
Mezzanine Users group.

Re: [mezzanine-users] how to run gunicorn command?

2014-03-18 Thread Danny
In, your wsgi.py, you've got the following lines (which is fairly standard):

settings_module = %s.settings % PROJECT_ROOT.split(os.sep)[-1]
os.environ.setdefault(DJANGO_SETTINGS_MODULE, settings_module)

This will resolve to mezzanine_test.settings

Django will try to import this.

But as the error message says, Is it on sys.path?

If you haven't set up sys.path anywhere, and you're running this from
/within/ the mezzanine_test directory, it won't be able to find it.
You can try two things:
 - Run the command from one directory level up, e.g.

/sites/test/code$ /sites/.virtualenvs/test/bin/gunicorn -c
mezzanine_test/gunicorn.conf.py wsgi:application

Or better still: ensure that PROJECT_ROOT's parent is on the sys.path
inside wsgi.py

I have this inside mine:
sys.path.insert(0, os.path.abspath(os.path.join(PROJECT_ROOT, ..)))

just prior to the setttings_module = line.

(Note you'll have to also insert import sys into the file near the top)

It's not exactly elegant, but it works :D

Seeya. Danny.



On 19 March 2014 15:20, Ziwei Zhou ziweiz...@gmail.com wrote:
 yes, i renamed from mezzanine-test to mezzanine_test, but the error is the
 same.


 On Wednesday, March 19, 2014 11:58:14 AM UTC+8, Danny S wrote:

 Did you also rename your directory?

 Python can't handle dashes in module names, and your directory name
 identifies the module as well.

 On 19 March 2014 13:47, Ziwei Zhou ziwe...@gmail.com wrote:
  Thanks for the reply, now I got this error
 
  ImportError: Could not import settings 'mezzanine_test.settings' (Is it
  on
  sys.path? Is there an import error in the settings file?): No module
  named
  'mezzanine_test'
 
 
  On Wednesday, March 19, 2014 11:10:30 AM UTC+8, Stephen McDonald wrote:
 
  The project name needs to be a valid Python package name, which
  mezzanine-test isn't since you can't use dashes.
 
  Try mezzanine_test.
 
 
  On Wed, Mar 19, 2014 at 2:04 PM, Ziwei Zhou ziwe...@gmail.com wrote:
 
  Hi
 
  I have my mezzanine project named as mezzanine-test and located at
  /sites/test/code/mezzanine-test, inside mezzanine-test folder
  following are
  the files.
 
  ubuntu@test:/sites/test/code/mezzanine-test$ ls -l
 
  total 156
 
  drwxrwxr-x 3 ubuntu ubuntu  4096 Mar 17 19:27 deploy
 
  -rwxr-xr-x 1 ubuntu ubuntu 16192 Mar 18 17:55 fabfile.py
 
  -rw-r--r-- 1 ubuntu ubuntu 17819 Mar 18 17:56 fabfile.pyc
 
  -rw-r--r-- 1 ubuntu ubuntu   276 Mar 18 19:28 gunicorn.conf.py
 
  -rw-r--r-- 1 root   root   6 Mar 18 19:30 gunicorn.pid
 
  -rwxr-xr-x 1 ubuntu ubuntu 0 Mar 16 20:18 __init__.py
 
  -rw-r--r-- 1 ubuntu ubuntu   134 Mar 17 18:54 __init__.pyc
 
  -rw-rw-r-- 1 ubuntu ubuntu   738 Mar 16 22:00 local_settings.py
 
  -rw-rw-r-- 1 ubuntu ubuntu   703 Mar 17 18:54 local_settings.pyc
 
  -rwxr-xr-x 1 ubuntu ubuntu   955 Mar 16 20:18 manage.py
 
  -rw-r--r-- 1 ubuntu ubuntu  1685 Mar 18 19:22 readme.md
 
  -rw-rw-r-- 1 ubuntu ubuntu   401 Mar 18 17:25 requirements.txt
 
  -rw-rw-r-- 1 ubuntu ubuntu 16146 Mar 18 18:58 settings.py
 
  -rw-rw-r-- 1 ubuntu ubuntu 10311 Mar 18 17:42 settings.pyc
 
  drwxrwxr-x 2 ubuntu ubuntu  4096 Mar 17 19:29 static
 
  drwxr-xr-x 9 ubuntu ubuntu  4096 Mar 17 03:23 templates
 
  -rwxr-xr-x 1 ubuntu ubuntu  4567 Mar 17 22:17 urls.py
 
  -rw-r--r-- 1 ubuntu ubuntu   890 Mar 17 18:55 urls.pyc
 
  -rwxr-xr-x 1 ubuntu ubuntu   641 Mar 18 19:39 wsgi.py
 
  If I run following command
 
  /sites/test/code/mezzanine-test$/sites/.virtualenvs/test/bin/gunicorn
  -c
  gunicorn.conf.py wsgi:application
 
  The project will run but I got following error message when I try to
  access the site.
 
  Traceback (most recent call last):
 
File
 
  /sites/.virtualenvs/test/lib/python3.3/site-packages/gunicorn/workers/sync.py,
  line 136, in handle_request
 
  for item in respiter:
 
File
 
  /sites/.virtualenvs/test/lib/python3.3/site-packages/raven/middleware.py,
  line 35, in __call__
 
  iterable = self.application(environ, start_response)
 
File
 
  /sites/.virtualenvs/test/lib/python3.3/site-packages/Django-1.6.2-py3.3.egg/django/core/handlers/wsgi.py,
  line 187, in __call__
 
  self.load_middleware()
 
File
 
  /sites/.virtualenvs/test/lib/python3.3/site-packages/Django-1.6.2-py3.3.egg/django/core/handlers/base.py,
  line 46, in load_middleware
 
  for middleware_path in settings.MIDDLEWARE_CLASSES:
 
File
 
  /sites/.virtualenvs/test/lib/python3.3/site-packages/Django-1.6.2-py3.3.egg/django/conf/__init__.py,
  line 54, in __getattr__
 
  self._setup(name)
 
File
 
  /sites/.virtualenvs/test/lib/python3.3/site-packages/Django-1.6.2-py3.3.egg/django/conf/__init__.py,
  line 49, in _setup
 
  self._wrapped = Settings(settings_module)
 
File
 
  /sites/.virtualenvs/test/lib/python3.3/site-packages/Django-1.6.2-py3.3.egg/django/conf/__init__.py,
  line 132, in __init__
 
  % (self.SETTINGS_MODULE, e)
 
  ImportError: Could not import settings 'mezzanine-test.settings' (Is
  it
  on sys.path

[mezzanine-users] Form validation in Page Processors

2014-03-04 Thread Danny flack
Is it possible to validate a form in a page processor?

I know you're able to override the associated form by something like:

*@processor_for('rsvp')*
*def rsvp_form(request, page):  *

*form = RsvpForm()  #  a custom form i created to override the page's 
form*
*return {form: form}*

But how would you go about intercepting and adding custom validation to the 
default page's form? 

For instance, I am trying to do something like:

*@processor_for('rsvp')*
*def rsvp_form(request, page):  *

*form = page.getAssociatedForm()  #  fabricated method to get the 
Page's form instance*
*form.addError('Some Error')  #  add custom validation*
*return {form: form}*


Am I going down the wrong path?  Is there another way to go about 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/groups/opt_out.


Re: [mezzanine-users] Mezzanine Forms spam

2014-03-04 Thread Danny
You can use the SPAM_FILTERS setting to set a list of handlers that
check form and comment submission for spam.
The default uses Akismet (if you have it set up in your site
settings), but you could easily add your own.

For example, I have added the following to my site. I've genericised
this code a bit:

=
# settings.py
SPAM_FILTERS = (mytheme.views.is_spam,)

# mytheme/views.py
def is_spam(request, form, url):

Validates form data as being 'spam' or not based on a validation question.
Essentially this should be a field in the form always added that has the
following properties:

Label: *must* contain the string validation code.
Type: Single Line Text
Required: True
Visible: True
Default: None
Help Text: something useful as to why this question is being asked

The answer for this example is foobarqux but you should change
it as appropriate

NOTE: The form submisison goes through regardless, the entry is
just not saved/emailed if
the answer is incorrect.

for name, field in form.fields.items():
if field.label and validation code in field.label.lower():
cleaned_data = form.cleaned_data.get(name)
if foobarqux in cleaned_data.lower():
# The form field was filled correctly! It's likely not spam!
return False
else:
# It's spam, not good
return True
# else there's no validation code field in the form, so we
accept all submissions
return False

=

So for the forms that require the validation question, just add a
field to your form following the comments above, and forms which
answer incorrectly will be treated as spam.

Unfortunately, this mechanism does not reject the form and tell the
user they got the question wrong, it just prevents the form submission
from being emailed.
If anyone has an easier solution so that form validation can be done
/prior/ to the submission being accepted, I'd love to see it too.

Seeya. Danny.


On 5 March 2014 10:12, Josh Cartmell joshcar...@gmail.com wrote:
 Lately I've had a lot of clients (and a site of my own) getting a lot of
 spam submitted to Mezzanine forms.

 I'm wondering if anyone else has encountered this and/or has ideas/solutions
 to cut down on spam submissions.

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



-- 
molo...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [mezzanine-users] can anyone suggest me some host which is Australia based and also mezzaninedjango friendly?

2014-03-03 Thread Danny

On 3/03/2014 10:13 PM, lu zou wrote:

As above ,can anyone suggest me some host which is Australia based and
also mezzaninedjango friendly? :)



Not sure about Django friendliness, or even how good these hosting 
providers are, but these are places I found in Australia which had 
reasonably priced VPS solutions.


http://www.vpsblocks.com.au
http://www.networkpresence.com.au
http://www.web24.com.au
https://www.echoman.com.au
http://www.ransomit.com.au/vps
http://www.crazydomains.com.au/virtual-servers/

However, most of them are still more expensive than, say, DigitalOcean 
and Webfaction. But if local hosting (and local support) is important to 
you, perhaps have a look and check for online reviews and their reputation.


Seeya. Danny.
--
Email: molo...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [mezzanine-users] Error with Pisa? P3?

2014-02-27 Thread Danny
I'd say so, Stephen, at least until cartridge can be updated to use
xhtml2pdf instead of pisa (which seems to be an abandoned project).

At the moment, there's no dependency on reportlab in cartridge (only pisa),
but because pisa doesn't have reportlab in its own dependency list, it
couldn't hurt specifying the versions that cartridge needs.

I'll create a pull request, if you like?

Seeya. Danny.



On 28 February 2014 10:49, Stephen McDonald st...@jupo.org wrote:

 Thanks Danny - I'm not really across the issue, do you think we need to
 specify that exact reportlab version in Cartridge's setup.py?


 On Fri, Feb 28, 2014 at 11:17 AM, Danny molo...@gmail.com wrote:

 Best option for now is to downgrade reportlab to 2.7 (I did that on my
 site this morning, after this discussion!)

 Just add reportlab==2.7 to your requirements/project.txt and do a pip
 install -U -r requirements/project.txt

 Seeya. Danny.


 On 28 February 2014 10:45, Tom Brander tombran...@gmail.com wrote:

 Tried to used the fix suggested  but still getting the same error (FWIW
 I never did get the message version 2.2 or higher needed),, so I'm
 suspecting pisa is a no go with Python 3 and that it is simply failing??



 Posted question in the xhtml2pdf group, linked below:

 https://groups.google.com/d/msg/xhtml2pdf/mihS51DtZkU/P5zuIvLlC-0J

 Error:
 Exception Value:

 invalid syntax (__init__.py, line 43)

 Exception 
 Location:/home/tom/myvenv3/lib/python3.3/site-packages/ho/pisa/__init__.py
 in module, line 26 Python Executable:/home/tom/myvenv3/bin/pythonPython 
 Version:
 3.3.2

 On Thursday, February 27, 2014 8:05:02 AM UTC-6, Tom Brander wrote:

 Thanks so much!! now I know where to look..

 BTW Shouldn't both reportlab and pillow be in the requirements txt
 file??  They were the only two I needed to download separately..

 On Wednesday, February 26, 2014 5:42:18 PM UTC-6, Danny S wrote:

 The error is coming from sx/pisa3/__init__.py, line 43 which says:

 {{{
  if not REPORTLAB22:
  raise ImportError, Reportlab Toolkit Version 2.2 or higher
 needed
 }}}

 Now, obviously you do have reportlab of a version higher than 2.2 but
 there was a bug mentioned on the cartridge issues a few weeks ago
 which
 seemed to indicate that reportlab 3.0 isn't reporting its version
 correctly as higher than 2.2.

 See https://github.com/stephenmcd/cartridge/issues/174#
 issuecomment-35755887

 It seems like it's a known bug in pisa.

 Hope this helps.

 Seeya. Danny.

 On 27/02/2014 9:52 AM, Tom Brander wrote:
  Hmm did not have reportlab, so I installed it but no change, here is
 the
  pip list
  (myvenv3) tom@tom-sam:~/whiteplume$ pip list
  bleach (1.4)
  Cartridge (0.9.2)
  Django (1.6.2)
  filebrowser-safe (0.3.2)
  future (0.9.0)
  grappelli-safe (0.3.6)
  html5lib (0.999)
  Mezzanine (3.0.9)
  oauthlib (0.6.1)
  Pillow (2.3.0)
  pip (1.5.4)
  pisa (3.0.33)
  pytz (2013.9)
  reportlab (3.0)
  requests (2.2.1)
  requests-oauthlib (0.4.0)
  setuptools (2.2)
  six (1.5.2)
  tzlocal (1.0)
 
 
  On Wednesday, February 26, 2014 3:43:49 PM UTC-6, Danny S wrote:
 
  On 27/02/2014 7:29 AM, Tom Brander wrote:
Went to create a pdf invoice and got this error:
I am using Python #.3 if that makes a diff??
Does not give me much to go on the view invoice is working
 fine...
 
  Can you do a pip list for us?
 
  Do you have pisa and reportlab both installed? What versions?
 
 
   
Traceback:
File
   
  
  /home/tom/myvenv3/lib/python3.3/site-packages/django/core/handlers/base.py

 
in get_response
   107. response =
 middleware_method(request,
callback, callback_args, callback_kwargs)
File
   
  
  /home/tom/myvenv3/lib/python3.3/site-packages/mezzanine/pages/middleware.py

 
in process_view
   78. response = view_func(request, *view_args,
  **view_kwargs)
File
   
  
  /home/tom/myvenv3/lib/python3.3/site-packages/cartridge/shop/views.py

in invoice
   358. import ho.pisa
File
  /home/tom/myvenv3/lib/python3.3/site-packages/ho/pisa/__init__.py

in module
   26. from sx.pisa3.pisa import *
   
Exception Type: SyntaxError at /shop/invoice/1/
Exception Value: invalid syntax (__init__.py, line 43)
   
--
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/
 groups/opt_out
  https://groups.google.com/groups/opt_out.
 
 
 
  --
  Email: mol...@gmail.com javascript:
 



 --
 Email: mol...@gmail.com




 --
 molo...@gmail.com

 --
 You received this message because you are subscribed to the Google Groups
 Mezzanine

Re: [mezzanine-users] Error with Pisa? P3?

2014-02-27 Thread Danny
Tom's pointed out in a private email that he's working with Python 3, and
reportlab 2.7 won't work on Python 3.

I'm still using python 2.7, so using an older reportlab is fine for me.

Should I still go ahead with the change to cartridge's setup.py (adding
reportlab==2.7 as a dependency) or should we look at trying and solving the
larger issue?

Seeya. Danny.



On 28 February 2014 10:55, Stephen McDonald st...@jupo.org wrote:

 Thanks a lot that'd be great!


 On Fri, Feb 28, 2014 at 11:23 AM, Danny molo...@gmail.com wrote:

 I'd say so, Stephen, at least until cartridge can be updated to use
 xhtml2pdf instead of pisa (which seems to be an abandoned project).

 At the moment, there's no dependency on reportlab in cartridge (only
 pisa), but because pisa doesn't have reportlab in its own dependency list,
 it couldn't hurt specifying the versions that cartridge needs.

 I'll create a pull request, if you like?

 Seeya. Danny.



 On 28 February 2014 10:49, Stephen McDonald st...@jupo.org wrote:

 Thanks Danny - I'm not really across the issue, do you think we need to
 specify that exact reportlab version in Cartridge's setup.py?


 On Fri, Feb 28, 2014 at 11:17 AM, Danny molo...@gmail.com wrote:

 Best option for now is to downgrade reportlab to 2.7 (I did that on my
 site this morning, after this discussion!)

 Just add reportlab==2.7 to your requirements/project.txt and do a pip
 install -U -r requirements/project.txt

 Seeya. Danny.


 On 28 February 2014 10:45, Tom Brander tombran...@gmail.com wrote:

 Tried to used the fix suggested  but still getting the same error
 (FWIW I never did get the message version 2.2 or higher needed),, so I'm
 suspecting pisa is a no go with Python 3 and that it is simply failing??



 Posted question in the xhtml2pdf group, linked below:

 https://groups.google.com/d/msg/xhtml2pdf/mihS51DtZkU/P5zuIvLlC-0J

 Error:
 Exception Value:

 invalid syntax (__init__.py, line 43)

 Exception 
 Location:/home/tom/myvenv3/lib/python3.3/site-packages/ho/pisa/__init__.py
 in module, line 26 Python Executable:/home/tom/myvenv3/bin/pythonPython 
 Version:
 3.3.2

 On Thursday, February 27, 2014 8:05:02 AM UTC-6, Tom Brander wrote:

 Thanks so much!! now I know where to look..

 BTW Shouldn't both reportlab and pillow be in the requirements txt
 file??  They were the only two I needed to download separately..

 On Wednesday, February 26, 2014 5:42:18 PM UTC-6, Danny S wrote:

 The error is coming from sx/pisa3/__init__.py, line 43 which says:

 {{{
  if not REPORTLAB22:
  raise ImportError, Reportlab Toolkit Version 2.2 or higher
 needed
 }}}

 Now, obviously you do have reportlab of a version higher than 2.2
 but
 there was a bug mentioned on the cartridge issues a few weeks ago
 which
 seemed to indicate that reportlab 3.0 isn't reporting its version
 correctly as higher than 2.2.

 See https://github.com/stephenmcd/cartridge/issues/174#
 issuecomment-35755887

 It seems like it's a known bug in pisa.

 Hope this helps.

 Seeya. Danny.

 On 27/02/2014 9:52 AM, Tom Brander wrote:
  Hmm did not have reportlab, so I installed it but no change, here
 is the
  pip list
  (myvenv3) tom@tom-sam:~/whiteplume$ pip list
  bleach (1.4)
  Cartridge (0.9.2)
  Django (1.6.2)
  filebrowser-safe (0.3.2)
  future (0.9.0)
  grappelli-safe (0.3.6)
  html5lib (0.999)
  Mezzanine (3.0.9)
  oauthlib (0.6.1)
  Pillow (2.3.0)
  pip (1.5.4)
  pisa (3.0.33)
  pytz (2013.9)
  reportlab (3.0)
  requests (2.2.1)
  requests-oauthlib (0.4.0)
  setuptools (2.2)
  six (1.5.2)
  tzlocal (1.0)
 
 
  On Wednesday, February 26, 2014 3:43:49 PM UTC-6, Danny S wrote:
 
  On 27/02/2014 7:29 AM, Tom Brander wrote:
Went to create a pdf invoice and got this error:
I am using Python #.3 if that makes a diff??
Does not give me much to go on the view invoice is
 working fine...
 
  Can you do a pip list for us?
 
  Do you have pisa and reportlab both installed? What versions?
 
 
   
Traceback:
File
   
  
  /home/tom/myvenv3/lib/python3.3/site-packages/django/core/handlers/base.py

 
in get_response
   107. response =
 middleware_method(request,
callback, callback_args, callback_kwargs)
File
   
  
  /home/tom/myvenv3/lib/python3.3/site-packages/mezzanine/pages/middleware.py

 
in process_view
   78. response = view_func(request,
 *view_args,
  **view_kwargs)
File
   
  
  /home/tom/myvenv3/lib/python3.3/site-packages/cartridge/shop/views.py

in invoice
   358. import ho.pisa
File
  
  /home/tom/myvenv3/lib/python3.3/site-packages/ho/pisa/__init__.py

in module
   26. from sx.pisa3.pisa import *
   
Exception Type: SyntaxError at /shop/invoice/1/
Exception Value: invalid syntax (__init__.py, line 43)
   
--
You received this message because you

Re: [mezzanine-users] Error with Pisa? P3?

2014-02-26 Thread Danny

On 27/02/2014 7:29 AM, Tom Brander wrote:

Went to create a pdf invoice and got this error:
I am using Python #.3 if that makes a diff??
Does not give me much to go on the view invoice is working fine...


Can you do a pip list for us?

Do you have pisa and reportlab both installed? What versions?




Traceback:
File
/home/tom/myvenv3/lib/python3.3/site-packages/django/core/handlers/base.py
in get_response
   107. response = middleware_method(request,
callback, callback_args, callback_kwargs)
File
/home/tom/myvenv3/lib/python3.3/site-packages/mezzanine/pages/middleware.py
in process_view
   78. response = view_func(request, *view_args, **view_kwargs)
File
/home/tom/myvenv3/lib/python3.3/site-packages/cartridge/shop/views.py
in invoice
   358. import ho.pisa
File /home/tom/myvenv3/lib/python3.3/site-packages/ho/pisa/__init__.py
in module
   26. from sx.pisa3.pisa import *

Exception Type: SyntaxError at /shop/invoice/1/
Exception Value: invalid syntax (__init__.py, line 43)

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




--
Email: molo...@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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [mezzanine-users] Error with Pisa? P3?

2014-02-26 Thread Danny

The error is coming from sx/pisa3/__init__.py, line 43 which says:

{{{
if not REPORTLAB22:
raise ImportError, Reportlab Toolkit Version 2.2 or higher needed
}}}

Now, obviously you do have reportlab of a version higher than 2.2 but 
there was a bug mentioned on the cartridge issues a few weeks ago which 
seemed to indicate that reportlab 3.0 isn't reporting its version 
correctly as higher than 2.2.


See https://github.com/stephenmcd/cartridge/issues/174#issuecomment-35755887

It seems like it's a known bug in pisa.

Hope this helps.

Seeya. Danny.

On 27/02/2014 9:52 AM, Tom Brander wrote:

Hmm did not have reportlab, so I installed it but no change, here is the
pip list
(myvenv3) tom@tom-sam:~/whiteplume$ pip list
bleach (1.4)
Cartridge (0.9.2)
Django (1.6.2)
filebrowser-safe (0.3.2)
future (0.9.0)
grappelli-safe (0.3.6)
html5lib (0.999)
Mezzanine (3.0.9)
oauthlib (0.6.1)
Pillow (2.3.0)
pip (1.5.4)
pisa (3.0.33)
pytz (2013.9)
reportlab (3.0)
requests (2.2.1)
requests-oauthlib (0.4.0)
setuptools (2.2)
six (1.5.2)
tzlocal (1.0)


On Wednesday, February 26, 2014 3:43:49 PM UTC-6, Danny S wrote:

On 27/02/2014 7:29 AM, Tom Brander wrote:
  Went to create a pdf invoice and got this error:
  I am using Python #.3 if that makes a diff??
  Does not give me much to go on the view invoice is working fine...

Can you do a pip list for us?

Do you have pisa and reportlab both installed? What versions?


 
  Traceback:
  File
 
/home/tom/myvenv3/lib/python3.3/site-packages/django/core/handlers/base.py

  in get_response
 107. response = middleware_method(request,
  callback, callback_args, callback_kwargs)
  File
 

/home/tom/myvenv3/lib/python3.3/site-packages/mezzanine/pages/middleware.py

  in process_view
 78. response = view_func(request, *view_args,
**view_kwargs)
  File
 
/home/tom/myvenv3/lib/python3.3/site-packages/cartridge/shop/views.py
  in invoice
 358. import ho.pisa
  File
/home/tom/myvenv3/lib/python3.3/site-packages/ho/pisa/__init__.py
  in module
 26. from sx.pisa3.pisa import *
 
  Exception Type: SyntaxError at /shop/invoice/1/
  Exception Value: invalid syntax (__init__.py, line 43)
 
  --
  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/groups/opt_out
https://groups.google.com/groups/opt_out.



--
Email: mol...@gmail.com javascript:





--
Email: molo...@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.
For more options, visit https://groups.google.com/groups/opt_out.