You do it wrong. You shouldn't turn your code in quotes. Watch here how it should be
It should be like:
STATICFILES_DIRS = (
os.path.join(os.path.dirname(__file__), "static")
)
Also it belongs to your MEDIA_ROOT and STATIC_ROOT settings.
You do it wrong. You shouldn't turn your code in quotes. Watch here how it should be
It should be like:
STATICFILES_DIRS = (
os.path.join(os.path.dirname(__file__), "static")
)
Also it belongs to your MEDIA_ROOT and STATIC_ROOT settings.
@chris
STATIC_ROOT and MEDIA_ROOTS are absolute paths and they cannot be tuples so no ","(commas) is allowed, So mention the absolute path as "/your/static/file/absolute/path"
Hope this will help :)
[master] AttributeError: 'tuple' object has no attribute 'startswith'
python - AttributeError: 'tuple' object has no attribute 'startswith' when start migrate - Stack Overflow
AttributeError: 'tuple' object has no attribute 'startswith' when using Python httplib - Stack Overflow
python - 'tuple' object has no attribute 'startswith' when stripping first and last quote from the string in pandas - Stack Overflow
Videos
You return four variables s1,s2,s3,s4 and receive them using a single variable obj. This is what is called a tuple, obj is associated with 4 values, the values of s1,s2,s3,s4. So, use index as you use in a list to get the value you want, in order.
Copyobj=list_benefits()
print obj[0] + " is a benefit of functions!"
print obj[1] + " is a benefit of functions!"
print obj[2] + " is a benefit of functions!"
print obj[3] + " is a benefit of functions!"
You're returning a tuple. Index it.
Copyobj=list_benefits()
print obj[0] + " is a benefit of functions!"
print obj[1] + " is a benefit of functions!"
print obj[2] + " is a benefit of functions!"
Hello!
i have created a list in my code that ends in me having a list of coordinates listed as such:
0: (x,y)
1: (x,y)
2: (x,y) …..
that coordinates belong to little squares that have corresponding colours.
i wanted to make it:
0: (x,y,’RED’)
1: (x,y,’BLUE’)
2: (x,y,’BLUE’) …..
but when i call my list and do list[0].append(‘RED’) i get ‘tuple’ object has no attribute ‘append’
i wanted to do it this way because there can be a lot of boxes and i’d like to do it inside a for loop
any help??