CSS applied differently on local vs. remote - django

This is a bit of a long shot given how vague my problem is but I'm at my wit's end here.
Basically on my local machine, my website looks fine. However, once it's deployed to the live server, the CSS is not being applied in the same manner. Some of the overwrites that are happening on my local server are not being replicated on the remote server.
All the CSS files are loading for sure on the remote. Collectstatic command has also been ran.
Has anyone experienced such an issue before? Or does anyone have an guesses as to why this might be happening?
UPDATE
I know which style sheets are causing my problem, reset.css and text.css for those familiar with 960.gs. The thing is the overwrites are working in the right order locally but not on the remote.

It could be a lot of things, but I've had this happen to me before. It could be related to some virtual directories not being set up properly on your dev machine when compared to the production environment (causing some CSS to not load).
Have you used Firebug to see which CSS files are being loaded? You could use the Web Developer Toolbar in firefox to disable individual style sheets to see which is your culprit.
Are you sure there aren't any embedded styles on the remote server that you don't have locally?
Remember that there is a cascading order of priority for which CSS takes precedence in a browser. See: http://www.w3schools.com/css/css_howto.asp (bottom of page "Multiple Styles Will Cascade into One").
Good luck.

clear cache as well as cookies of your browser and recheck it. sometimes if network is slow , page does not download properly. basically css has to take nothing from the server. It may differ from browser to browser.

By default, Intranet sites are displayed in compatibility view in Internet Explorer.
This setting can be disabled

Related

How do I know if my Django project is ready to be deployed?

I already finished my project that I made with django, and I want to upload it. I already bought the domain, and they are about to host it for me.. once they give me the host, I just upload it and that's it? Or are there more steps to do within the code? What do I have to do?. that is, once everything is uploaded to the host, will everything be seen?
And the Admin will continue to work, when in the search engine put /admin/ ???.
that is, I wonder what are all the steps to follow so that once I host my page everything can be seen.
that is, what things would have to be configured in the congif.py, and other things.
I would appreciate a lot if you give me advice/tips/solutions..
What I know is that I have to change the debug to DEBUG=False ...
And I don't know anything else, once they pass me the port and other host information, I simply upload the files of my project to the host and that's it, nothing more? Isn't it necessary to write more code to show it?
Excuse me, I have never displayed a page
There are a lot of steps involved in deploying your code to production. I suggest you check out a guide like this to get a better idea of what you need to do in order to deploy your website. Additionally, you can run the command python manage.py check --deploy for a quick, though insufficient, review of your code to see if it is ready to be pushed to production.
Django is an excellent choice for developing basic to more advanced websites. The web framework works well in local and production environments. Just the same way the local environment server is not suitable for a production environment, there are things you need to configure before deploying your Django website. Take a look at the links below
Https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
https://docs.djangoproject.com/en/4.1/howto/deployment/
https://github.com/vintasoftware/django-production-launch-checklist/blob/master/checklist-en.md

How to force reload only some sources in Chrome/Firefox

I’m developing a web application written in Django, I’m running the server in my machine and use Chrome/Firefox to view and test the website. I want to be able to work on it while I’m on a plane/tube and I don’t have internet.
Now, the HTML loads some resources from the local server but some others from external CDNs. I want to work on some js and css files that are hosted on my machine and view the changes in the browser, so I have to force reload the website since chrome by default just shows the cached versions of these, but if I force reload, then ALL sources are reloaded and the CDN sources obviously fail to be fetched (and my site looks horrible).
So I want to know how I can reload (in Chrome or Firefox) only some of the sources of my site and still use the cached versions of the CDN ones (assume these are cached because I load them before going into the plane).
Any help or advise on how other people would solve this would be much appreciated.

Django runserver & Firefox - caching conflict with multiple local sites running separately on same port?

I'm working on several Django projects on my local machine, following a single page application architecture. To initiate the server, I have a couple copies of a script in my /bin folder containing
#!/bin/bash
python /path/to/app/manage.py runserver 8080
and have each script with the app name. This makes the application accessible via localhost:8080. In addition, I usually have the majority of my site CSS inside main.css
My issue is that I seem to be coming across a caching issue with Firefox, regardless of which application server is running. Sometimes a page will load with almost no CSS styling, but the jQuery UI elements will be initialized and I can interact somewhat with the application, although the functionality and styling is seriously broken. Refreshing the page shows no improvement, and no errors are shown in the console.
Clearing the cache and changing the port in the scrip seem to solve the issue, but it requires me to have bookmarks for each project, whereas it is pretty convenient to have a single localhost:8080 URL for all projects.
Has anyone come across this issue, and is there a solution other than clearing cache and changing ports?
This thread discusses methods to prevent client side caching of content served by the development server in Django:
Fighting client-side caching in Django
I prefer to simply disable caching in my browser though, seeing that I spend so much time on developing that I don't want to bother with the hassle of trying to prevent it in my own code.
A simple web search for "how to disable caching in firefox" came up with this:
http://support.mozilla.org/en-US/questions/764993
I'm pretty sure that searching for the same thing for different browsers will also give you expected results.
EDIT:
These guys also seem to go pretty in depth about how to prevent the caching of static files when using the Django development server.
Turn off caching of static files in Django development server
Just add something like this to /etc/hosts:
127.0.0.1 site1.dev
127.0.0.1 site2.dev
Visit site1.dev:8080, now site1 has its own cache and cookies (session) in the browser.

Cfm page gets downloaded instead of rendering in the browser

I have done the setup for coldfusion-61.When I try to hit the URL for a cfm page, a download window pops up asking if I want to save the file. This happens in the Internet Explorer. In Mozilla it just shows the code written in the cfm file. I looked up on the internet and what most people suggested was re installation but the issue persists . Any suggestions ?
As your using port 8500 I presume you are using the internal server and do bot gave iis installed?
Are you sure that you chose rhis option during installation?
Also have you checked the service is actually running.
I ran into this on CF10, was in the end an issue with the Application Pool. I had to recreate the pool and could then move forward with other issues.

Coldfusion Server Standalone server displaying source code

I needed to install Coldfusion 8 on my local Windows 7 PC, to do some testing. I took the easy route and installed the Standalone server, which included a built in web server. I didn't really need a fully fledged web server, just needed to test.
So after some time of Coldfusion working fine. It started displaying the source code of the page. In other words, Coldfusion was not parsing the page. Merely displaying the source code.
I've worked out that the following line will make the page display source code
<?xml version="1.0" encoding="utf-16"?>
Even if I remove this line from the source code, the source code is still displayed. So I have to make another .cfm file with all the code except the above line, for it to run.
My question is, how do I clear the Coldfusion Standalone Web Server's cache? I've tried the usual restarting of Coldfusion to no avail.
Update: I eventually used a workaround of just renaming the files ie: testing1.cfm, testing2.cfm. For anyone else getting this issue, just use a standalone web server like Apache.
Have you tried restarting ColdFusion?
Have you tried clearing the cache in your browser?
For what it is worth, I prefer to use a web server even when doing development. I have found that using the CF web server and having all my projects under the CF web root can lead to pathing issues in production.
Not sure if you have already fixed this issue but there is an option in the ColdFusion administrator under the Settings > Caching option. At the bottom is a button named Clear Template Cache Now. Clicking that button will empty (remove) any templates that ColdFusion has cached. The next request to that template will force ColdFusion to recompile it if it has been modified.