Css changes is not reflecting in Django - css

I'm doing Django project, my issue is when I change colors in style.css file in static folder, the changes aren't reflecting on the website again the same old colors are coming.
ScreenShot of my project file directory

Unlike with Python files, Django doesn't automatically refresh the server each time a static file is updated. What most official sources recommend is running py manage.py collectstatic.
This often doesn't work (at least for me), but all CSS changes are usually implemented after a complete reboot.
So try saving, closing all your files, then restarting your computer. It's a simple workaround, but it's often reliable.

Related

Eclipse CSS Debug w/ Sass Not Loading Changes

My Eclipse project uses Sass. When running in debug mode, sass:watch (configured per this article) correctly polls for changes to *.scss files, compiles them into CSS and places them in the target directory. However, these changes are not reflected on the page, and inspecting the page using Chrome developer tools shows the new CSS is not picked up.
Using another (CSS-only) project works as expected: any change to CSS is copied to target directory, and a refresh of the page reflects the proper change.
I ran across a similar issue someone had using LESS. Unlike that situation, though, even changing the target CSS directly, the change is not reflected in the browser.
I can't be the only person debugging Sass/CSS in Eclipse, but I can't find any info on this problem.
Any ideas on how to fix this?
EDIT: SCSS is being compiled to CSS and copied to the target build directory, but not into the Tomcat deployment where the code is running. As I've said, this is not an issue with CSS-based projects, only with this where it's a compiled file.
Solved the problem...
An entry needed to be added to Eclipse’s Web Deployment Assembly so that Eclipse would see this dynamically-generated folder and associate it with the project.
The files were being generated to the local_repo/target/branch_name directory, where branch_name was dynamic, and dependent upon what branch you were working on; this made it impossible to create a static entry in Eclipse WDA for us.
Our solution was to have Maven (1) create a sass-generated/css directory under local_repo/target, and (2) copy the css over into the branch_name/static directory where it belongs.
Now, when debugging locally and running Sass Watch, changes to *.scss files are detected, compiled to css, and deployed to the sass-generated/css directory. Since this dir is associated with the project in Eclipse WDA, Eclipse sees the change and deploys it to Tomcat as expected!

In Liferay, from which folder does it pick up the CSS files for minification process?

I am finding old CSS code on my browser instead it has the new code in server files. I can see the minified CSS code on browser when application gets loaded up.
My team is using Liferay framework which seems to minify the CSS files. I am noob in liferay.
I found portal-ext.properties under liferay-portal-6.1.10-ee-ga1/tomcat-7.0.25/webapps/ROOT/WEB-INF/classes/ but didn't found any parameter for minifying the CSS files?
You shouldn't just update any CSS code you find deployed on the server. Instead, update your theme, build it (it builds to a web application) and deploy it to the server. This will take care of minification and updating caches. Just changing random files in the realm of the webserver will not.
For this you'll have to find the source files for your theme (or a whole plugins-sdk, which might contain that theme). Look at your organization's source control system, which is where I'd expect it.
Explaining how to update and build themes goes well beyond the scope of a single answer here, if these are really your first steps it might be worth getting some help from someone who has some experience with Liferay.

Non-project files with ReSharper (SASS)

I'm running JetBrains ReSharper 8.2 on a project that uses SASS for styling.
I compile my seperate scss files into one file "common.css". This file is not included in the project, but gets compiled on build on the server (grunt + compass takes care of this).
I don't want to include this file, but only my SCSS files in the project. This however causes ReSharper to report a lot of errors ("Unknown CSS class"...) in my views because the file isn't included.
Is there a workaround for this (without disabling css errors in settings)?
I've tried the "ReSharper.ExternalCode" extension (https://resharper-plugins.jetbrains.com/packages/ReSharper.ExternalCode), but without any luck.
Sadly, there isn't a workaround for this. ReSharper doesn't know about SCSS files, and doesn't know anything about files that aren't included in the project, so it can only assume the CSS classes are undefined.
The external code plugin should work and allow ReSharper to process the resulting css file. However, I'm not sure how flexible it is - I think it needs everything to be configured before the solution is opened. That is, it only tells ReSharper about the generated file when the solution is being opened. Configuring things while a solution is open probably won't be reflected immediately (but I haven't tried it). Similarly, it doesn't notify ReSharper of changes to the file, and I don't think that ReSharper sets up any monitoring. So if the file isn't available when the solution opens, or changes while it's open, ReSharper won't have correct information. I'd try and configure it, close the solution and reopen.

Less compiling on FTP server

I'm working on a project directly on a FTP server (normally I work locally). I use Visual studio to edit and compile my LESS files. When the LESS file is compiled to css, the site wont' update to the newest css rules. When I manually save the css file the changes become visible.
Does anybody know what the issue is here? I haven't got a clue.

Symfony 2 application without CSS content in OVH server?

I searched almost two days for a solution but really i cant untill now, In short I deployed my site to a OVH server with filezilla following the steps in this tutorial here
After deployment I find that my site works fine but without CSS content in FF and Chrome, so when I check in firebug I find all CSS styles are loaded correctly but empty without content,also JS file are loaded with content and all images too.In IE I have the style that works fine but no image is loaded ??I work on Ubuntu and I use a Virtual Machine to use IE...
I almost did everything, I cleared the cache and I changed the access rights of all files, I specify for files => 705, the CSS and JS => 604,finally I put everything to 777 but still no change ...
An idea?
The problem comes from assetic : when css and js files get minified and concatenated using closure or yui css, .. java is called to execute jar code contained in .jar files.
On OVH shared hosting servers you don't have java available, so the output file that symfony generates when you run the assetic dump command is actually empty (hence your empty css + js files).
You should only minify those files (assetic dump) on your local server and then upload the output to your server. Don't run assetic dump on your production server! (well at least with an OVH shared hosting)
I had this problem too, and the culprit turned out to be an outdated version of the PCRE regular expression library that was compiled into the CentOS flavor of PHP. Try to run the command php -i or use the phpinfo() function and check if your version of the PCRE is 7.0 or newer. If it's older, it doesn't support the shorthand version of named capture groups.
To fix this, try to update assetic to a newer version that uses the more compatible longer version of named capture groups. If you can't do this, you can modify the offending file /vendor/assetic/src/Assetic/Filter/BaseCssFilter.php directly. Just replace all occurences of (?<paramname> with (?P<paramname>.
Note that the correct way would be to override this file instead of modifying it directly in the vendors directory.

Resources