[mezzanine-users] Re: Webfaction fabfile with Django 1.7.7 and development version of Mezzanine - More detailed info

2015-05-05 Thread Graham Oliver
I have tracked this error to the line
https://github.com/jerivas/mezzanine-webf/blob/master/fabfile.py#L446
site, _ = Site.objects.get_or_create(id=settings.SITE_ID);)

I tried replacing it with 
Site.objects.filter(id=settings.SITE_ID).update(domain=env.live_host);)
like this 
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/fabfile.py#L525
but still got the same error.

I have looked for possible solutions but don't have enough knowledge to 
make sensible progress, these pages looked helpful though
http://django.readthedocs.org/en/latest/releases/1.7.html#standalone-scripts
http://django.readthedocs.org/en/latest/ref/applications.html#applications-troubleshooting

I am wondering if this would be an issue for *all* fabfile use and not just 
for webfaction. Therefore it may be a 'release blocker'?

Cheers
g



On Tuesday, 5 May 2015 14:16:21 UTC+12, Graham Oliver wrote:

 I am just working through the webfaction fabfile written by Jervais 
 (thanks!) https://github.com/jerivas/mezzanine-webf 
 I am using Django 1.7.7, Python 2.7 and the current development version 
 of Mezzanine. 

 I am confused as to which line is causing the problem 

 Either this 
 https://github.com/jerivas/mezzanine-webf/blob/master/fabfile.py#L443 

 or this 
 https://github.com/jerivas/mezzanine-webf/blob/master/fabfile.py#L444 

 The stack trace is below... 

 Would welcome any pointers 
 TIA 
 g 

 [108.59.11.112] run: python -c import os; 
 os.environ['DJANGO_SETTINGS_MODULE']='settings';from django.conf import 
 settings;from django.contrib.sites.models import Site;site, _ = 
 Site.objects.get_or_create(id=settings.SITE_ID);site.domain = 
 'orotau.webfactional.com';site.save(); 
 [108.59.11.112] out: 
 /home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/mezzanine/utils/conf.py:59:
  

 UserWarning: TIME_ZONE setting is not set, using closest match: UTC 
 [108.59.11.112] out:   warn(TIME_ZONE setting is not set, using closest 
 match: %s % tz) 
 [108.59.11.112] out: Traceback (most recent call last): 
 [108.59.11.112] out:   File string, line 1, in module 
 [108.59.11.112] out:   File 
 /home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/manager.py,
  

 line 92, in manager_method 
 [108.59.11.112] out: return getattr(self.get_queryset(), 
 name)(*args, **kwargs) 
 [108.59.11.112] out:   File 
 /home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/query.py,
  

 line 422, in get_or_create 
 [108.59.11.112] out: return self.get(**lookup), False 
 [108.59.11.112] out:   File 
 /home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/query.py,
  

 line 345, in get 
 [108.59.11.112] out: clone = self.filter(*args, **kwargs) 
 [108.59.11.112] out:   File 
 /home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/query.py,
  

 line 691, in filter 
 [108.59.11.112] out: return self._filter_or_exclude(False, *args, 
 **kwargs) 
 [108.59.11.112] out:   File 
 /home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/query.py,
  

 line 709, in _filter_or_exclude 
 [108.59.11.112] out: clone.query.add_q(Q(*args, **kwargs)) 
 [108.59.11.112] out:   File 
 /home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/sql/query.py,
  

 line 1331, in add_q 
 [108.59.11.112] out: clause, require_inner = self._add_q(where_part, 
 self.used_aliases) 
 [108.59.11.112] out:   File 
 /home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/sql/query.py,
  

 line 1358, in _add_q 
 [108.59.11.112] out: current_negated=current_negated, 
 connector=connector) 
 [108.59.11.112] out:   File 
 /home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/sql/query.py,
  

 line 1182, in build_filter 
 [108.59.11.112] out: lookups, parts, reffed_aggregate = 
 self.solve_lookup_type(arg) 
 [108.59.11.112] out:   File 
 /home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/sql/query.py,
  

 line 1120, in solve_lookup_type 
 [108.59.11.112] out: _, field, _, lookup_parts = 
 self.names_to_path(lookup_splitted, self.get_meta()) 
 [108.59.11.112] out:   File 
 /home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/sql/query.py,
  

 line 1383, in names_to_path 
 [108.59.11.112] out: field, model, direct, m2m = 
 opts.get_field_by_name(name) 
 [108.59.11.112] out:   File 
 /home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/options.py,
  

 line 416, in get_field_by_name 
 [108.59.11.112] out: cache = self.init_name_map() 
 [108.59.11.112] out:   File 
 /home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/options.py,
  

 line 445, in init_name_map 
 [108.59.11.112] out: for f, model in 
 self.get_all_related_m2m_objects_with_model(): 
 [108.59.11.112] out:   File 
 

Re: [mezzanine-users] Whipped up something quick for Buffer integration... (mezzanine-buffer)

2015-05-05 Thread Stephen McDonald
That's actually really impressive Alex, thanks a lot for sharing it!

