Re: [mezzanine-users] mezzanine-project fails on html5lib version conflict

2014-01-13 Thread Sebastian Heyden
thank you steve!

my comment regarding the complexity was not meant to be offending, but i am 
sure it actually offended you. i don't really know why its difficult to me. 
but actually i can only learn from thinks i don't understand properly. 

Am Sonntag, 12. Januar 2014 21:13:08 UTC+1 schrieb Stephen McDonald:

 Thanks for the report.

 You've uncovered a conflict in the versions of dependencies, something 
 that has unfortunately occurred outside of Mezzanine's codebase itself. 

 Mezzanine specifies it requires a particular version of html5lib, in this 
 case 0.95, and another of its dependencies, bleach, has recently been 
 updated to specify it requires a conflicting version of html5lib, in this 
 case = 0.999.

 I'll be pushing a new version of Mezzanine shortly which should resolve 
 the issue.


 On Mon, Jan 13, 2014 at 4:29 AM, Sebastian Heyden 
 sebastia...@gmail.comjavascript:
  wrote:

 hey there,

 i just tried to start a mezzanine project by typing 

  pip install mezzanine
 mezzanine-project myproject

 ... on ubuntu and fedora with python2.7 and python2.6 but always get this 
 output from the last command:

 Traceback (most recent call last):

   File /usr/local/bin/mezzanine-project, line 5, in module

 from pkg_resources import load_entry_point

   File /usr/lib/python2.7/dist-packages/pkg_resources.py, line 2809, in 
 module

 parse_requirements(__requires__), Environment()

   File /usr/lib/python2.7/dist-packages/pkg_resources.py, line 598, in 
 resolve

 raise VersionConflict(dist,req) # XXX put more info here

 pkg_resources.VersionConflict: (html5lib 0.95 
 (/usr/local/lib/python2.7/dist-packages), 
 Requirement.parse('html5lib=0.999'))



 I forced pip to install html5lib 0.999 and then i get the following error 
 message instead.

 Traceback (most recent call last):

   File /usr/local/bin/mezzanine-project, line 5, in module

 from pkg_resources import load_entry_point

   File /usr/lib/python2.7/dist-packages/pkg_resources.py, line 2809, in 
 module

 parse_requirements(__requires__), Environment()

   File /usr/lib/python2.7/dist-packages/pkg_resources.py, line 594, in 
 resolve

 raise DistributionNotFound(req)

 pkg_resources.DistributionNotFound: html5lib==0.95



 Makes sense so far. But what am I supposed to do now? 

 I have some experience with django projects and decided to take the 
 learning curve for mezzanine. 

 i had a successful installation of mezzanine from a template once on my 
 development machine. when i wasn't able to deploy my project on the server 
 due to my messy project structure, i decided to start from scratch and copy 
 my code in piece for piece. i couldn't find the template anymore, and 
 therefore i try to go down the route with mezzanine-project. is it just me 
 or is setting up mezzanine slightly more complicated than average?


 That all depends on what your subjective experience of average is I 
 guess, but in my opinion Mezzanine actually goes to greater lengths than 
 usual in making the install process and out of the box experience easier 
 than usual.

  



 cheers,
 sebastian


  -- 
 You received this message because you 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.




 -- 
 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/groups/opt_out.


Re: [mezzanine-users] mezzanine-project fails on html5lib version conflict

2014-01-13 Thread Stephen McDonald
No offence taken :-)


