Changes between Version 20 and Version 21 of DosAndDontsForApplicationWriters
- Timestamp:
- Aug 5, 2011, 7:10:41 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DosAndDontsForApplicationWriters
v20 v21 54 54 (e.g., a {{{<style>}}} or {{{<link>}}}s) 55 55 * {{{content}}}; the main content of the document 56 * You should refer to media-files with a configurable prefix, 57 in the example a good setting would be {{{MNEMOSYNE_MEDIA_ROOT}}}. 56 * You should refer to static files relative to the setting STATIC_URL, per https://docs.djangoproject.com/en/1.3/howto/static-files/#referring-to-static-files-in-templates. 58 57 For example: 59 58 {{{ 60 <link rel='stylesheet' href='{{ MNEMOSYNE_MEDIA_ROOT}}/my.css' />59 <link rel='stylesheet' href='{{ STATIC_URL }}/my.css' /> 61 60 }}} 62 61 * You should refer to pages in your application with either relative links, … … 73 72 own views. 74 73 75 == Mediafiles ==74 == Static files == 76 75 77 * Your media-files should go into {{{mnemosyne/media/}}}. 78 ''Should that be ''{{{mnemosyne/media/mnemosyne/}}}''? It would mirror 79 the templates, and probably looks better in ''{{{Alias}}}''-directives 80 in Apache-configurations ;)'' 76 * Your static files should go into {{{static}}} subdirectories of your app directories. See https://docs.djangoproject.com/en/1.3/howto/static-files/#basic-usage. Or if they're not specific to one app, create a {{{static}}} directory at the top of your project, put them there, and add that directory to STATICFILES_DIRS. 81 77 82 78 == Settings == … … 135 131 package_dir = {'': 'src'}, 136 132 package_data = {'ibofobi.apps.mnemosyne': ['templates/mnemosyne/*.html', 137 ' media/*',],},133 'static/*',],}, 138 134 # distutils complain about these, anyone know an easy way to silence it? 139 135 namespace_packages = ['ibofobi.apps'],