skip to Main Content

I’m trying to import css from a static directory, but I’m getting the following error:

Please help me as soon as possible.enter image description here

enter image description here
I’m trying to import css from a static directory, but I’m getting the following error:

Please help me as soon as possible

2

Answers


  1. If you are developing a Django project and are trying to import CSS files, you may encounter the error message "ImportError: cannot import name CSS". This error can be frustrating and can prevent you from completing your project. In this post, you will learn how to fix this error and improve your Django development skills.
    learn more – https://hinditechbate.blogspot.com/2023/04/how-to-fix-importerror-cannot-import.html

    Login or Signup to reply.
  2. To solve your issue for running the code in local (121.0.0.1:8000), try adding the following code in your settings.py

    # settings.py
    
    # DEBUG turned on for dev only, never in production
    DEBUG = True
    
    if DEBUG:
        import mimetypes
        mimetypes.add_type("text/css", ".css", True)
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search