Re: difficulty with static files
ok, I do think its confusing, but I'm happy to admit it might just be me.
On Thursday, November 29, 2012 6:00:26 PM UTC, Sammy wrote:
--Hello django expertsI am unable to get my static files to work. Here are my settings:projectfiles||-----myproject| || |-----static| | || | |-----css| | |-----js| |-----__init__.py| |-----settings.py| |-----urls.py| |-----wsgi.py||-----myapp||-----templates++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++ settings.pyimport osSITE_ROOT = (os.path.realpath(os.path.dirname(__file__))).replace('\ \','/') DEBUG = TrueMEDIA_ROOT = (os.path.join(SITE_ROOT, '/static')).replace('\\','/')MEDIA_URL = '/static/'STATIC_ROOT = ''STATIC_URL = ''STATICFILES_DIRS = ()STATICFILES_FINDERS = ('django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'django.contrib.staticfiles.finders.DefaultStorageFinder', )++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++ urls.pyurlpatterns = patterns('',(r'^myurl/$', myview),)from myproject.settings import DEBUGif DEBUG:urlpatterns += patterns('', (r'^static/(?P<path>.*)$', 'django.views.static.serve',{'document_root': 'static'}))++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++ the app works fine but no connection to my css's or javascripts.I'm using pycharm if that makes a difference.Any help would be greatly appreciated.
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/BgIzvRqAR_kJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home