On Mon, Jan 13, 2014 at 8:00 PM, Sebastian Heyden 
sebastian.hey...@gmail.com wrote:

 thank you steve!

 my comment regarding the complexity was not meant to be offending, but i
 am sure it actually offended you. i don't really know why its difficult to
 me. but actually i can only learn from thinks i don't understand properly.

 Am Sonntag, 12. Januar 2014 21:13:08 UTC+1 schrieb Stephen McDonald:

 Thanks for the report.

 You've uncovered a conflict in the versions of dependencies, something
 that has unfortunately occurred outside of Mezzanine's codebase itself.

 Mezzanine specifies it requires a particular version of html5lib, in this
 case 0.95, and another of its dependencies, bleach, has recently been
 updated to specify it requires a conflicting version of html5lib, in this
 case = 0.999.

 I'll be pushing a new version of Mezzanine shortly which should resolve
 the issue.


 On Mon, Jan 13, 2014 at 4:29 AM, Sebastian Heyden 
 sebastia...@gmail.comwrote:

 hey there,

 i just tried to start a mezzanine project by typing

  pip install mezzanine
 mezzanine-project myproject

 ... on ubuntu and fedora with python2.7 and python2.6 but always get
 this output from the last command:

 Traceback (most recent call last):

   File /usr/local/bin/mezzanine-project, line 5, in module

 from pkg_resources import load_entry_point

   File /usr/lib/python2.7/dist-packages/pkg_resources.py, line 2809,
 in module

 parse_requirements(__requires__), Environment()

   File /usr/lib/python2.7/dist-packages/pkg_resources.py, line 598,
 in resolve

 raise VersionConflict(dist,req) # XXX put more info here

 pkg_resources.VersionConflict: (html5lib 0.95 
 (/usr/local/lib/python2.7/dist-packages),
 Requirement.parse('html5lib=0.999'))



 I forced pip to install html5lib 0.999 and then i get the following
 error message instead.

 Traceback (most recent call last):

   File /usr/local/bin/mezzanine-project, line 5, in module

 from pkg_resources import load_entry_point

   File /usr/lib/python2.7/dist-packages/pkg_resources.py, line 2809,
 in module

 parse_requirements(__requires__), Environment()

   File /usr/lib/python2.7/dist-packages/pkg_resources.py, line 594,
 in resolve

 raise DistributionNotFound(req)

 pkg_resources.DistributionNotFound: html5lib==0.95



 Makes sense so far. But what am I supposed to do now?

 I have some experience with django projects and decided to take the
 learning curve for mezzanine.

 i had a successful installation of mezzanine from a template once on my
 development machine. when i wasn't able to deploy my project on the server
 due to my messy project structure, i decided to start from scratch and copy
 my code in piece for piece. i couldn't find the template anymore, and
 therefore i try to go down the route with mezzanine-project. is it just me
 or is setting up mezzanine slightly more complicated than average?


 That all depends on what your subjective experience of average is I
 guess, but in my opinion Mezzanine actually goes to greater lengths than
 usual in making the install process and out of the box experience easier
 than usual.





 cheers,
 sebastian


  --
 You received this message because you 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/groups/opt_out.




 --
 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/groups/opt_out.




-- 
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/groups/opt_out.


Re: [mezzanine-users] Buy Product fails if Product contains non ASCII chars

2014-01-13 Thread Stephen McDonald
I can't reproduce the error, but may have resolved it with this change:

https://github.com/stephenmcd/cartridge/commit/d57997947549ef4116565a161c4fd6dc5251b8a1

Can you try that out and report back, thanks.


On Mon, Jan 13, 2014 at 8:28 AM, Andrey M andrey.s.mas...@gmail.com wrote:

 Hi All,

 I've started working with Mezzanine/Cartridge few weeks ago and they are
 very interesting projects for me.
 My testing app is deployed on Openshift  (character_set_database  in MySQL
 is utf8 )

 And I faced with the following issue.
 When a product contains non ascii symbols (but URL is translitirated) I
 can open the Product in the shop but I can not Buy it because of an
 exception

 Traceback:
 File
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/core/handlers/base.py
 in get_response
   107. response = middleware_method(request, callback,
 callback_args, callback_kwargs)
 File
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Mezzanine-3.0.4-py2.7.egg/mezzanine/pages/middleware.py
 in process_view
   78. response = view_func(request, *view_args, **view_kwargs)
 File
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Cartridge-0.9.1-py2.7.egg/cartridge/shop/views.py
 in product
   61. request.cart.add_item(add_product_form.variation,
 quantity)
 File
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Cartridge-0.9.1-py2.7.egg/cartridge/shop/utils.py
 in add_item
   52. cart.add_item(*args, **kwargs)
 File
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Cartridge-0.9.1-py2.7.egg/cartridge/shop/models.py
 in add_item
   567. item.save()
 File
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Cartridge-0.9.1-py2.7.egg/cartridge/shop/models.py
 in save
   650. super(SelectedProduct, self).save(*args, **kwargs)
 File
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/base.py
 in save
   545.force_update=force_update,
 update_fields=update_fields)
 File
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/base.py
 in save_base
   573. updated = self._save_table(raw, cls, force_insert,
 force_update, using, update_fields)
 File
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/base.py
 in _save_table
   635.   forced_update)
 File
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/base.py
 in _do_update
   679. return filtered._update(values)  0
 File
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/query.py
 in _update
   507. return query.get_compiler(self.db).execute_sql(None)
 File
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/sql/compiler.py
 in execute_sql
   975. cursor = super(SQLUpdateCompiler,
 self).execute_sql(result_type)
 File
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/sql/compiler.py
 in execute_sql
   781. cursor.execute(sql, params)
 File
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/backends/util.py
 in execute
   69. return super(CursorDebugWrapper, self).execute(sql,
 params)
 File
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/backends/util.py
 in execute
   53. return self.cursor.execute(sql, params)
 File
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/backends/mysql/base.py
 in execute
   124. return self.cursor.execute(query, args)
 File
 /opt/rh/python27/root/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py
 in execute
   159. query = query % db.literal(args)
 File
 /opt/rh/python27/root/usr/lib64/python2.7/site-packages/MySQLdb/connections.py
 in literal
   264. return self.escape(o, self.encoders)
 File
 /opt/rh/python27/root/usr/lib64/python2.7/site-packages/MySQLdb/connections.py
 in string_literal
   197. return db.string_literal(obj)

 Exception Type: UnicodeEncodeError at /shop/product/noski-multik/
 Exception Value: 'ascii' codec can't encode characters in position 0-4:
 ordinal not in range(128)

 Is it known 

