Re: [mezzanine-users] Re: how to serve static files under customized theme

2014-05-26 Thread Wesley
Hi Josh, Yeah, I do think I am right in the beginning:-) My current problem is that, I have a 404.png under theme/static/img, it's not available. When I copy it to project static/img, It's OK... So, what's the reason? Thanks. Wesley 在 2014年5月26日星期一UTC+8下午11时30分27秒,Josh Cartmell写道: > > I think

Re: [mezzanine-users] Re: modeltranslations - round 2

2014-05-26 Thread Stephen McDonald
BTW to answer your earlier question - any slug creation logic definitely belongs on the model (Slugged I believe) rather than an admin class. On Tue, May 27, 2014 at 12:30 AM, Mathias Ettinger < mathias.ettin...@gmail.com> wrote: > Well, I started from something similar in the first place. I thi

Re: [mezzanine-users] Re: Proposal: page_move signals

2014-05-26 Thread Stephen McDonald
On Mon, May 26, 2014 at 11:52 PM, Ahmad Khayyat wrote: > Sure, but one issue is that violating the rule is expected to result in > different reactions when creating vs. when moving a page. > > If a rule is violated in a page move, the page goes back to its original > position. > > If a rule is vi

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

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 Federico Bruni
Hi Jared thank you for the link, but I think that my situation is different. Django (not the server) is issuing an error. It seems, from the stackoverflow link below, that it may be someone probing the site for the vulnerability by spoofing the header. Up to django < 1.7b4 this is considered a 500

[mezzanine-users] Re: [Django] ERROR: Invalid HTTP_HOST header: 'domain.com'.You may need to add u'domain.com' to..

2014-05-26 Thread Jared Nielsen
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

Re: [mezzanine-users] Re: modeltranslations - round 2

2014-05-26 Thread Stephen McDonald
Fair enough - just wanted to make sure something simpler hadn't been overlooked. On Tue, May 27, 2014 at 12:30 AM, Mathias Ettinger < mathias.ettin...@gmail.com> wrote: > Well, I started from something similar in the first place. I think it is > good enough for an external app, but not so good i

Re: [mezzanine-users] The SECRET_KEY setting must not be empty error

2014-05-26 Thread Stephen McDonald
if you have SECRET_KEY defined in local_settings.py, you might find that local_settings.py actually isn't being imported. You could verify this by editing settings.py towards the end where it imports local_settings.py, to allow it to throw an error if the import fails, which would show what the rea

Re: [mezzanine-users] The SECRET_KEY setting must not be empty error

2014-05-26 Thread Ken Bolton
Here you go! https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SECRET_KEY On Mon, May 26, 2014 at 2:30 PM, val_erie wrote: > Hi, > > I have Mezzanine 3.1.4 installed in virtualenv and I would like to run it > using Apache2 and mod_wsgi. > I followed > https://docs.djangoproject.co

[mezzanine-users] The SECRET_KEY setting must not be empty error

2014-05-26 Thread val_erie
Hi, I have Mezzanine 3.1.4 installed in virtualenv and I would like to run it using Apache2 and mod_wsgi. I followed https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/modwsgi/#how-to-use-django-with-apache-and-mod-wsgi to configure apache. I do have SECRET_KEY in local_settings.py,

Re: [mezzanine-users] Re: how to serve static files under customized theme

2014-05-26 Thread Josh Cartmell
I think putting it in your theme app is a good idea so it sounds like what you are doing is correct On Mon, May 26, 2014 at 10:43 AM, Wesley wrote: > If a file with a particular name already exists in your project's static > directory it will be replaced so the best practice is to always keep s

Re: [mezzanine-users] Re: how to serve static files under customized theme

2014-05-26 Thread Wesley
If a file with a particular name already exists in your project's static directory it will be replaced so the best practice is to always keep static files in some separate app. Hi, put you comment above. So, what do you mean by keep static files in some separate app? I already keep my customized

Re: [mezzanine-users] Re: modeltranslations - round 2

2014-05-26 Thread Mathias Ettinger
Well, I started from something similar in the first place. I think it is good enough for an external app, but not so good if we want a tight integration. First off all, the field duplication issue mentionned in the project is directly handled when modifying mezzanine and using the right base cl

Re: [mezzanine-users] Re: Proposal: page_move signals

2014-05-26 Thread Ahmad Khayyat
Sure, but one issue is that violating the rule is expected to result in different reactions when creating vs. when moving a page. If a rule is violated in a page move, the page goes back to its original position. If a rule is violated while creating a page, there should be a way to determine a de

