1

I'm working on a project. So first, i started with front-end. And then after finishing that, i loaded all the files in django app and started the localhost. But suddenly everything seems to be bigger. Most of the padding, margin, font-size, changes from small to big

I have disabled cache, recoded all the static linkings

1.front end designed locally is the first image.

2.frond end after loading into localhost is the second image

Why is this happening, is there any solution for this. Do I have to redesign all on the perspective of localhost AGAIN?

Front-end designed locally Front-end after loading into localhost

  • Are you sure all the css files are loaded? If you're also using third party css libs (bootstrap et al.) make sure the versions are same. – xyres Nov 05 '21 at 09:25
  • yes, i have loaded, and there is no css libs usage – Sidharth Baiju Nov 05 '21 at 09:29
  • Try reloading the page with cache disabled. `Dev tools panel > Network tab > Disable cache` – xyres Nov 05 '21 at 09:33
  • Please share full code – Servesh Chaturvedi Nov 05 '21 at 09:33
  • @xyres It doesn't help though but, when i was going to do that, the console was showing an error "Refused to apply style from 'http://localhost:8000/style1.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled. " – Sidharth Baiju Nov 05 '21 at 09:46
  • How are you serving the css file? I'm guessing from a custom view? You ought to let django serve the static files. It will take care of appropriate mime (content-type) headers. See: https://docs.djangoproject.com/es/3.2/howto/static-files/#configuring-static-files – xyres Nov 05 '21 at 09:59
  • @xyres It was mistake while debugging, but now the problem still exist and there is no errors in console – Sidharth Baiju Nov 05 '21 at 10:05

0 Answers0