Re: [mezzanine-users] Buy Product fails if Product contains non ASCII chars

2014-01-13 Thread Andrey M
Stephen,

Thanks, now it works fine!

понедельник, 13 января 2014 г., 13:07:25 UTC+4 пользователь Stephen 
McDonald написал:

 I can't reproduce the error, but may have resolved it with this change:


 https://github.com/stephenmcd/cartridge/commit/d57997947549ef4116565a161c4fd6dc5251b8a1

 Can you try that out and report back, thanks.


 On Mon, Jan 13, 2014 at 8:28 AM, Andrey M andrey@gmail.comjavascript:
  wrote:

 Hi All,

 I've started working with Mezzanine/Cartridge few weeks ago and they are 
 very interesting projects for me.
 My testing app is deployed on Openshift  (character_set_database  in 
 MySQL is utf8 )

 And I faced with the following issue. 
 When a product contains non ascii symbols (but URL is translitirated) I 
 can open the Product in the shop but I can not Buy it because of an 
 exception

 Traceback:
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/core/handlers/base.py
  
 in get_response
   107. response = middleware_method(request, 
 callback, callback_args, callback_kwargs)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Mezzanine-3.0.4-py2.7.egg/mezzanine/pages/middleware.py
  
 in process_view
   78. response = view_func(request, *view_args, **view_kwargs)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Cartridge-0.9.1-py2.7.egg/cartridge/shop/views.py
  
 in product
   61. request.cart.add_item(add_product_form.variation, 
 quantity)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Cartridge-0.9.1-py2.7.egg/cartridge/shop/utils.py
  
 in add_item
   52. cart.add_item(*args, **kwargs)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Cartridge-0.9.1-py2.7.egg/cartridge/shop/models.py
  
 in add_item
   567. item.save()
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Cartridge-0.9.1-py2.7.egg/cartridge/shop/models.py
  
 in save
   650. super(SelectedProduct, self).save(*args, **kwargs)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/base.py
  
 in save
   545.force_update=force_update, 
 update_fields=update_fields)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/base.py
  
 in save_base
   573. updated = self._save_table(raw, cls, force_insert, 
 force_update, using, update_fields)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/base.py
  
 in _save_table
   635.   forced_update)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/base.py
  
 in _do_update
   679. return filtered._update(values)  0
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/query.py
  
 in _update
   507. return query.get_compiler(self.db).execute_sql(None)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/sql/compiler.py
  
 in execute_sql
   975. cursor = super(SQLUpdateCompiler, 
 self).execute_sql(result_type)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/models/sql/compiler.py
  
 in execute_sql
   781. cursor.execute(sql, params)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/backends/util.py
  
 in execute
   69. return super(CursorDebugWrapper, self).execute(sql, 
 params)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/backends/util.py
  
 in execute
   53. return self.cursor.execute(sql, params)
 File 
 /var/lib/openshift/52d044ace0b8cdfcd400021b/python/virtenv/lib/python2.7/site-packages/Django-1.6.1-py2.7.egg/django/db/backends/mysql/base.py
  
 in execute
   124. return self.cursor.execute(query, args)
 File 
 /opt/rh/python27/root/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py 
 in execute
   159. query = query % db.literal(args)
 File 
 /opt/rh/python27/root/usr/lib64/python2.7/site-packages/MySQLdb/connections.py
  
 in literal
   264. return self.escape(o, self.encoders)
 File 
 /opt/rh/python27/root/usr/lib64/python2.7/site-packages/MySQLdb/connections.py
  
 in string_literal
   197. 

[mezzanine-users] Delete Images From Gallery (Media Library)

