Jump to content

Bailey

Helpers
  • Posts

    803
  • Joined

  • Last visited

  • Days Won

    11

Posts posted by Bailey

  1. Hello,

     

    Is the GZIP module allowed/installed on the server configuration because I'm trying to use it but it isn't working. I'm sure this is to do with the server and not me.

     

    The snippet I'm using:

     

     

    <ifModule mod_gzip.c>
    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
    </ifModule>
    

     

    Thanks,

    Bailey

  2. Add this line to your apps "django.contrib.staticfiles" as this provides a convenience management command for gathering static files in a single directory so you can serve them easily.

    Set the

    STATIC_ROOT
    
    setting in the config file (I am unsure where this goes due to it being a while however it is in the file with the main configs) to the directory from which youd like to serve these files, for example:

    STATIC_ROOT = "C:/path/to/website/example.com/static/"
    
    Run the collectstatic management command:

    $ python manage.py collectstatic
    
    This will copy all files from your static folders, such as the admin page, into the static directory (example.com/static).

     

    Now upload. :)

×
×
  • Create New...