Re: [mezzanine-users] Re: how to serve static files under customized theme

2014-05-26 Thread Josh Cartmell
Hey Wesley I would read up on how Django handles static files, https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/, particularly the collecstatic command part of the down the page. Basically, if your theme app is in INSTALLED_APPS, running collectstatic will copy files from theme/static

Re: [mezzanine-users] Collecting additional information on a per product basis in Cartridge

2014-05-26 Thread Josh Cartmell
Thanks Steve, and let me know if you notice any gotchas, typos, etc... when you set it up Mario. On Sun, May 25, 2014 at 7:09 PM, Mario Gudelj < ma...@twoblokeswithapostie.com> wrote: > This is gold. Thanks Josh. I need this exact same thing to store the > delivery date customer chooses before a

Re: [mezzanine-users] Adding a collection of Images to a custom model in Mezzanine

2014-05-26 Thread Stephen McDonald
Just quoting the Django docs here: "To refer to models defined in another application, you can explicitly specify a model with the full application label." https://docs.djangoproject.com/en/dev/ref/models/fields/#foreignkey On Mon, May 26, 2014 at 8:18 PM, Shaunak Sinha wrote: > Hey Guys, > >

Re: [mezzanine-users] Re: Proposal: page_move signals

2014-05-26 Thread Stephen McDonald
Sure - but if that's the intended use case then perhaps we need a better approach. I tried to implement something like this with page permissions, but I don't think they cover the case of moving a page: http://mezzanine.jupo.org/docs/content-architecture.html#page-permissions There really should

Re: [mezzanine-users] Re: modeltranslations - round 2

2014-05-26 Thread Stephen McDonald
Any thoughts on this implementation? https://github.com/Romamo/mezzanine-modeltranslation/blob/master/mezzaninemodeltranslation/translation.py It was mentioned in the discussion against the pull request but no comments were made. I really like how this approach doesn't require any change to Mezza

Re: [mezzanine-users] Re: Proposal: page_move signals

2014-05-26 Thread Ahmad Khayyat
Put another way: creating an instance is not a page move. On Mon, May 26, 2014 at 4:21 PM, Ahmad Khayyat wrote: > Right. Yes, they can. But that would be handled by the save method of the > MyPage model (this is what I do in my app). I don't know of a way to handle > it in the page tree. > > >

Re: [mezzanine-users] Re: Proposal: page_move signals

2014-05-26 Thread Ahmad Khayyat
Right. Yes, they can. But that would be handled by the save method of the MyPage model (this is what I do in my app). I don't know of a way to handle it in the page tree. On Mon, May 26, 2014 at 4:18 PM, Stephen McDonald wrote: > Seems incomplete for the use-case - couldn't the user create a ne

Re: [mezzanine-users] Re: Proposal: page_move signals

2014-05-26 Thread Stephen McDonald
Seems incomplete for the use-case - couldn't the user create a new MyPage instance as a top-level page? On Mon, May 26, 2014 at 10:26 PM, Ahmad Khayyat wrote: > ​Any comments? > Any additional information required? > > Here is an example that uses this feature to disallow pages of type MyPageto

Re: [mezzanine-users] Re: modeltranslations - round 2

2014-05-26 Thread Mathias Ettinger
I need to take a decision, so I’ll ask here instead. I was trying to write some tests for modeltranslation integration and I stumbled upon an issue. Basically I was trying to test that slugs are always generated based on the default language using the model logic (Page.save()) whereas the slug

Re: [mezzanine-users] Re: Proposal: page_move signals

2014-05-26 Thread Ahmad Khayyat
​Any comments? Any additional information required? Here is an example that uses this feature to disallow pages of type MyPageto be top-level pages: from mezzanine.pages.signals import pre_page_move @receiver(pre_page_move, sender=MyPage)def my_move_constraints(sender, page, new_parent, **kwargs)

[mezzanine-users] [Django] ERROR: Invalid HTTP_HOST header: 'domain.com'.You may need to add u'domain.com' to..

2014-05-26 Thread Federico Bruni
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 th

Re: [mezzanine-users] Adding a collection of Images to a custom model in Mezzanine

2014-05-26 Thread Shaunak Sinha
Hey Guys, This is may seem like a very broad question but how do you create a foreign key to Gallery in Activity model... I wrote this line in my Activity model: *activity_gallery = models.ForeignKey("Gallery", null=True, blank=True, related_name="ActivityImages")* When I drop my database and