2014-01-13 Thread NOAA CREST
For some reason , i can not delete images from a media library page , I 
tried using the online demo and from the admin interface but it won't let 
me delete images.

http://mezzanine.jupo.org/gallery/

http://mezzanine.jupo.org/en/admin/galleries/gallery/8/

Any suggestion , 

P.S you can recreate this error by just going to the link above and trying 
to remove an image

-- 
You received this message because you 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] Delete Images From Gallery (Media Library)

2014-01-13 Thread Stephen McDonald
Demo works fine for me.


On Tue, Jan 14, 2014 at 9:02 AM, NOAA CREST noaacrest2...@gmail.com wrote:

 For some reason , i can not delete images from a media library page , I
 tried using the online demo and from the admin interface but it won't let
 me delete images.

 http://mezzanine.jupo.org/gallery/

 http://mezzanine.jupo.org/en/admin/galleries/gallery/8/

 Any suggestion ,

 P.S you can recreate this error by just going to the link above and trying
 to remove an image

  --
 You received this message because you 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.




-- 
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/groups/opt_out.


Re: [mezzanine-users] Mezzanine 3.0.5 released

2014-01-13 Thread Josh Cartmell
Gotcha, thanks!


On Mon, Jan 13, 2014 at 3:46 PM, Stephen McDonald st...@jupo.org wrote:

 Resolved here:


 https://github.com/stephenmcd/mezzanine/commit/a1142f4b090b4164845242aae2237ca2ec85b75c

 Will push a new release later today.


 On Tue, Jan 14, 2014 at 9:58 AM, Stephen McDonald st...@jupo.org wrote:

 I believe it was intentional in the contribution it came with but I
 missed that in the review, so consider it a bug that needs dealing with -
 mezzanine.urls should contain everything needed.


 On Tue, Jan 14, 2014 at 9:05 AM, Josh Cartmell joshcar...@gmail.comwrote:

 Thanks Steve!

 One thing I just noticed is that if you are upgrading a site you need to
 add the media library urls to your projects urls.py (not sure if this is
 intentional or not).  The url, for reference is
 https://bitbucket.org/stephenmcd/mezzanine/src/cbaf5e3fa437ef8c2ce164aefad907691978479e/mezzanine/project_template/urls.py?at=default#cl-24.
 If you don't add it the media library doesn't work and if you try to go to
 pages that make use of mezzanine FileFields (a gallery for example) there
 are errors.


 On Sun, Jan 12, 2014 at 1:35 PM, Stephen McDonald st...@jupo.orgwrote:

 Hi all,

 I've just pushed out Mezzanine 3.0.5 which contains a large number of
 minor fixes and enhancements since 3.0.4 (which was released very soon
 after 3.0).

 - Fixes for certain static admin files when running Python 3.3 on
 Windows
 - Further support for multi-lingual admin interface
 - Disqus SSO fixes for Python 3.3
 - Increased font sizes through the admin interface
 - More HTML5 field types handled in admin dynamic inlines
 - Migration fixes for latest version of south with Django 1.6.1
 - Automatic timezone guessing resolving issues with Django 1.6.1
 - RSS feed link attribute now points to site instead of feed itself.
 - Gallery fixes when hosting on Amazon S3
 - Libraries upgraded: requests/bleach (resolves today's dependency
 conflicts)
 - Restored bootstrap-extras.js fixing issues with drop-down menus on
 mobile devices
 - Fixed gallery zipfile uploads for homepage galleries
 - Fixed admin menu ordering for Python 3.3

 --
 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/groups/opt_out.


  --
 You received this message because you 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.




 --
 Stephen McDonald
 http://jupo.org




 --
 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/groups/opt_out.


-- 
You received this message because you are subscribed to the Google Groups 
Mezzanine Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mezzanine-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[mezzanine-users] NoReverseMatch for custom app based on Blog app.

2014-01-13 Thread Moltra
I am trying to create a copy of the built in blog app so I can customize 
the fields in it.  I have copied and renamed everything I can find in the 
files.  I can get the mediablog to open up in the admin screen to add a new 
post.  But when I click save, it saves it in the database and then gets the 
following error.

Error during template rendering
 In template 
 C:\django\web\lib\site-packages\grappelli_safe\templates\admin\change_list.html,
  
 error at line 
 *105*Reverse for 'mediablog_post_detail' with arguments '()' and keyword 
 arguments '{'slug': 'test-mediablog-2'}' not found. 0 pattern(s) tried: []


I have looked at other threads with the same problems and I still cannot 
figure out what is causing it.  Here is the information that was asked for 
in the other threads.  I am changing the text color for the areas, I think 
are involved.

