Re: Trouble with CSS/Static Files
Have you ran $ manage.py collectstatic On Thursday, April 4, 2013 12:49:11 AM UTC-7, Vibhu Rishi wrote: > > I am not sure where I am going wrong, but the CSS files are just not > getting picked up. I have just started a project and am using the dev > server with the runserver command. > > Here's my relevant settings.py : > > > STATIC_ROOT = os.path.join(os.path.dirname(__file__),'/static/') > STATIC_URL = '/static/' > > My directory structure : > . > ├── homepage > │ └── templates > │ └── homepage > ├── qj > └── static > ├── css > ├── img > └── js > > qj is where my settings.py file is. > static is where i have the css. I am using bootstrap css files. I want it > to be at the top location as these files are going to be used in all the > apps that i will be writing. > homepage is where i have the index page that I am trying to link the css > to. the html is as follows : > > $ cat homepage/templates/homepage/index.html > > > > > {% load static %} > Hello World! > > > media="screen"> > > > Hello World > http://code.jquery.com/jquery.js";> > > > > > I am trying both the {% static %} and the hardcoded static/js to see > if it is working. The following is the output i get on loading the / page: > > [04/Apr/2013 12:23:38] "GET / HTTP/1.1" 200 413 > [04/Apr/2013 12:23:38] "GET /static/css/bootstrap.min.css HTTP/1.1" *404*1667 > [04/Apr/2013 12:23:38] "GET /static/js/bootstrap.min.js HTTP/1.1" *404*1661 > > It just is not picking up the css or the js file. What am I doing wrong ? > > Regards, > Vibhu > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: [django-users] How to dynamically set crop processor parameters in django-imagekit ?
Not sure if this is the direction you are looking to go but I have had great luck using http://sorl-thumbnail.readthedocs.org/en/latest/examples.html You do your template cropping in the template, This does require you to setup a caching server. Hope this helps! On Thursday, April 4, 2013 2:44:31 PM UTC-7, leonardo wrote: > > Hi, > > I am using django-imagekit to crop images. > I have this model: > > *from imagekit.models import ImageSpecField* > *from imagekit.processors import Crop* > > *class Image(models.Model):* > *x1 = models.IntegerField(blank=True, default=0)* > *y1 = models.IntegerField(blank=True, default=0)* > *height = models.IntegerField(blank=True, default=0)* > *width = models.IntegerField(blank=True, default=0)* > *image_file = models.ImageField(upload_to='images/')* > * > * > *cropped_image = ImageSpecField(* > *[Crop(width=171, height=82, anchor=None, x=-224, y=-283)],* > *image_field='image_file',* > *format='JPEG', options={'quality': 90})* > > How can I use the object's attributes x1, y1, width and height as > parameters to Crop processor ? > > Regards, > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.