yes.

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

STATIC_URL = '/static/'



On Monday, July 11, 2016 at 2:56:06 PM UTC-7, Malik Rumi wrote:
>
> Well, I'm stuck again. I am still trying to get my dev site to work with 
> this new bootstrap theme. Debug toolbar is telling me over 1,000 
> staticfiles have been found, but none were used. So if they are found, why 
> aren't they used? I ran findstatic and got this traceback:
>
> (cannon)malikarumi@Tetuoan2:~/Projects/cannon/jamf$ python manage.py 
>> findstatic /static/bootstrap/css/bootstrap.css
>> Traceback (most recent call last):
>> <snip>
>>   File 
>> "/home/malikarumi/Projects/cannon/local/lib/python2.7/site-packages/django/utils/_os.py",
>>  
>> line 78, in safe_join
>>     'component ({})'.format(final_path, base_path))
>> django.core.exceptions.SuspiciousFileOperation: The joined path 
>> (/static/bootstrap/css/bootstrap.css) is located outside of the base path 
>> component (/home/malikarumi/Projects/cannon/jamf/static)
>> (cannon)malikarumi@Tetuoan2:~/Projects/cannon/jamf$ 
>>
>
>
> So I took '/static' off the front of the path, because in my settings I 
> have:
>
> STATICFILES_DIRS = [
>>     os.path.join(BASE_DIR, 'static'),
>>
>     
> and I thought perhaps that was causing a problem, but it made no 
> difference:    
>
> django.core.exceptions.SuspiciousFileOperation: The joined path 
> (/bootstrap/css/bootstrap.css) is located outside of the base path 
> component (/home/malikarumi/Projects/cannon/jamf/static)
>
>
> Then, following 
> https://docs.djangoproject.com/en/1.9/ref/settings/#staticfiles-dirs, I 
> made a list of all the paths with bootstrap stuff in them, but then I got a 
> new error:
>
>   File 
>> "/home/malikarumi/Projects/cannon/local/lib/python2.7/site-packages/django/core/files/storage.py",
>>  
>> line 299, in listdir
>>     for entry in os.listdir(path):
>> OSError: [Errno 2] No such file or directory: 
>> '/home/Projects/cannon/jamf/static/bootstrap'
>>
>
> Note, the string in STATICFILES_DIRS does have the slash after bootstrap, 
> but that seems to make no difference:
>
>    '/home/Projects/cannon/jamf/static/bootstrap/',
>
>    
> Finally, taking yet another look at the docs, I took the os.dir line out 
> and made it another path in the list, but still that made no difference:
>
>   File 
>> "/home/malikarumi/Projects/cannon/local/lib/python2.7/site-packages/django/core/files/storage.py",
>>  
>> line 299, in listdir
>>     for entry in os.listdir(path):
>> OSError: [Errno 2] No such file or directory: 
>> '/home/Projects/cannon/jamf/static'
>>
>
>    
> Need I also say the directory does in fact exist? What's going on here? 
> Thanks.
>

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/faf2b2eb-c8b1-4084-a5a6-cc82ea2d1369%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to