Does Django-css app be able to deal with compass? - django

In my django project, I finally made django-css working, but however, if I do
#import "compass"
Then the css would break, an emapty css file is generated.
And I have not find any documentation in django-css that says it is able to use with compass. But since it is a fork from django-compressor what has a way to deal with compass style.
So I am wondering here, can I use django-css with compass? If yes, please provide a little tips or hints to use it properly.
Thanks very much.

The recommended way is to not do so.
The Official Compass Website says develop the CSS on the development machine and commit the CSS to source control, then treat it just as CSS once it's committed and give it to django-css.

Related

How to build sass files with django

I'm completly new with Django and python (and alone as tech in my company, not able to ask help to previous dev). I have to maintain an existing app written in django still developing new services fully written in node, which is my most important task (and my skills). I have a problem that i have fixed some bugs in UX, fixing CSS mostly. And I don't understand how to build sass.
In manage.py, when i ask the list of commands the only things which is related to my problem is "collectstatic" which seems to not build but just collect static files (good naming so) in one folder. And obviously, it doesn't resolve my problem.
Any suggestion ? I'm lost in this big new thing. Many love on every body who can help me. Do you know if there is an integrated tool ? Do i need to use an external compiler which is just not documented ?
Django got nothing to do with compiling assets, you compile it your way in node using your favorite bundler like gulp or webpack and then introduce the final path to django. but people stumbled upon this and created bunch of helper libs, checkout django_webpack.
In case you felt overwhelm then save learning curve time and do like I said earlier, bundle it on your flavor and create a management command in Django that you can run the bundler from python context.

Is it possible to use bootstrap themes on a Mezzanine/Cartridge website?

I am a newbie web developer tasked with creating a website for a client in the art industry. I've decided to roll with Mezzanine + Cartridge for the project as it seems like an accessible way to get started. I now have the server up and running with no issues, but obviously can't use the default Mezzanine theme for such a project.
I'm finding that theres a highly limited amount of themes available online for Mezzanine, and that there are a lot more Bootstrap themes available floating around. Is there a way I could use the two together? Ie the UI/front end being a Bootstrap theme while still maintaining the functionality of Mezz/Cartridge?
If so, how would I go about doing this? Not expecting a step by step guide, but any advice/guidance would be highly appreciated. Like I said, I'm incredibly new to this (first website ever!) so if I'm misunderstanding something, please let me know. Thank you for your time.
You'll override the base template as the starting point for customizing the look of everything. In there you'll find the stylesheets for bootstrap used, which you can modify/replace/etc.
https://github.com/stephenmcd/mezzanine/blob/32dc38778d296f508a23b729de04a02075994df5/mezzanine/core/templates/base.html#L18-L32

confusions using zurb foundation

After many projects writing my own responsive design i got a bit tired of it, after researching popular responsive frameworks decided to go with Zurb Foundation.
First i went for the css ready to go download. Then i tried to use the GEM, where i got a bit of resistance in trying to figure out things on my own. It seems the docs are not explaining enough scenarios, they are just raw docs.
First what i miss is a search for all the classes to find explanations fast, something like jquery's website has.
Many googling and reading to figure out i need to install ruby on windows. Then i ended thinking that my webserver also needs ruby installed, but figured out that SASS is just a preprocesor so it is only helping me write and maintain better code on my side :)
Here are some other problems i just can't figure out easy, without searching google for each thing:
1) I have configured dreamweaver to open .scss files also. Then each day i'm developing, i need to open ruby-console, navigate to project dir and put: compass watch. Now each time i save every modifications (so i can test i the browser), dreamweaver pops out message box: "file has been modified outside of dreamweaver,..do you want to save..blabla" - very very enoying
2) app.scss only holds a lot #import statements. _settings.scss holds the code i can change the default looks (this was my primary reason to use the gem since not a SASS guru yet). Should i uncomment some statement and change themn to my needs inside _settings.scss and will i lose all these changes after one day i succesfully update zurb with: gem update zurb-foundation? If so, is it better practice to create a new scss which holds all my overrides?
3) how to create new .scss file which should override some defaults that _settings.scss listens.
4) should i override the app.css or the _settings.scss
5) when changing top-bar links hover colors, why aren't these applied??? example: $topbar-link-color-hover: #fff; (_settings.scss)
6) i did not have an /img or /images folder in my project after creating it. Hence, i created one myself "/images"
7) any books to buy on foundation 4 with a lot of best practices and tutorials???
I'm sorry but for me honestly it seems way to much time to spend learning the very basics for zurb. I have a lot of experience in c++ projects as in mobile and desktop web projects, so i realy don't feel like a newby but it's almost like i'm pushed to buy support
First I will start off by saying, if you are new to frameworks try something that has a ton more documentation like Twitter-Bootstrap. However since you decided to use Foundation here are the answers to your questions.
1) Setup compass to write the files to another directory that Dreamweaver does not watch. Use a proxy like Charles Proxy to proxy in the files when you are developing locally. This will get rid of the annoying do you want to save this file message. Make the compilation of the SCSS files part of your build process before you deploy your application somewhere other than local.
2) Yes, app.scss has all the import statements. Some of which you might want to comment out if you are looking for raw speed, just fyi. In terms of overrides one thing that you can do is use the Mixins that are provided to you in the other files. Button.scss for example has some fantastic button mixins that allow you to not only create your own flair but inherit most of the Foundation Awesomeness. Another thing, if you notice how all of the variables have a !default. That means that if they are declared somewhere else(read import your variable first), the Default value will be overridden.
3) just make the file and add it as an import before the _settings.scss
4) app.scss has a ton of imports for all the parts of foundation, some you are most likely using and some maybe not.
5) Would need to see the compiled CSS for this one, my guess though without seeing anything is that you missed a variable.
6) Created it because Compass was looking for it? Unless you are planning on using images or creating a sprite (compass can create sprites, which is AWESOME) you can just comment or remove that from the config.rb.
7) Have not seen any. Foundation has much less of a community at this time when compared to Bootstrap. However you can get a leg up by studying up on SASS and SCSS, there is a lot more available on that part.

Django thumbnails suggestion

Looking for an alternate to django-imagekit.
django-imagekit with django-cumulus causes loads of timeout issues and makes apps very inconsistent.
Are there any alternatives that you can suggest that you have used in your previous projects?
Easy-thumbnails seem to be the de-facto standard these days
http://github.com/SmileyChris/easy-thumbnails
Well, sorl was pretty good, but looks dead now. Maybe there's some actively developed fork somewhere.
Also, checkout Django Packages, i'm sure you'll find useful code.

How do I install CKEditor with Django-WYSIWYG

I am trying to install the CKEditor for use with Django-WYSIWYG. This is proving to be oddly difficult.
As mentioned on the site for Django-WYSIWYG, it is possible to "install" CKEditor by dropping the distribution file in the MEDIA_URL folder on one's system.
In addition, you've got to set a variable in settings, which determines Django-WYSIWYG's "flavor."
I've done both of these things. I get no errors, but the thing still wants to use YUI. I'm really dissatisfied with YUI and would much prefer CKEditor, but for some reason it won't install.
If I am missing a step, or if you have done this somehow, please let me know!
Sorry for what is probably an obvious question.
https://github.com/shaunsephton/django-ckeditor u can use it.
I was able to get this to work. It is likely that you are not setting the URL correctly in your settings file. For Django 1.3, the ckeditor files are placed in static.