1👍
Thanks theguywhoanswered for the answer(which I presume he has deleted). It resolved my issue. The cause was two fold and needed the following modifications.
Changes required
In settings.py add
PROJECT_ROOT = Path(__file__).ancestor(2)
STATIC_ROOT= os.path.join(PROJECT_ROOT,'static_media/')
STATIC_URL = '/static/'
In urls.py add
urlpatterns += patterns('',
url(r'static/(.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
)
Also create a admin.py file under books directory whose contents should be :
from django.contrib import admin
from books.models import Publisher, Author, Book
admin.site.register(Publisher)
admin.site.register(Author)
admin.site.register(Book)
also run python manage.py collectstatic
from mysite directory
After doing all this restart the server. Your page should look like below
0👍
Make sure that django.contrib.staticfiles
in settings.py is uncommented, this it was my trouble.
- [Answer]-Django Error: No module named 'UserAuth.forms'
- [Answer]-Is there a way to change the password_reset_confirm link sent by django?
- [Answer]-Suggestion of library like django bootstrap toolkit using briliant HTML5 client side validation in all the produced forms
- [Answer]-Haystack: stats() and stats_results() doesn't work
- [Answer]-NoReverseMatch error with Django
Source:stackexchange.com