Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme not loading static files #11

Open
chrisfranklin opened this issue Mar 15, 2013 · 6 comments
Open

Theme not loading static files #11

chrisfranklin opened this issue Mar 15, 2013 · 6 comments

Comments

@chrisfranklin
Copy link

Hey,

I am attempting to use the following path in my templates:

{{ STATIC_URL }}themes/chequers/static/

For example:

<link rel="stylesheet" href="{{ STATIC_URL }}themes/chequers/static/css/gumby.css">

My theme is called chequers and the directory structure is as follows:

chequers
├── config.rb
├── README.md
├── static
│   ├── apple-touch-icon.png
│   ├── apple-touch-icon-precomposed.png
│   ├── component.json
│   ├── css
│   │   ├── font-awesome.min.css
│   │   ├── gumby.css
│   │   └── style.css
│   ├── facebook.jpg
│   ├── favicon.png
│   ├── fonts
│   │   ├── CARDIF_B.eot
│   │   ├── CARDIFBI.eot
│   │   ├── CARDIFBI.TTF
│   │   ├── CARDIF_B.TTF
│   │   ├── CARDIF__.eot
│   │   ├── CARDIF_I.eot
│   │   ├── CARDIF_I.TTF
│   │   ├── CARDIF__.TTF
│   │   ├── FontAwesome.otf
│   │   ├── fontawesome-webfont.eot
│   │   ├── fontawesome-webfont.svg
│   │   ├── fontawesome-webfont.ttf
│   │   ├── fontawesome-webfont.woff
│   │   └── icons
│   │       ├── entypo.eot
│   │       ├── entypo.ttf
│   │       └── entypo.woff
│   ├── humans.txt
│   ├── img
│   │   ├── bg.svg
│   │   ├── [email protected]
│   │   ├── gumby_mainlogo.png
│   │   └── img_silence_demo.jpg
│   ├── js
│   │   ├── libs
│   │   │   ├── gumby.js
│   │   │   ├── gumby.min.js
│   │   │   ├── jquery-1.8.3.min.js
│   │   │   ├── modernizr-2.6.2.min.js
│   │   │   └── ui
│   │   │       ├── gumby.checkbox.js
│   │   │       ├── gumby.fixed.js
│   │   │       ├── gumby.radiobtn.js
│   │   │       ├── gumby.retina.js
│   │   │       ├── gumby.skiplink.js
│   │   │       ├── gumby.tabs.js
│   │   │       ├── gumby.toggleswitch.js
│   │   │       └── jquery.validation.js
│   │   ├── main.js
│   │   └── plugins.js
│   └── sass
│       ├── _base.scss
│       ├── _custom.scss
│       ├── _fonts.scss
│       ├── functions
│       │   ├── _all.scss
│       │   ├── _breakpoints.scss
│       │   ├── _buttons.scss
│       │   ├── _forms.scss
│       │   ├── _grid-calc.scss
│       │   ├── _height-calc.scss
│       │   ├── _line-and-height.scss
│       │   ├── _responsivity.scss
│       │   ├── _strip-units.scss
│       │   └── _typography.scss
│       ├── _grid.scss
│       ├── gumby.scss
│       ├── _typography.scss
│       ├── ui
│       │   ├── _all.scss
│       │   ├── _buttons.scss
│       │   ├── _forms.scss
│       │   ├── _icons.scss
│       │   ├── _images.scss
│       │   ├── _labels.scss
│       │   ├── _navbar.scss
│       │   ├── _tabs.scss
│       │   └── _video.scss
│       └── var
│           ├── icons
│           │   ├── _entypo-icon-list.scss
│           │   └── _entypo.scss
│           ├── _lists.scss
│           └── _settings.scss
└── templates
    ├── index.html
    └── template_2.html

I do not seem to be able to load any static files and I am unsure of how to debug the problem. Any help would be appreciated. Thanks a lot!

@chrisfranklin
Copy link
Author

I have noticed I need to set these two settings to avoid an error when uploading a theme:

DEFAULT_TEMPLATE_DIRS = TEMPLATE_DIRS
DEFAULT_STATICFILES_DIRS = STATICFILES_DIRS

I have also noticed I need to delete the .git folder before uploading the theme tarball or I get a permissions error.

@chrisfranklin
Copy link
Author

This line is causing a problem: https://github.com/MegaMark16/django-cms-themes/blob/master/cms_themes/__init__.py#L62

It generates this error:

An error occured setting up the themes: No module named conf.patch
Validating models...

0 errors found
Django version 1.4.5, using settings 'tart.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Possibly related to this:

https://github.com/divio/django-cms/pull/1565/files

@chrisfranklin
Copy link
Author

It might need to be blank or

from cms import constants 

now instead.

@chrisfranklin
Copy link
Author

Adding:

STATICFILES_DIRS = (
    ("themes", os.path.join(PROJECT_PATH, "themes/")),
)

Fixed the problem but it should be getting set as I have THEME_DIR set.

@ethoms
Copy link

ethoms commented Jul 14, 2013

Thanks chrisfranklin, you helped me clear those errors myself. I have a question: I can install the theme from the admin site, but I have to manually add the theme templates to settings.py ( TEMPLATE_DIRS & CMS_TEMPLATES). Is this how it should be?

@chrisfranklin
Copy link
Author

Yeah I think so mate, would using the same names across your themes work? E.g. home.html, about.html etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants