Re: Another problem with django static files
On Mar 22, 9:58 pm, jim_rainwrote: > Brian - > > Thanks for the reply - I missed that step. But when I added it the > behavior changed but still no joy. The form has text field in addition > to the date picker - it looks like this: > > class JTestForm(forms.Form): > input = forms.CharField(label='Please enter some input', > max_length=100) > start_time = > JqSplitDateTimeField(widget=JqSplitDateTimeWidget(attrs={'date_class':'date > picker','time_class':'timepicker'})), > > In my template I was outputting {{ form.as_p }} > > I would see the CharField but not the date picker. So I changed my > template to {{ form.media }} then I don't see anything (neither > field) . > > Also when I do that the out put from runserver changed to: "GET /myApp/ > jtest/ HTTP/1.1" 200 283 > > Any other suggestions or ideas are very welcome as I'm pretty > stumped. > > Jim Well it is really hard to say without knowing what that javascript does or seeing your code. The javascript might be error-ing out mid- way through and leaving your HTML in a bad way. Get it working first without the fancy javascript. Then add one thing in at a time, it will be easier to debug that way. Also, look in the debug server output for HTTP responses to requests for the javascript and CSS assets. If you see 404 then you know something isn't right with your static files setup. If you don't see any requests for the javascript or CSS, you probably forgot to output the and
Re: Another problem with django static files
Brian - Thanks for the reply - I missed that step. But when I added it the behavior changed but still no joy. The form has text field in addition to the date picker - it looks like this: class JTestForm(forms.Form): input = forms.CharField(label='Please enter some input', max_length=100) start_time = JqSplitDateTimeField(widget=JqSplitDateTimeWidget(attrs={'date_class':'datepicker','time_class':'timepicker'})), In my template I was outputting {{ form.as_p }} I would see the CharField but not the date picker. So I changed my template to {{ form.media }} then I don't see anything (neither field) . Also when I do that the out put from runserver changed to: "GET /myApp/ jtest/ HTTP/1.1" 200 283 Any other suggestions or ideas are very welcome as I'm pretty stumped. Jim On Mar 22, 5:26 pm, Brian Nealwrote: > On Mar 22, 6:49 pm, jim_rain wrote: > > > > > > > > > > > I'm running Django 1.2.5 on a linux (Centos 5.5) server and I'm trying > > to use a datepicker widget written by Aaron Williamson (http:// > > copiesofcopies.org/webl/2010/04/26/a-better-datetime-widget-for- > > django/) > > > I followed all the steps in his write up but when I try to access the > > form with the datepicker on it I don't see anything and the runserver > > outputs: "GET /myApp/jtest/ HTTP/1.1" 200 409 > > > I'm pretty sure this is because Django can't find my media files but I > > can't figure out why. I have added this to my urls.py: > > > (r'^site_media/(?P.*)$', 'django.views.static.serve', > > {'document_root': '/home/jim/work_area/site_base/site_media', > > 'show_indexes': True}), > > > and when I go tohttp://localhost/site_mediaIsee a directory listing > > of all the media directories and files. > > > In my widget class I have the following inner class: > > > class Media: > > css = { > > 'all' : ("site_media/css/ui-lightness/jquery- > > ui-1.8.11.custom.css", ), > > } > > js = ( > > "site_media/js/jqsplitdatetime.js", > > "site_media/js/jquery-1.5.1.min.js", > > "site_media/js/jquery-ui-1.8.11.custom.min.js", > > ) > > > I thought that would do it but apparently not. Can anybody tell me > > what I"m missing? > > > Thank you. > > Did you output {{ form.media }} in your template? > > Best, > BN -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Another problem with django static files
On Mar 22, 6:49 pm, jim_rainwrote: > I'm running Django 1.2.5 on a linux (Centos 5.5) server and I'm trying > to use a datepicker widget written by Aaron Williamson (http:// > copiesofcopies.org/webl/2010/04/26/a-better-datetime-widget-for- > django/) > > I followed all the steps in his write up but when I try to access the > form with the datepicker on it I don't see anything and the runserver > outputs: "GET /myApp/jtest/ HTTP/1.1" 200 409 > > I'm pretty sure this is because Django can't find my media files but I > can't figure out why. I have added this to my urls.py: > > (r'^site_media/(?P.*)$', 'django.views.static.serve', > {'document_root': '/home/jim/work_area/site_base/site_media', > 'show_indexes': True}), > > and when I go tohttp://localhost/site_mediaI see a directory listing > of all the media directories and files. > > In my widget class I have the following inner class: > > class Media: > css = { > 'all' : ("site_media/css/ui-lightness/jquery- > ui-1.8.11.custom.css", ), > } > js = ( > "site_media/js/jqsplitdatetime.js", > "site_media/js/jquery-1.5.1.min.js", > "site_media/js/jquery-ui-1.8.11.custom.min.js", > ) > > I thought that would do it but apparently not. Can anybody tell me > what I"m missing? > > Thank you. Did you output {{ form.media }} in your template? Best, BN -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.