Re: [mezzanine-users] Django Compressor does not minify files
Hey Luigi, you shouldn't have to do anything manually to get django compressor working once it's installed. That said, Mezzanine doesn't use it by default when you are using the development server (i.e. runserver). To override this you just need to set: COMPRESS_ENABLED = True In your settings. Any other time DEBUG is False and you aren't using the development server django compressor should work automatically. On Wed, Jul 16, 2014 at 5:29 AM, Luigi appo...@gmail.com wrote: Hello to all, I am trying to let django-compressor working with mezzanine. For first attempt I simply installed django compressor and changed DEBUG = False but nothing changed in HTML generated from Django. So I followed the docs of django compressor and I modified my settings.py: STATICFILES_FINDERS = ( django.contrib.staticfiles.finders.FileSystemFinder, #django.contrib.staticfiles.finders.AppDirectoriesFinder, #'django.contrib.staticfiles.finders.DefaultStorageFinder', compressor.finders.CompressorFinder, ) INSTALLED_APPS = ( django.contrib.admin, django.contrib.auth, django.contrib.contenttypes, django.contrib.redirects, django.contrib.sessions, django.contrib.sites, django.contrib.sitemaps, django.contrib.staticfiles, mezzanine.boot, mezzanine.conf, mezzanine.core, mezzanine.generic, mezzanine.blog, mezzanine.forms, mezzanine.pages, mezzanine.galleries, mezzanine.twitter, #mezzanine.accounts, #mezzanine.mobile, #'debug_toolbar', compressor, ) OPTIONAL_APPS = ( #debug_toolbar, django_extensions, #compressor, I commented it to follow the django-compressor doc PACKAGE_NAME_FILEBROWSER, PACKAGE_NAME_GRAPPELLI, ) COMPRESS_ENABLED = True COMPRESS_ROOT = STATIC_ROOT and nothing happened until I launched: python manage.py compress --force So now I have the cache populated and the HTML generated from Django points to the files in CACHE like:link rel=stylesheet href=/static/CACHE/css/16e8b98f5bd3.css type=text/css media=screen, but the files are not minified, django compressor simply copied them and changed the name. Do you know why the compressor not minify them? Thanks for your 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. 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] Django Compressor does not minify files
Thank you Josh, I am using Apache2 + mod_wsgi + virtualenv. These are the packages installed in my environment: Django==1.6.5 Mezzanine==3.1.5 Pillow==2.5.1 bleach==1.4 distribute==0.6.24 django-appconf==0.6 django-compressor==1.4 filebrowser-safe==0.3.5 future==0.9.0 grappelli-safe==0.3.12 html5lib==1.0b3 oauthlib==0.6.3 pytz==2014.4 requests==2.3.0 requests-oauthlib==0.4.1 six==1.7.3 tzlocal==1.0 On Wednesday, July 16, 2014 3:46:17 PM UTC+2, Josh Cartmell wrote: Hey Luigi, you shouldn't have to do anything manually to get django compressor working once it's installed. That said, Mezzanine doesn't use it by default when you are using the development server (i.e. runserver). To override this you just need to set: COMPRESS_ENABLED = True In your settings. Any other time DEBUG is False and you aren't using the development server django compressor should work automatically. On Wed, Jul 16, 2014 at 5:29 AM, Luigi app...@gmail.com javascript: wrote: Hello to all, I am trying to let django-compressor working with mezzanine. For first attempt I simply installed django compressor and changed DEBUG = False but nothing changed in HTML generated from Django. So I followed the docs of django compressor and I modified my settings.py: STATICFILES_FINDERS = ( django.contrib.staticfiles.finders.FileSystemFinder, #django.contrib.staticfiles.finders.AppDirectoriesFinder, #'django.contrib.staticfiles.finders.DefaultStorageFinder', compressor.finders.CompressorFinder, ) INSTALLED_APPS = ( django.contrib.admin, django.contrib.auth, django.contrib.contenttypes, django.contrib.redirects, django.contrib.sessions, django.contrib.sites, django.contrib.sitemaps, django.contrib.staticfiles, mezzanine.boot, mezzanine.conf, mezzanine.core, mezzanine.generic, mezzanine.blog, mezzanine.forms, mezzanine.pages, mezzanine.galleries, mezzanine.twitter, #mezzanine.accounts, #mezzanine.mobile, #'debug_toolbar', compressor, ) OPTIONAL_APPS = ( #debug_toolbar, django_extensions, #compressor, I commented it to follow the django-compressor doc PACKAGE_NAME_FILEBROWSER, PACKAGE_NAME_GRAPPELLI, ) COMPRESS_ENABLED = True COMPRESS_ROOT = STATIC_ROOT and nothing happened until I launched: python manage.py compress --force So now I have the cache populated and the HTML generated from Django points to the files in CACHE like:link rel=stylesheet href=/static/CACHE/css/16e8b98f5bd3.css type=text/css media=screen, but the files are not minified, django compressor simply copied them and changed the name. Do you know why the compressor not minify them? Thanks for your 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-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.
[mezzanine-users] Re: Django Compressor does not minify files
Hey Luigi. By default, Django Compressor will simply concatenate (join) your static files. This is good because it will save HTTP requests to your site, and your visitors will get all your static files in one request (instead of many). If you also want to minify your files (remove whitespace and newlines, mostly), you need to define the following setting (for CSS files): COMPRESS_CSS_FILTERS = ['compressor.filters.css_default.CssAbsoluteFilter', 'compressor.filters.cssmin.CSSMinFilter'] This will get your CSS files minified. You can do fancier stuff like compile LESS files and minify JS, but that'd require other dependencies and configuring other settings related to binary file locations and more. The docs go in great detail about this: http://django-compressor.readthedocs.org/en/latest/settings/#backend-settings -- 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] Email confirmation for admin-created users?
Hello, folks-- I am putting together my first Mezzanine (also my first Django) site ... it's taking longer than I expected, but it's mostly an enjoyable experience, so I guess it's all good. Anyway, I am trying to set up a simple online collaboration system. And this is a business site, not an open community, and all users will (a) be either clients or co-workers, and (b) require some degree of privilege. So I expect that for the foreseeable future all accounts will be created by an administrator (i.e., by me). I don't see a good reason to allow self-service registration. However, when a new user is created, I would like them to receive an automated confirmation email containing a one-time login link. Otherwise, I think I would need to send an email containing the user's password in clear text. Um, no. It appears that Mezzanine does not support this functionality out of the box. Unless it is supposed to happen by default, and my test server isn't set up correctly to enable the email to be sent (quite possible). But from what I have read in the docs, it appears that there is either self-service registration with optional email confirmation, or admin registration without email. Is that right? So, what would be the best solution for my case? I went hunting for Django apps that will do what I need; django-registration and django-allauth looked promising, but django-registration is no longer maintained, and django-allauth seems like overkill and is apparently a bit difficult to set up. On the other hand, I'd rather not reinvent the wheel, especially when there are security implications. Recommendations? -- 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] Blog Posts in Menu
Thanks, I feel stupidly how I could miss this one. Your hint works for me. Thanks so much. best regards, Andrzej Grymkowski -- 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: Email confirmation for admin-created users?
Hi Matt. Mezzanine supports user access control in a self-service configuration that might be useful for you. You can have your users request an account (fill in their details and password), but they will not be granted access to the site (they can't log in) until an authorized member clears their request. You can define a list of email addresses that will be notified when new users request accounts. This way you don't have to manually enter every user's details, but you still have complete control over all of them. If you grant permission to a user, he/she will get an email notification to let them now they can use the site (complete with a log in link). This requires you set ACCOUNTS_APPROVAL_REQUIRED = True in settings.py. Then you have to configure the emails that will be notified on new account requests in the Settings section of the Admin interface. The setting is called Account approval email addresses under the Miscellaneous section. To approve a new user, simply login to the Admin site (you need to have permission to change User objects), look for the user in question (you'll receive a direct link with the notification email), and check the Active box, then Save. This will notify the new user and let them log in to your site. I've been using this method for an online store I'm working in where only registered users can order products, and we want to screen them all. Hope that helps. -- 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: Email confirmation for admin-created users?
Also, my explanation is really just a rephrasing of what you can find in the official docs: http://mezzanine.jupo.org/docs/user-accounts.html#account-approval. In that page you'll also find info about the more traditional Click here to verify your account approach, and details on Mezzanine's implementation of user accounts, which is pretty flexible and capable out of the box. Lastly, remember you must have your email settings set correctly to be able to send notifications to your users and yourself. For example, you can use a Gmail account: EMAIL_HOST_USER = 'exam...@gmail.com' EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_PASSWORD = 'GmailPassword' EMAIL_PORT = 587 SERVER_EMAIL = EMAIL_HOST_USER These go into settings.py and you only need to change your gmail address and password. Of course, other SMTP servers will work fine with their own settings. -- 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: Email confirmation for admin-created users?
Hi again-- On Wed, Jul 16, 2014 at 1:47 PM, Eduardo Rivas jerivasmel...@gmail.com wrote: Lastly, remember you must have your email settings set correctly to be able to send notifications to your users and yourself. For example, you can use a Gmail account: EMAIL_HOST_USER = 'exam...@gmail.com' ... etc. Good to know. I probably would have found the email settings on my own, but I wasn't aware of them yet, so thank you. -- Matt Gushee -- 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: Email confirmation for admin-created users?
Hi, Josh-- Awesome! That sounds like what I'm looking for. I don't fully understand your suggestion, but I should be able to figure it out. If not, I'll be back with more questions ... because I need this to work ;-) BTW, any opinion on my question as to whether this should be a core feature? I never expected I would say anything nice about a certain other well-known CMS ... but Drupal does this out of the box, and it seems pretty basic and desirable to me. Don't get me wrong: overall I found Drupal to be a nightmare, and though Mezzanine/Django is posing some unexpected challenges, so far the experience is anything but nightmarish, so I'm not going back. However, this is one thing that Drupal does right. IMHO. Thanks, Matt On Wed, Jul 16, 2014 at 2:30 PM, Josh Cartmell joshcar...@gmail.com wrote: Hey Matt, an alternative idea would be to connect to the post save signal for User, https://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.post_save. If the user was created perform a password reset on them. Here's the code in Mezzanine that does resets, https://bitbucket.org/stephenmcd/mezzanine/src/05319e2db0712eced56bfd7551fc6078119cbbc8/mezzanine/accounts/views.py?at=default#cl-137. Then the password reset email would allow them to choose a new password and login. In that way you could create a user in the admin interface and they would automatically receive an email that gave them access to their account. On Wed, Jul 16, 2014 at 4:26 PM, Matt Gushee m...@gushee.net wrote: Hi, Eduardo-- Thanks for your quick reply! On Wed, Jul 16, 2014 at 1:27 PM, Eduardo Rivas jerivasmel...@gmail.com wrote: Hi Matt. Mezzanine supports user access control in a self-service configuration that might be useful for you. You can have your users request an account (fill in their details and password), but they will not be granted access to the site (they can't log in) until an authorized member clears their request. Yes, I saw that, but from a user experience perspective I don't find it satisfactory. For my users, having an account on my site is a just a means to an end, so it had better be as convenient as possible. *Telling* people to go to my site and do something that *I* want them to do, for reasons that may be unclear or unimportant to them, feels like a very 20th-century way of interacting online. Sounds like I might need to write some code. Which I don't really mind, but was hoping to avoid doing at this early stage. So I have a question: is this (email confirmations for admin-created accounts) a feature that should go into Mezzanine core? Or shall I plan on just extending the account management code for my own purposes? -- Matt Gushee -- 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] Re: Email confirmation for admin-created users?
Definitely ask away if you have more questions! Mezzanine tries to implement a basic set of features and make it easy to add on when it's desirable. With that in mind I think whether or not it should be a core feature comes down to the demand and weather or not someone has time to code it =) On Wed, Jul 16, 2014 at 4:42 PM, Matt Gushee m...@gushee.net wrote: Hi, Josh-- Awesome! That sounds like what I'm looking for. I don't fully understand your suggestion, but I should be able to figure it out. If not, I'll be back with more questions ... because I need this to work ;-) BTW, any opinion on my question as to whether this should be a core feature? I never expected I would say anything nice about a certain other well-known CMS ... but Drupal does this out of the box, and it seems pretty basic and desirable to me. Don't get me wrong: overall I found Drupal to be a nightmare, and though Mezzanine/Django is posing some unexpected challenges, so far the experience is anything but nightmarish, so I'm not going back. However, this is one thing that Drupal does right. IMHO. Thanks, Matt On Wed, Jul 16, 2014 at 2:30 PM, Josh Cartmell joshcar...@gmail.com wrote: Hey Matt, an alternative idea would be to connect to the post save signal for User, https://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.post_save . If the user was created perform a password reset on them. Here's the code in Mezzanine that does resets, https://bitbucket.org/stephenmcd/mezzanine/src/05319e2db0712eced56bfd7551fc6078119cbbc8/mezzanine/accounts/views.py?at=default#cl-137 . Then the password reset email would allow them to choose a new password and login. In that way you could create a user in the admin interface and they would automatically receive an email that gave them access to their account. On Wed, Jul 16, 2014 at 4:26 PM, Matt Gushee m...@gushee.net wrote: Hi, Eduardo-- Thanks for your quick reply! On Wed, Jul 16, 2014 at 1:27 PM, Eduardo Rivas jerivasmel...@gmail.com wrote: Hi Matt. Mezzanine supports user access control in a self-service configuration that might be useful for you. You can have your users request an account (fill in their details and password), but they will not be granted access to the site (they can't log in) until an authorized member clears their request. Yes, I saw that, but from a user experience perspective I don't find it satisfactory. For my users, having an account on my site is a just a means to an end, so it had better be as convenient as possible. *Telling* people to go to my site and do something that *I* want them to do, for reasons that may be unclear or unimportant to them, feels like a very 20th-century way of interacting online. Sounds like I might need to write some code. Which I don't really mind, but was hoping to avoid doing at this early stage. So I have a question: is this (email confirmations for admin-created accounts) a feature that should go into Mezzanine core? Or shall I plan on just extending the account management code for my own purposes? -- Matt Gushee -- 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. -- 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: Email confirmation for admin-created users?
For the record, it's mostly already implemented when you combine both the approval/verification settings: https://github.com/stephenmcd/mezzanine/blob/master/mezzanine/accounts/admin.py#L22-L45 On Thu, Jul 17, 2014 at 11:03 AM, Josh Cartmell joshcar...@gmail.com wrote: Definitely ask away if you have more questions! Mezzanine tries to implement a basic set of features and make it easy to add on when it's desirable. With that in mind I think whether or not it should be a core feature comes down to the demand and weather or not someone has time to code it =) On Wed, Jul 16, 2014 at 4:42 PM, Matt Gushee m...@gushee.net wrote: Hi, Josh-- Awesome! That sounds like what I'm looking for. I don't fully understand your suggestion, but I should be able to figure it out. If not, I'll be back with more questions ... because I need this to work ;-) BTW, any opinion on my question as to whether this should be a core feature? I never expected I would say anything nice about a certain other well-known CMS ... but Drupal does this out of the box, and it seems pretty basic and desirable to me. Don't get me wrong: overall I found Drupal to be a nightmare, and though Mezzanine/Django is posing some unexpected challenges, so far the experience is anything but nightmarish, so I'm not going back. However, this is one thing that Drupal does right. IMHO. Thanks, Matt On Wed, Jul 16, 2014 at 2:30 PM, Josh Cartmell joshcar...@gmail.com wrote: Hey Matt, an alternative idea would be to connect to the post save signal for User, https://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.post_save . If the user was created perform a password reset on them. Here's the code in Mezzanine that does resets, https://bitbucket.org/stephenmcd/mezzanine/src/05319e2db0712eced56bfd7551fc6078119cbbc8/mezzanine/accounts/views.py?at=default#cl-137 . Then the password reset email would allow them to choose a new password and login. In that way you could create a user in the admin interface and they would automatically receive an email that gave them access to their account. On Wed, Jul 16, 2014 at 4:26 PM, Matt Gushee m...@gushee.net wrote: Hi, Eduardo-- Thanks for your quick reply! On Wed, Jul 16, 2014 at 1:27 PM, Eduardo Rivas jerivasmel...@gmail.com wrote: Hi Matt. Mezzanine supports user access control in a self-service configuration that might be useful for you. You can have your users request an account (fill in their details and password), but they will not be granted access to the site (they can't log in) until an authorized member clears their request. Yes, I saw that, but from a user experience perspective I don't find it satisfactory. For my users, having an account on my site is a just a means to an end, so it had better be as convenient as possible. *Telling* people to go to my site and do something that *I* want them to do, for reasons that may be unclear or unimportant to them, feels like a very 20th-century way of interacting online. Sounds like I might need to write some code. Which I don't really mind, but was hoping to avoid doing at this early stage. So I have a question: is this (email confirmations for admin-created accounts) a feature that should go into Mezzanine core? Or shall I plan on just extending the account management code for my own purposes? -- Matt Gushee -- 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. -- 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