Thursday, September 15, 2016

Re: Import css in Django

On 16/09/2016 11:47 AM, Jonathan Cheng wrote:
> after importing announce,directories in settings.py
> |
> |
> ifDEBUG:
> Â Â Â Â announce(__name__,databases=DATABASES,backend="Postgres:
> 9.5",caches=CACHES)
> |
> |
> it said CACHES isn't defined when i running the server
> |
> python manage.py runserver
> |
>

Ok. In announce.py line 11 change caches to caches=None

11. def announce(name, databases, backend, caches=None):


I define CACHES *only* for my development settings and I *only* call
announce() during development.

If you decide to do this, put it behind a conditional ...

if DEBUG:
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}

Mike



>
>
>
>
>
>
>
>
>
>
> Mike Dewhirstæ–¼ 2016å¹´9月16日星期äº"
> UTC+8ä¸Šå ˆ8時43分17ç§'寫é ":
>
> On 16/09/2016 1:10 AM, Jonathan Cheng wrote:
> > thx your code,though i cant run it in cmd
> That is correct. It is designed to be imported and called from
> settings.py.
>
> I'll send you a screenshot off-line
>
> Mike
>
>
>
> --
> 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
> <mailto:django-users+unsubscribe@googlegroups.com>.
> To post to this group, send email to django-users@googlegroups.com
> <mailto: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/a9036fd7-62bc-42ca-901e-418eb57491ff%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/a9036fd7-62bc-42ca-901e-418eb57491ff%40googlegroups.com?utm_medium=email&utm_source=footer>.
> 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f4dbc696-d177-d394-f5bd-c50b907d327c%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment