Friday, November 21, 2014

Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

I don't know.
How to test that?



The things I have done were these:

mkdir templates
mkdir templates/admin
cp /usr/local/lib/python2.7/dist-packages/django/contrib/admin/templates/admin/base_site.html templates/admin/

ls -l templates/admin/base_site.html
-rw-r--r-- 1 user group 338 Nov 21 18:50 templates/admin/base_site.html
(and www-data is member of that group)

nano templates/admin/base_site.html   -> changed it to what I want to see
nano mysite/settings.py  -->   TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]

restarted the server.







On Fri, Nov 21, 2014 at 3:24 AM, Collin Anderson <cmawebsite@gmail.com> wrote:
Hi,

Do other templates work in that folder?

Collin


On Monday, November 17, 2014 4:12:27 PM UTC-5, Andreas Ka wrote:

> Show your view code
The tutorial did not create any view.py for the admin pages




We copied from the Django source files these two into:
/mysite/templates/admin/base_site.html
and
/mysite/templates/admin/index.html



edited:


admin.py

from django.contrib import admin

# Register your models here.

from django.contrib import admin
from polls.models import Choice, Question


class ChoiceInline(admin.TabularInline):
    model = Choice
    extra = 3


class QuestionAdmin(admin.ModelAdmin):
    fieldsets = [
        (None,               {'fields': ['question_text']}),
        ('Date information', {'fields': ['pub_date'], 'classes': ['collapse']}),
    ]
    inlines = [ChoiceInline]
    list_display = ('question_text', 'pub_date', 'was_published_recently')
    list_filter = ['pub_date']
    search_fields = ['question_text']    

admin.site.register(Question, QuestionAdmin)


-------



On Mon, Nov 17, 2014 at 2:11 PM, Artie <giliar...@gmail.com> wrote:
Are you sure about correct path to your templates in views?

Show your view code

понедельник, 17 ноября 2014 г., 5:04:53 UTC+2 пользователь Andreas Ka написал:
thanks for your answer.

yes, I just tried that. Same result.
 
By now, I have understood much more about the templates.
 
But still, for the admin pages
mysite/templates/admin/base_site.html   
doesn't work yet.


...

On Sun, Nov 16, 2014 at 7:19 PM, RLF_UNIQUE <rlfu...@gmail.com> wrote:
Obviously you've restarted the server and refreshed the page in such a way to ensure it's not a caching issue ?

 
 

--
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+unsubscribe@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.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4062bb51-88cd-4c2f-9430-bd6ab87c8902%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@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.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJAOMej0dhMMhYMCZvP-0o2nX6nXxv7-3KWsL8r3X_Y5nqm44A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment