Re: [mezzanine-users] How to fix UnicodeEncodeError

2017-06-30 Thread Ken Bolton
Hi Karim,

If you search the mailing list for "character encoding", you will find this
topic covered in detail. It sounds like the database locale is off. When I
first encountered this problem, the Mezzanine `fabfile.py` was my guide to
fixing it.

-ken


On Fri, Jun 30, 2017 at 3:52 PM, Karim  wrote:

> Hello, I got a couple of exceptions on production caused by Unicode, but I
> have no idea how to fix without edit the blog. Is related to the LANG?
> (actually 'it_IT')
>
>
> Here the traceback:
>
>
> Internal Server Error: /blog/klaipėdoj-gyvena-mergaitė-vardu-dolce-gabana/
>
> UnicodeEncodeError at /blog/klaipėdoj-gyvena-mergaitė-vardu-dolce-gabana/
> 'latin-1' codec can't encode character '\u0117' in position 64: ordinal
> not in range(256)
>
> Request Method: GET
> Request URL: http://www.example.com/blog/klaip%C4%97doj-gyvena-mergait%
> C4%97-vardu-dolce-gabana/
> Django Version: 1.10.7
> Python Executable: /home/user/.venvs/myvenv/bin/python3.6
> Python Version: 3.6.1
>
> 
>
>
> Traceback:
>
> File "/home/user/.venvs/myvenv/lib/python3.6/site-packages/
> django/core/handlers/exception.py" in inner
>   42. response = get_response(request)
>
> File 
> "/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/core/handlers/base.py"
> in _legacy_get_response
>   249. response = self._get_response(request)
>
> File 
> "/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/core/handlers/base.py"
> in _get_response
>   217. response = self.process_exception_by_middleware(e,
> request)
>
> File 
> "/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/core/handlers/base.py"
> in _get_response
>   215. response = response.render()
>
> File 
> "/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/template/response.py"
> in render
>   109. self.content = self.rendered_content
>
> File 
> "/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/template/response.py"
> in rendered_content
>   84. template = self.resolve_template(self.template_name)
>
> File 
> "/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/template/response.py"
> in resolve_template
>   66. return select_template(template, using=self.using)
>
> File 
> "/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/template/loader.py"
> in select_template
>   48. return engine.get_template(template_name)
>
> File "/home/user/.venvs/myvenv/lib/python3.6/site-packages/
> django/template/backends/django.py" in get_template
>   39. return Template(self.engine.get_template(template_name),
> self)
>
> File 
> "/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/template/engine.py"
> in get_template
>   160. template, origin = self.find_template(template_name)
>
> File 
> "/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/template/engine.py"
> in find_template
>   134. name, template_dirs=dirs, skip=skip,
>
> File "/home/user/.venvs/myvenv/lib/python3.6/site-packages/
> django/template/loaders/base.py" in get_template
>   38. contents = self.get_contents(origin)
>
> File "/home/user/.venvs/myvenv/lib/python3.6/site-packages/
> django/template/loaders/filesystem.py" in get_contents
>   24. with io.open(origin.name, encoding=self.engine.file_charset)
> as fp:
>
> Exception Type: UnicodeEncodeError at /blog/klaipėdoj-gyvena-
> mergaitė-vardu-dolce-gabana/
> Exception Value: 'latin-1' codec can't encode character '\u0117' in
> position 64: ordinal not in range(256)
> Request information:
> USER: AnonymousUser
>
>
> --
> Karim N. Gorjux
>
> --
> 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.


[mezzanine-users] How to fix UnicodeEncodeError

2017-06-30 Thread Karim
Hello, I got a couple of exceptions on production caused by Unicode, but I
have no idea how to fix without edit the blog. Is related to the LANG?
(actually 'it_IT')


Here the traceback:


Internal Server Error: /blog/klaipėdoj-gyvena-mergaitė-vardu-dolce-gabana/

UnicodeEncodeError at /blog/klaipėdoj-gyvena-mergaitė-vardu-dolce-gabana/
'latin-1' codec can't encode character '\u0117' in position 64: ordinal not
in range(256)

Request Method: GET
Request URL:
http://www.example.com/blog/klaip%C4%97doj-gyvena-mergait%C4%97-vardu-dolce-gabana/
Django Version: 1.10.7
Python Executable: /home/user/.venvs/myvenv/bin/python3.6
Python Version: 3.6.1




Traceback:

File
"/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/core/handlers/exception.py"
in inner
  42. response = get_response(request)

File
"/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/core/handlers/base.py"
in _legacy_get_response
  249. response = self._get_response(request)

File
"/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/core/handlers/base.py"
in _get_response
  217. response = self.process_exception_by_middleware(e,
request)

File
"/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/core/handlers/base.py"
in _get_response
  215. response = response.render()

File
"/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/template/response.py"
in render
  109. self.content = self.rendered_content

File
"/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/template/response.py"
in rendered_content
  84. template = self.resolve_template(self.template_name)

File
"/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/template/response.py"
in resolve_template
  66. return select_template(template, using=self.using)

File
"/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/template/loader.py"
in select_template
  48. return engine.get_template(template_name)

File
"/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/template/backends/django.py"
in get_template
  39. return Template(self.engine.get_template(template_name),
self)