Part of model.py

 def get_absolute_url(self):

 

 URLs for mediablog posts can either be just their slug, or prefixed

 with a portion of the post's publish date, controlled by the

 setting ``mediablog_URLS_DATE_FORMAT``, which can contain the value

 ``year``, ``month``, or ``day``. Each of these maps to the name

 of the corresponding urlpattern, and if defined, we loop through

 each of these and build up the kwargs for the correct urlpattern.

 The order which we loop through them is important, since the

 order goes from least granualr (just year) to most granular

 (year/month/day).

 

 url_name = mediablog_post_detail

 kwargs = {slug: self.slug}

 date_parts = (year, month, day)

 if settings.mediablog_URLS_DATE_FORMAT in date_parts:

 url_name = mediablog_post_detail_%s % 
 settings.mediablog_URLS_DATE_FORMAT

 for date_part in date_parts:

 date_value = str(getattr(self.publish_date, date_part))

 if len(date_value) == 1:

 date_value = 0%s % date_value

 kwargs[date_part] = date_value

 if date_part == settings.mediablog_URLS_DATE_FORMAT:

 break   

 return reverse(url_name, kwargs=kwargs)


Part of my urls.py:

 # mediablog patterns.

urlpatterns = patterns(.views,

url(^%sfeeds/(?Pformat.*)%s$ % _slashes,

mediablog_post_feed, name=mediablog_post_feed),

url(^%stag/(?Ptag.*)/feeds/(?Pformat.*)%s$ % _slashes,

mediablog_post_feed, name=mediablog_post_feed_tag),

url(^%stag/(?Ptag.*)%s$ % _slashes, mediablog_post_list,

name=mediablog_post_list_tag),

url(^%scategory/(?Pcategory.*)/feeds/(?Pformat.*)%s$ % _slashes,

mediablog_post_feed, name=mediablog_post_feed_category),

url(^%scategory/(?Pcategory.*)%s$ % _slashes,

mediablog_post_list, name=mediablog_post_list_category),

url(^%sauthor/(?Pusername.*)/feeds/(?Pformat.*)%s$ % _slashes,

mediablog_post_feed, name=mediablog_post_feed_author),

url(^%sauthor/(?Pusername.*)%s$ % _slashes,

mediablog_post_list, name=mediablog_post_list_author),

url(^%sarchive/(?Pyear\d{4})/(?Pmonth\d{1,2})%s$ % _slashes,

mediablog_post_list, name=mediablog_post_list_month),

url(^%sarchive/(?Pyear\d{4})%s$ % _slashes,

mediablog_post_list, name=mediablog_post_list_year),

url(^%s(?Pyear\d{4})/(?Pmonth\d{1,2})/(?Pday\d{1,2})/

(?Pslug.*)%s$ % _slashes,

mediablog_post_detail, name=mediablog_post_detail_day),

url(^%s(?Pyear\d{4})/(?Pmonth\d{1,2})/(?Pslug.*)%s$ % _slashes,

mediablog_post_detail, name=mediablog_post_detail_month),

url(^%s(?Pyear\d{4})/(?Pslug.*)%s$ % _slashes,

mediablog_post_detail, name=mediablog_post_detail_year),

url(^%s(?Pslug.*)%s$ % _slashes, mediablog_post_detail,

name=mediablog_post_detail),

url(^%s$ % _slashes[1], mediablog_post_list, 
 name=mediablog_post_list),

)


Part of my views.py:

 def mediablog_post_detail(request, slug, year=None, month=None, day=None,

  template=mediablog/mediablog_post_detail.html):

 . Custom templates are checked for using the name

 ``mediablog/mediablog_post_detail_XXX.html`` where ``XXX`` is the 
 mediablog

 posts's slug.

 

 mediablog_posts = mediablogPost.objects.published(

 
  for_user=request.user).select_related()

 mediablog_post = get_object_or_404(mediablog_posts, slug=slug)

 context = {mediablog_post: mediablog_post, editable_obj: 
 mediablog_post}

 templates = [umediablog/mediablog_post_detail_%s.html % str(slug), 
 template]

 return render(request, templates, context)


I have the template mediablog_post_detail.html in the 
/mediablog/tempates/mediablog/ folder and in the root directory 
/templates/mediablog/   folder.

I have deleted all the url patterns above the one highlighted above and 
still get the same error.

Here is 

Re: [mezzanine-users] NoReverseMatch for custom app based on Blog app.

2014-01-13 Thread Moltra


 No I did not do that, I will look in the documents and figure out how to. 
  Thanks for the heads up. 

-- 
You received this message because you 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.