On Mon, May 4, 2015 at 1:32 PM, Alex Tsai caffod...@gmail.com wrote:

 Hi all,

 I whipped up something quick for Buffer http://buffer.com (buffer.com)
 integration - it's intended as a replacement for the mezzanine.twitter
 BlogPost publish and allows you to take advantage of some of Buffer's
 features, such as supporting multiple social network profiles,
 automatically scheduling your updates (spacing them apart) and scheduling
 updates in the future.

 It's a bit primitive right now and has a fairly annoying bug in that it
 doesn't actually work from the list view for BlogPosts, and my
 documentation is more or less nonexistent, but since I'm probably done
 working on this for the weekend, figured I'd share it.

 You will need to create a Buffer account and also create an app
 https://buffer.com/developers/apps/create to obtain an access token.

 You can install it with:

 pip install mezzanine-buffer --process-dependency-links


 Unfortunately, the buffer-python library is outdated on pypi (and in fact,
 that version 1.07 is actually broken in that it's missing subpackages when
 installed) so the --process-dependency-links is required to install it from
 github master.

 This may be useful to you if you are interested in publishing your blog
 posts to multiple social networks (really anything Buffer supports should
 be supported) and if you're interested in spacing out your tweets.

 pypi link - https://pypi.python.org/pypi/mezzanine-buffer
 github link - https://github.com/caffodian/mezzanine-buffer

 boring history behind this - we were doing this at work with a mezzanine
 driven blog to publish tweets and updates.  Our content writers tended to
 work within 9-5 so we needed some way to space them out, as well as handle
 tweeting for future-published content.  Some of us already use Buffer
 personally so it seemed like a good fit to take care of these issues.  My
 in office implementation was even dumber than this, so I rewrote everything
 from scratch as a reusable app over the course of today.  :)

 cheers,
 alex

 --
 You received this message because you are subscribed to the Google Groups
 Mezzanine Users group.
 To unsubscribe from this 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.


Re: [mezzanine-users] Re: Webfaction fabfile with Django 1.7.7 and development version of Mezzanine - More detailed info

2015-05-05 Thread Graham

ok I have caught up now :-)
FWIW I recognised that the methods in the new mezzanine fabfile have 
been changed to reflect the changes in Django 1.7


This being the  key one...
def python(code, show=True):

Runs Python code in the project's virtual environment, with Django 
loaded.


setup = import os; 
os.environ[\'DJANGO_SETTINGS_MODULE\']=\'settings\'; \

import django; \
django.setup();
full_code = 'python -c %s%s' % (setup, code.replace(`, \\\`))
with project():
if show:
print_command(code)
result = run(full_code, show=False)
return result

On 06/05/15 12:54, Graham Oliver wrote:

I have tracked this error to the line
https://github.com/jerivas/mezzanine-webf/blob/master/fabfile.py#L446
site, _ = Site.objects.get_or_create(id=settings.SITE_ID);)

I tried replacing it with
Site.objects.filter(id=settings.SITE_ID).update(domain=env.live_host);)
like this 
https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/project_template/fabfile.py#L525

but still got the same error.

I have looked for possible solutions but don't have enough knowledge 
to make sensible progress, these pages looked helpful though

http://django.readthedocs.org/en/latest/releases/1.7.html#standalone-scripts
http://django.readthedocs.org/en/latest/ref/applications.html#applications-troubleshooting

I am wondering if this would be an issue for *all* fabfile use and not 
just for webfaction. Therefore it may be a 'release blocker'?


Cheers
g



On Tuesday, 5 May 2015 14:16:21 UTC+12, Graham Oliver wrote:

I am just working through the webfaction fabfile written by Jervais
(thanks!) https://github.com/jerivas/mezzanine-webf
https://github.com/jerivas/mezzanine-webf
I am using Django 1.7.7, Python 2.7 and the current development
version
of Mezzanine.

I am confused as to which line is causing the problem

Either this
https://github.com/jerivas/mezzanine-webf/blob/master/fabfile.py#L443
https://github.com/jerivas/mezzanine-webf/blob/master/fabfile.py#L443


or this
https://github.com/jerivas/mezzanine-webf/blob/master/fabfile.py#L444
https://github.com/jerivas/mezzanine-webf/blob/master/fabfile.py#L444


The stack trace is below...

Would welcome any pointers
TIA
g

[108.59.11.112] run: python -c import os;
os.environ['DJANGO_SETTINGS_MODULE']='settings';from django.conf
import
settings;from django.contrib.sites.models import Site;site, _ =
Site.objects.get_or_create(id=settings.SITE_ID);site.domain =
'orotau.webfactional.com
http://orotau.webfactional.com';site.save();
[108.59.11.112] out:

/home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/mezzanine/utils/conf.py:59:

UserWarning: TIME_ZONE setting is not set, using closest match: UTC
[108.59.11.112] out:   warn(TIME_ZONE setting is not set, using
closest
match: %s % tz)
[108.59.11.112] out: Traceback (most recent call last):
[108.59.11.112] out:   File string, line 1, in module
[108.59.11.112] out:   File

/home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/manager.py,

line 92, in manager_method
[108.59.11.112] out: return getattr(self.get_queryset(),
name)(*args, **kwargs)
[108.59.11.112] out:   File

/home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/query.py,

line 422, in get_or_create
[108.59.11.112] out: return self.get(**lookup), False
[108.59.11.112] out:   File

/home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/query.py,

line 345, in get
[108.59.11.112] out: clone = self.filter(*args, **kwargs)
[108.59.11.112] out:   File

/home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/query.py,

line 691, in filter
[108.59.11.112] out: return self._filter_or_exclude(False, *args,
**kwargs)
[108.59.11.112] out:   File

/home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/query.py,

line 709, in _filter_or_exclude
[108.59.11.112] out: clone.query.add_q(Q(*args, **kwargs))
[108.59.11.112] out:   File

/home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/sql/query.py,

line 1331, in add_q
[108.59.11.112] out: clause, require_inner =
self._add_q(where_part,
self.used_aliases)
[108.59.11.112] out:   File

/home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/sql/query.py,

line 1358, in _add_q
[108.59.11.112] out: current_negated=current_negated,
connector=connector)
[108.59.11.112] out:   File

/home/orotau/.virtualenvs/ve_soul/lib/python2.7/site-packages/django/db/models/sql/query.py,

line 1182, in build_filter
[108.59.11.112] out: lookups, parts, reffed_aggregate =
self.solve_lookup_type(arg)