File
"/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/template/engine.py"
in get_template
  160. template, origin = self.find_template(template_name)

File
"/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/template/engine.py"
in find_template
  134. name, template_dirs=dirs, skip=skip,

File
"/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/template/loaders/base.py"
in get_template
  38. contents = self.get_contents(origin)

File
"/home/user/.venvs/myvenv/lib/python3.6/site-packages/django/template/loaders/filesystem.py"
in get_contents
  24. with io.open(origin.name,
encoding=self.engine.file_charset) as fp:

Exception Type: UnicodeEncodeError at
/blog/klaipėdoj-gyvena-mergaitė-vardu-dolce-gabana/
Exception Value: 'latin-1' codec can't encode character '\u0117' in
position 64: ordinal not in range(256)
Request information:
USER: AnonymousUser


-- 
Karim N. Gorjux

-- 
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] CSS Vendor Prefixes Strategy + SASS + LiveReload server

2017-06-30 Thread Roger van Schie
Thanks Eduardo, that sounds like a good approach.

On 30 June 2017 at 17:14, Eduardo Rivas  wrote:

> Hey Roger. Here's how I've done it in the past:
>
> - Create a Django app in your project to hold your static files and
> templates (I name it "theme" since it holds everything related to the
> visual styles of the site).
>
> - Inside theme/static/ setup your frontend tooling. I use Webpack to
> compile SASS, run Autoprefixer, and add ES6 transpilation to my JS. You can
> use whatever you like (grunt, gulp, bash scripts, etc). I configure it to
> output my JS and CSS to theme/static/build, creating main.css and main.js.
> I then point my templates to static/build/main.css and static/build/main.js.
>
> - Nearly all task runners support LiveReload via a plugin or something. I
> use the Webpack plugin and installed an extension in my browser. Works
> perfect.
>
> At this point the only thing pending is deployment. I choose to not track
> the build/ folder in git, so I have extended my Fabric setup to run Webpack
> locally in production mode on each deploy and copy the assets to the server
> (on the same location as the dev assets, so no changes in templates are
> required). This gives me minified and uglified production builds. Django
> Compressor handles cache invalidation.
>
> Hope that helps!
>
> On 2017-06-30 2:51 AM, Roger van Schie wrote:
>
> Any suggestions for an efficient methodology to deal with css vendor
> prefixes?
>
> As this will probably tie in, anyone got a nice strategy for using SASS? (
> I would really love to use Foundation6 with mezzanine, I find the code much
> more semantic than bootstrap and way quicker to code)( I know I can use
> Foundation6 with just css, but that defeats the purpose of saving time)
>
> As a bonus bonus, anyone running a livereload type of server with
> Mezzanine for development? (I hate having to push refresh all the time,
> really wastes time)
>
> Thanks
> Roger
>
> --
> 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.
>

-- 
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] CSS Vendor Prefixes Strategy + SASS + LiveReload server

2017-06-30 Thread Eduardo Rivas

Hey Roger. Here's how I've done it in the past:

- Create a Django app in your project to hold your static files and 
templates (I name it "theme" since it holds everything related to the 
visual styles of the site).


- Inside theme/static/ setup your frontend tooling. I use Webpack to 
compile SASS, run Autoprefixer, and add ES6 transpilation to my JS. You 
can use whatever you like (grunt, gulp, bash scripts, etc). I configure 
it to output my JS and CSS to theme/static/build, creating main.css and 
main.js. I then point my templates to static/build/main.css and 
static/build/main.js.


- Nearly all task runners support LiveReload via a plugin or something. 
I use the Webpack plugin and installed an extension in my browser. Works 
perfect.


At this point the only thing pending is deployment. I choose to not 
track the build/ folder in git, so I have extended my Fabric setup to 
run Webpack locally in production mode on each deploy and copy the 
assets to the server (on the same location as the dev assets, so no 
changes in templates are required). This gives me minified and uglified 
production builds. Django Compressor handles cache invalidation.


Hope that helps!


On 2017-06-30 2:51 AM, Roger van Schie wrote:
Any suggestions for an efficient methodology to deal with css vendor 
prefixes?


As this will probably tie in, anyone got a nice strategy for using 
SASS? ( I would really love to use Foundation6 with mezzanine, I find 
the code much more semantic than bootstrap and way quicker to code)( I 
know I can use Foundation6 with just css, but that defeats the purpose 
of saving time)


As a bonus bonus, anyone running a livereload type of server with 
Mezzanine for development? (I hate having to push refresh all the 
time, really wastes time)


Thanks
Roger

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


[mezzanine-users] CSS Vendor Prefixes Strategy + SASS + LiveReload server

2017-06-30 Thread Roger van Schie
Any suggestions for an efficient methodology to deal with css vendor 
prefixes?

As this will probably tie in, anyone got a nice strategy for using SASS? ( 
I would really love to use Foundation6 with mezzanine, I find the code much 
more semantic than bootstrap and way quicker to code)( I know I can use 
Foundation6 with just css, but that defeats the purpose of saving time)

As a bonus bonus, anyone running a livereload type of server with Mezzanine 
for development? (I hate having to push refresh all the time, really wastes 
time)

Thanks
Roger

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