Re: Import css in Django

2016-09-15 Thread Mike Dewhirst
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 |

Re: Import css in Django

2016-09-15 Thread Jonathan Cheng
after importing announce,directories in settings.py if DEBUG: 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 Mike Dewhirst於 2016年9月16日星期五 UTC+8上午8時43分17秒寫道: >

Re: Import css in Django

2016-09-15 Thread Mike Dewhirst
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

Re: Import css in Django

2016-09-15 Thread Jonathan Cheng
thx your code,though i cant run it in cmd Mike Dewhirst於 2016年9月12日星期一 UTC+8上午10時05分10秒寫道: > > Jonathan > > I use the attached announce.py to display exactly where all the > directories and URLs are. I had trouble in the beginning getting it > straight in my head but seeing it every time I

Re: Import css in Django

2016-09-15 Thread Jonathan Cheng
thx everyone,all bugs were fixed early. Jonathan Cheng於 2016年9月11日星期日 UTC+8下午10時59分56秒寫道: > > I use django1.10 > > i reference the official doc > https://docs.djangoproject.com/en/1.10/intro/tutorial06/ > > my project name:mysite > > structure: > > - mysite- > >

Re: Import css in Django

2016-09-12 Thread ludovic coues
manage.py collectstatic is made for that. It will copy every static file in your project into a single directory. Even those included in django like the css of django admin. 2016-09-12 16:57 GMT+02:00 Jonathan Cheng : > i use href="{% static '/assets/css/main.css' %} >

Re: Import css in Django

2016-09-12 Thread Jonathan Cheng
i use href="{% static '/assets/css/main.css' %} and the css worked but i want to use the all files in assets is there any other way to do it? ludovic coues於 2016年9月12日星期一 UTC+8上午1時32分42秒寫道: > > If you look at the html send by django, what is the href value ? > > 2016-09-11 19:15 GMT+02:00

Re: Import css in Django

2016-09-12 Thread Jonathan Cheng
i change into href="{% static '/assets/css/main.css' %} and it worked but if i want to use the all files in static is there any way to do it? ludovic coues於 2016年9月12日星期一 UTC+8上午1時32分42秒寫道: > > If you look at the html send by django, what is the href value ? > > 2016-09-11 19:15 GMT+02:00

Re: Import css in Django

2016-09-12 Thread Jonathan Cheng
i use href="{% static '/assets/css/main.css' %}" and it worked but if i want to use the all files in static is there any way to do? ludovic coues於 2016年9月12日星期一 UTC+8上午1時32分42秒寫道: > > If you look at the html send by django, what is the href value ? > > 2016-09-11 19:15 GMT+02:00 Jonathan Cheng

Re: Import css in Django

2016-09-11 Thread Mike Dewhirst
Jonathan I use the attached announce.py to display exactly where all the directories and URLs are. I had trouble in the beginning getting it straight in my head but seeing it every time I looked at the dev-server output helped a lot. Comments in announce.py show how to use it. Good luck

Re: Import css in Django

2016-09-11 Thread ludovic coues
If you look at the html send by django, what is the href value ? 2016-09-11 19:15 GMT+02:00 Jonathan Cheng : > i fixed usint STATIC_ROOD = '/static/' > it seems to no error > but when i connect to my runserver > the css of assets just doesn't work > > > Jonathan Cheng於

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
i fixed usint STATIC_ROOD = '/static/' it seems to no error but when i connect to my runserver the css of assets just doesn't work Jonathan Cheng於 2016年9月12日星期一 UTC+8上午1時04分22秒寫道: > > here i explain , because i just test how main.css work, finally i want to > use the assets and images . > and

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
thx i change into STATIC_ROOT='/static/' it seems to no error but when i connect to my runserver the css of assets just doesn't work 2016-09-12 0:44 GMT+08:00 ali Eblice : > your "mysite" folder and "static" folder are in a same directory but in > your settings.py you wrote

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
here i explain , because i just test how main.css work, finally i want to use the assets and images . and i use the python mange.py collectstatic it showed ImproperlyConfigured: The STATICFILES_DIRS setting should not contain the > STATIC_ROOT setting > ludovic coues於 2016年9月12日星期一

Re: Import css in Django

2016-09-11 Thread ludovic coues
I mentionned tree because I have doubt about what "static - assets - css - main.css" means. If your path is really /mysite/static/assets/css/main.css, then you want . At least with a debug configuration, django will search for static file in each apps' static directory for the path you used as

Re: Import css in Django

2016-09-11 Thread ali Eblice
your "mysite" folder and "static" folder are in a same directory but in your settings.py you wrote "STATIC_ROOT='/mysite/static/'" which says that static should be subdirectory of mysite which its not a subdirectory its in a same directory of mysite On Sunday, September 11, 2016 at 8:48:57 PM

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
https://gist.github.com/cj10243/fb557903441d4a3e95190b854fbaabe1 ludovic coues於 2016年9月12日星期一 UTC+8上午12時05分12秒寫道: > > I have a hard time to read the paths you use. The command tree produce > a nice tree view of a directory, it might help. You can also use > service like http://paste2.org/ or

Re: Import css in Django

2016-09-11 Thread ludovic coues
I have a hard time to read the paths you use. The command tree produce a nice tree view of a directory, it might help. You can also use service like http://paste2.org/ or https://gist.github.com/ to share it 2016-09-11 17:58 GMT+02:00 Jonathan Cheng : > thx reply,but it

Re: Import css in Django

2016-09-11 Thread Jonathan Cheng
thx reply,but it just can see the original html with no css,is my path setted correct? ludovic coues於 2016年9月11日星期日 UTC+8下午11時45分24秒寫道: > > Have you tried to add a few newlines to be sure about which line is the > issue ? > > Also, in you email, there is a space between % and } in the load >

Re: Import css in Django

2016-09-11 Thread ludovic coues
Have you tried to add a few newlines to be sure about which line is the issue ? Also, in you email, there is a space between % and } in the load staticfiles tag 2016-09-11 7:29 GMT+02:00 Jonathan Cheng : > I use django1.10 > > i reference the official doc >

Import css in Django

2016-09-11 Thread Jonathan Cheng
I use django1.10 i reference the official doc https://docs.djangoproject.com/en/1.10/intro/tutorial06/ my project name:mysite structure: - mysite- - mysite - urls.py -views.py ... - templates -