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

Mike

On 12/09/2016 1:58 AM, Jonathan Cheng wrote:
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
staticfiles tag

2016-09-11 7:29 GMT+02:00 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 - index.html
>
> Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â - images
> Â  Â  Â  Â  Â  Â  Â - static - mysite - assets - css - main.css
>
> Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â Â  - js
>
> Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â Â  ...
> In my index.html
>
> add
>
> `{% load staticfiles % }
> Â  Â  Â  Â  `
>
> it said i have a Invalid block tag about TemplateSyntaxError
> ``
>
> views.py (about static files part)
> ```STATICFILES_DIRS = [
> Â  Â  os.path.join(BASE_DIR, "static"),
> Â  Â  '/mysite/static/',
> ]
> STATIC_URL = '/static/'
> STATIC_ROOT='/mysite/static/'```
>
> what's part should i notice?
>
> --
> 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...@googlegroups.com .
> To post to this group, send email to django...@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/ef2ea6eb-d1cb-40e2-abef-1af246e02e98%40googlegroups.com

.

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



-- 


Cordialement, Coues Ludovic
+336 148 743 42

--
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+unsubscr...@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/a699584c-d57f-4b84-a38b-fe03638caefd%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+unsubscr...@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/b1119b42-9ca0-4c89-df59-4eb78f562a87%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.
# -*- coding: utf-8 -*-
# Copyright © 2011-2016 Climate Pty Ltd
# SharedSDS is free software subject to the terms of the GNU GPL v3
""" . """
from __future__ import absolute_import, unicode_literals, print_function
import sys
from datetime import datetime as dtm
from django import get_version


def announce(name, databases, backend, caches):
""" Import announce and directories into settings.py and call each
after all settings involved have been established or in local settings
files which import all base settings

Call it like this ...

if DEBUG:
announce(__name__, databases=DATABASES, backend="Postgres: 9.5", 
caches=CACHES)

... where backend is whatever you want as an extra line of info """

print("\n\n\n%s" % 

Re: Django REST Authenticate with Session in external app

2016-09-11 Thread flaudizio
Thank's James.

Very clearly now.



Em domingo, 11 de setembro de 2016 19:13:45 UTC-3, James Schneider escreveu:
>
> On Sep 11, 2016 2:19 PM, "flaudizio" > 
> wrote:
> >
> > Hi guys,
> >
> > I'm a doubt about Django REST auth and an external app's (mobile, 
> desktop).
> >
> > When we work with django in browser we have a session auth. To use 
> session it's possible using django rest with an external app created in C 
> sharp ? Or need to work with tokens in external app consulting my Django 
> API REST ?
> >
>
> You can do either. As long as your app is intelligent enough to perform a 
> standard REST authentication and receive the session token. Most, if not 
> all, languages have libraries built-in to handle this easily.
>
> Token authentication can be used, but you generally see that deployed as a 
> service account for static resources (ie other servers) to communicate, and 
> are not meant to change very often. If you are planning on having the 
> credentials for your API cached in the local app long term, then a token 
> may be advisable.
>
> DRF supports both.
>
> -James
>

-- 
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+unsubscr...@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/cca7a036-d15c-4887-a755-74e134f0d692%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django REST Authenticate with Session in external app

2016-09-11 Thread James Schneider
On Sep 11, 2016 2:19 PM, "flaudizio"  wrote:
>
> Hi guys,
>
> I'm a doubt about Django REST auth and an external app's (mobile,
desktop).
>
> When we work with django in browser we have a session auth. To use
session it's possible using django rest with an external app created in C
sharp ? Or need to work with tokens in external app consulting my Django
API REST ?
>

You can do either. As long as your app is intelligent enough to perform a
standard REST authentication and receive the session token. Most, if not
all, languages have libraries built-in to handle this easily.

Token authentication can be used, but you generally see that deployed as a
service account for static resources (ie other servers) to communicate, and
are not meant to change very often. If you are planning on having the
credentials for your API cached in the local app long term, then a token
may be advisable.

DRF supports both.

-James

-- 
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+unsubscr...@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/CA%2Be%2BciW%2BJ7irVw2t77nf9Ltu1Ret%2B26%3DyX_HhPiaokCR%3DRPvaA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: pymssql

2016-09-11 Thread sum abiut
Thanks heaps for your comments, manage to get it work using the as_dict`
parameter of the `cursor` object,

cus=conn.cursor(as_dict=True)
cus.execute("SELECT budget_code,budget_description,rate_type FROM glbud")
for row in cus:
print(row['budget_code'],row['budget_description'],row['rate_type'])



i am using django, and i prance it


cheers,





On Sat, Sep 10, 2016 at 1:36 AM, john  wrote:

> take a look at
>
> http://pymssql.org/en/latest/pymssql_examples.html
>
> Johnf
>
> On 09/08/2016 05:48 PM, sum abiut wrote:
>
> Hi,
> i have used pymssql to connet to windows database but i want to be able
> iterate and  only print out some specific fields.
>
> here is what i did
>
> conn=pymssql.connect(server,username,password,database)
> cus=conn.cursor()
> cus.execute("SELECT * FROM glbud ")
>
> for row in cus:
>print(row)
> this works perfect, but when i try to iterate through and only print out
> specific fields i got the error NameError: name 'budget_code' is not defined
>
>
> for row in cus:
>print(row.budget_code)
>
>
> NameError: name 'budget_code' is not defined
>
> the column name is budget_code, in mssql server 2008
>
>
> any idea what i am doing wrong? please advise
> --
> 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+unsubscr...@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/CAPCf-y6FWUjFwKw0D-6-8%2BggS6BP7uTFkz_
> aU45452f2sCpCYg%40mail.gmail.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+unsubscr...@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/dd97d1b0-e8d6-51da-7056-67d9c6832cad%40jfcomputer.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+unsubscr...@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/CAPCf-y4gU%3Dsm1dkpai9CbKsFjTNGxLHuB%3DMzx_b54O8PYbi4iw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django REST Authenticate with Session in external app

2016-09-11 Thread flaudizio
Hi guys,

I'm a doubt about Django REST auth and an external app's (mobile, desktop).

When we work with django in browser we have a session auth. To use session 
it's possible using django rest with an external app created in C sharp ? 
Or need to work with tokens in external app consulting my Django API REST ?

Thank's a lot.

-- 
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+unsubscr...@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/cb5f5943-d8e5-47b7-a3c0-43bf61e3a8ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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於 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 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日星期一 UTC+8上午12時53分08秒寫道:
>>>
>>> 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 >> rel="stylesheet" text = 'html/css' href="{% static
>>> 'assets/css/main.css' %}" />.
>>>
>>> At least with a debug configuration, django will search for static
>>> file in each apps' static directory for the path you used as arguments
>>> for static.
>>> With a production configuration, you should use manage.py
>>> collectstatic which will grab all static file and copy them in a
>>> single directory.
>>>
>>> 2016-09-11 18:18 GMT+02:00 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 https://gist.github.com/ to share
>>> >> it
>>> >>
>>> >> 2016-09-11 17:58 GMT+02:00 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
>>> >> >> staticfiles tag
>>> >> >>
>>> >> >> 2016-09-11 7:29 GMT+02:00 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 - index.html
>>> >> >> >
>>> >> >> >  - images
>>> >> >> >  - static - mysite - assets - css - main.css
>>> >> >> >
>>> >> >> > - js
>>> >> >> >
>>> >> >> > ...
>>> >> >> > In my index.html
>>> >> >> >
>>> >> >> > add
>>> >> >> >
>>> >> >> > `{% load staticfiles % }
>>> >> >> > `
>>> >> >> >
>>> >> >> > it said i have a Invalid block tag about TemplateSyntaxError
>>> >> >> > ``
>>> >> >> >
>>> >> >> > views.py (about static files part)
>>> >> >> > ```STATICFILES_DIRS = [
>>> >> >> > os.path.join(BASE_DIR, "static"),
>>> >> >> > '/mysite/static/',
>>> >> >> > ]
>>> >> >> > STATIC_URL = '/static/'
>>> >> >> > STATIC_ROOT='/mysite/static/'```
>>> >> >> >
>>> >> >> > what's part should i notice?
>>> >> >> >
>>> >> >> > --
>>> >> >> > 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...@googlegroups.com.
>>> >> >> > To post to this group, send email to django...@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/ef2ea6eb-d1cb
>>> -40e2-abef-1af246e02e98%40googlegroups.com.
>>> >> >> > For more options, visit https://groups.google.com/d/optout.
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >> --
>>> >> >>
>>> >> >> Cordialement, Coues Ludovic
>>> >> >> +336 148 743 42
>>> >> >
>>> >> > --
>>> >> > 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...@googlegroups.com.
>>> >> > To post to this group, send email to django...@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/a699584c-d57f
>>> -4b84-a38b-fe03638caefd%40googlegroups.com

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 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日星期一 UTC+8上午12時53分08秒寫道:
>>
>> 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 > rel="stylesheet" text = 'html/css' href="{% static 
>> 'assets/css/main.css' %}" />. 
>>
>> At least with a debug configuration, django will search for static 
>> file in each apps' static directory for the path you used as arguments 
>> for static. 
>> With a production configuration, you should use manage.py 
>> collectstatic which will grab all static file and copy them in a 
>> single directory. 
>>
>> 2016-09-11 18:18 GMT+02:00 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 https://gist.github.com/ to share 
>> >> it 
>> >> 
>> >> 2016-09-11 17:58 GMT+02:00 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 
>> >> >> staticfiles tag 
>> >> >> 
>> >> >> 2016-09-11 7:29 GMT+02:00 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 - index.html 
>> >> >> > 
>> >> >> >  - images 
>> >> >> >  - static - mysite - assets - css - main.css 
>> >> >> > 
>> >> >> > - js 
>> >> >> > 
>> >> >> > ... 
>> >> >> > In my index.html 
>> >> >> > 
>> >> >> > add 
>> >> >> > 
>> >> >> > `{% load staticfiles % } 
>> >> >> > ` 
>> >> >> > 
>> >> >> > it said i have a Invalid block tag about TemplateSyntaxError 
>> >> >> > `` 
>> >> >> > 
>> >> >> > views.py (about static files part) 
>> >> >> > ```STATICFILES_DIRS = [ 
>> >> >> > os.path.join(BASE_DIR, "static"), 
>> >> >> > '/mysite/static/', 
>> >> >> > ] 
>> >> >> > STATIC_URL = '/static/' 
>> >> >> > STATIC_ROOT='/mysite/static/'``` 
>> >> >> > 
>> >> >> > what's part should i notice? 
>> >> >> > 
>> >> >> > -- 
>> >> >> > 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...@googlegroups.com. 
>> >> >> > To post to this group, send email to django...@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/ef2ea6eb-d1cb-40e2-abef-1af246e02e98%40googlegroups.com.
>>  
>>
>> >> >> > For more options, visit https://groups.google.com/d/optout. 
>> >> >> 
>> >> >> 
>> >> >> 
>> >> >> -- 
>> >> >> 
>> >> >> Cordialement, Coues Ludovic 
>> >> >> +336 148 743 42 
>> >> > 
>> >> > -- 
>> >> > 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...@googlegroups.com. 
>> >> > To post to this group, send email to django...@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/a699584c-d57f-4b84-a38b-fe03638caefd%40googlegroups.com.
>>  
>>
>> >> > 
>> >> > For more options, visit https://groups.google.com/d/optout. 
>> >> 
>> >> 
>> >> 
>> >> -- 
>> >> 
>> >> Cordialeme

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 "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 UTC+4:30, Jonathan Cheng wrote:
>>
>>
>> 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 https://gist.github.com/ to share
>>> it
>>>
>>> 2016-09-11 17:58 GMT+02:00 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
>>> >> staticfiles tag
>>> >>
>>> >> 2016-09-11 7:29 GMT+02:00 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 - index.html
>>> >> >
>>> >> >  - images
>>> >> >  - static - mysite - assets - css - main.css
>>> >> >
>>> >> > - js
>>> >> >
>>> >> > ...
>>> >> > In my index.html
>>> >> >
>>> >> > add
>>> >> >
>>> >> > `{% load staticfiles % }
>>> >> > `
>>> >> >
>>> >> > it said i have a Invalid block tag about TemplateSyntaxError
>>> >> > ``
>>> >> >
>>> >> > views.py (about static files part)
>>> >> > ```STATICFILES_DIRS = [
>>> >> > os.path.join(BASE_DIR, "static"),
>>> >> > '/mysite/static/',
>>> >> > ]
>>> >> > STATIC_URL = '/static/'
>>> >> > STATIC_ROOT='/mysite/static/'```
>>> >> >
>>> >> > what's part should i notice?
>>> >> >
>>> >> > --
>>> >> > 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...@googlegroups.com.
>>> >> > To post to this group, send email to django...@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/ef2ea6eb-d1cb
>>> -40e2-abef-1af246e02e98%40googlegroups.com.
>>> >> > For more options, visit https://groups.google.com/d/optout.
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >>
>>> >> Cordialement, Coues Ludovic
>>> >> +336 148 743 42
>>> >
>>> > --
>>> > 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...@googlegroups.com.
>>> > To post to this group, send email to django...@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/a699584c-d57f
>>> -4b84-a38b-fe03638caefd%40googlegroups.com.
>>> >
>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>>> --
>>>
>>> Cordialement, Coues Ludovic
>>> +336 148 743 42
>>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/django-users/h2vrmiJfcbY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@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/c24cc8e8-39f9-47ac-afb0-394eaf1f724c%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 th

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日星期一 UTC+8上午12時53分08秒寫道:
>
> 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  rel="stylesheet" text = 'html/css' href="{% static 
> 'assets/css/main.css' %}" />. 
>
> At least with a debug configuration, django will search for static 
> file in each apps' static directory for the path you used as arguments 
> for static. 
> With a production configuration, you should use manage.py 
> collectstatic which will grab all static file and copy them in a 
> single directory. 
>
> 2016-09-11 18:18 GMT+02:00 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 https://gist.github.com/ to share 
> >> it 
> >> 
> >> 2016-09-11 17:58 GMT+02:00 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 
> >> >> staticfiles tag 
> >> >> 
> >> >> 2016-09-11 7:29 GMT+02:00 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 - index.html 
> >> >> > 
> >> >> >  - images 
> >> >> >  - static - mysite - assets - css - main.css 
> >> >> > 
> >> >> > - js 
> >> >> > 
> >> >> > ... 
> >> >> > In my index.html 
> >> >> > 
> >> >> > add 
> >> >> > 
> >> >> > `{% load staticfiles % } 
> >> >> > ` 
> >> >> > 
> >> >> > it said i have a Invalid block tag about TemplateSyntaxError 
> >> >> > `` 
> >> >> > 
> >> >> > views.py (about static files part) 
> >> >> > ```STATICFILES_DIRS = [ 
> >> >> > os.path.join(BASE_DIR, "static"), 
> >> >> > '/mysite/static/', 
> >> >> > ] 
> >> >> > STATIC_URL = '/static/' 
> >> >> > STATIC_ROOT='/mysite/static/'``` 
> >> >> > 
> >> >> > what's part should i notice? 
> >> >> > 
> >> >> > -- 
> >> >> > 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...@googlegroups.com. 
> >> >> > To post to this group, send email to django...@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/ef2ea6eb-d1cb-40e2-abef-1af246e02e98%40googlegroups.com.
>  
>
> >> >> > For more options, visit https://groups.google.com/d/optout. 
> >> >> 
> >> >> 
> >> >> 
> >> >> -- 
> >> >> 
> >> >> Cordialement, Coues Ludovic 
> >> >> +336 148 743 42 
> >> > 
> >> > -- 
> >> > 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...@googlegroups.com. 
> >> > To post to this group, send email to django...@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/a699584c-d57f-4b84-a38b-fe03638caefd%40googlegroups.com.
>  
>
> >> > 
> >> > For more options, visit https://groups.google.com/d/optout. 
> >> 
> >> 
> >> 
> >> -- 
> >> 
> >> Cordialement, Coues Ludovic 
> >> +336 148 743 42 
> > 
> > -- 
> > 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...@googlegroups.com . 
> > To post to this group, send email to django

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 arguments
for static.
With a production configuration, you should use manage.py
collectstatic which will grab all static file and copy them in a
single directory.

2016-09-11 18:18 GMT+02:00 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 https://gist.github.com/ to share
>> it
>>
>> 2016-09-11 17:58 GMT+02:00 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
>> >> staticfiles tag
>> >>
>> >> 2016-09-11 7:29 GMT+02:00 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 - index.html
>> >> >
>> >> >  - images
>> >> >  - static - mysite - assets - css - main.css
>> >> >
>> >> > - js
>> >> >
>> >> > ...
>> >> > In my index.html
>> >> >
>> >> > add
>> >> >
>> >> > `{% load staticfiles % }
>> >> > `
>> >> >
>> >> > it said i have a Invalid block tag about TemplateSyntaxError
>> >> > ``
>> >> >
>> >> > views.py (about static files part)
>> >> > ```STATICFILES_DIRS = [
>> >> > os.path.join(BASE_DIR, "static"),
>> >> > '/mysite/static/',
>> >> > ]
>> >> > STATIC_URL = '/static/'
>> >> > STATIC_ROOT='/mysite/static/'```
>> >> >
>> >> > what's part should i notice?
>> >> >
>> >> > --
>> >> > 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...@googlegroups.com.
>> >> > To post to this group, send email to django...@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/ef2ea6eb-d1cb-40e2-abef-1af246e02e98%40googlegroups.com.
>> >> > For more options, visit https://groups.google.com/d/optout.
>> >>
>> >>
>> >>
>> >> --
>> >>
>> >> Cordialement, Coues Ludovic
>> >> +336 148 743 42
>> >
>> > --
>> > 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...@googlegroups.com.
>> > To post to this group, send email to django...@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/a699584c-d57f-4b84-a38b-fe03638caefd%40googlegroups.com.
>> >
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>>
>> Cordialement, Coues Ludovic
>> +336 148 743 42
>
> --
> 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+unsubscr...@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/6e864bf6-c12b-49bc-b906-d2c35a5e884b%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
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+unsubscr...@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-user

Re: AssertionError: database connection isn't set to UTC

2016-09-11 Thread Lars Olafsson
it would be great if someone could explain to me, where the offset in the 
function utc_tzinfo_factory comes from. My python skills apparently are not 
sufficient to be able to trace this in the code.

/Lars

On Sunday, September 11, 2016 at 4:59:56 PM UTC+2, Lars Olafsson wrote:
>
> Dear Reader, 
>
> I hope someone here can help me, resolve this issue.
>
> I have installed a new server and even though i have the same exact setup 
> running, and I have even cloned the database from my other server. I get 
> this error when i try to connect to Django on the web. And I cannot figure 
> out why. 
>
> Internal Server Error: /teams/
> Traceback (most recent call last):
>   File "/usr/lib64/python3.4/site-packages/django/core/handlers/base.py", 
> line 149, in get_response
> response = self.process_exception_by_middleware(e, request)
>   File "/usr/lib64/python3.4/site-packages/django/core/handlers/base.py", 
> line 147, in get_response
> response = wrapped_callback(request, *callback_args, **callback_kwargs)
>   File "/usr/lib64/python3.4/site-packages/django/views/generic/base.py", 
> line 68, in view
> return self.dispatch(request, *args, **kwargs)
>   File "/usr/lib64/python3.4/site-packages/django/views/generic/base.py", 
> line 88, in dispatch
> return handler(request, *args, **kwargs)
>   File "/var/www/djc/TeamTournament/teamTournamentApp/views.py", line 167, 
> in get
> return 
> HttpResponseRedirect(reverse('teamTournamentApp:team_tournament',args=(Tournament.objects.latest('start_date').id,)))
>   File "/usr/lib64/python3.4/site-packages/django/db/models/manager.py", 
> line 122, in manager_method
> return getattr(self.get_queryset(), name)(*args, **kwargs)
>   File "/usr/lib64/python3.4/site-packages/django/db/models/query.py", 
> line 544, in latest
> return self._earliest_or_latest(field_name=field_name, direction="-")
>   File "/usr/lib64/python3.4/site-packages/django/db/models/query.py", 
> line 538, in _earliest_or_latest
> return obj.get()
>   File "/usr/lib64/python3.4/site-packages/django/db/models/query.py", 
> line 381, in get
> num = len(clone)
>   File "/usr/lib64/python3.4/site-packages/django/db/models/query.py", 
> line 240, in __len__
> self._fetch_all()
>   File "/usr/lib64/python3.4/site-packages/django/db/models/query.py", 
> line 1074, in _fetch_all
> self._result_cache = list(self.iterator())
>   File "/usr/lib64/python3.4/site-packages/django/db/models/query.py", 
> line 68, in __iter__
> for row in compiler.results_iter(results):
>   File 
> "/usr/lib64/python3.4/site-packages/django/db/models/sql/compiler.py", line 
> 805, in results_iter
> for rows in results:
>   File 
> "/usr/lib64/python3.4/site-packages/django/db/models/sql/compiler.py", line 
> 1239, in cursor_iter
> sentinel):
>   File 
> "/usr/lib64/python3.4/site-packages/django/db/models/sql/compiler.py", line 
> 1238, in 
> for rows in iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)),
>   File "/usr/lib64/python3.4/site-packages/django/db/utils.py", line 102, 
> in inner
> return func(*args, **kwargs)
>   File 
> "/usr/lib64/python3.4/site-packages/django/db/backends/postgresql/utils.py", 
> line 6, in utc_tzinfo_factory
> raise AssertionError("database connection isn't set to UTC")
> AssertionError: database connection isn't set to UTC
>
> I am running Django 1.9.2. 
>
> Find more information on 
> http://stackoverflow.com/questions/38807296/django-1-9-2-assertionerror-database-connection-isnt-set-to-utc
>
> I hope someone can help me?
>
> I do not believe the error is actually what the problem is, there most be 
> something else in the setup which is incorrect. 
>

-- 
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+unsubscr...@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/4bf67c9e-6dd2-4eba-90ff-844f12b9e07e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 UTC+4:30, Jonathan Cheng wrote:
>
>
> 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 https://gist.github.com/ to share 
>> it 
>>
>> 2016-09-11 17:58 GMT+02:00 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 
>> >> staticfiles tag 
>> >> 
>> >> 2016-09-11 7:29 GMT+02:00 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 - index.html 
>> >> > 
>> >> >  - images 
>> >> >  - static - mysite - assets - css - main.css 
>> >> > 
>> >> > - js 
>> >> > 
>> >> > ... 
>> >> > In my index.html 
>> >> > 
>> >> > add 
>> >> > 
>> >> > `{% load staticfiles % } 
>> >> > ` 
>> >> > 
>> >> > it said i have a Invalid block tag about TemplateSyntaxError 
>> >> > `` 
>> >> > 
>> >> > views.py (about static files part) 
>> >> > ```STATICFILES_DIRS = [ 
>> >> > os.path.join(BASE_DIR, "static"), 
>> >> > '/mysite/static/', 
>> >> > ] 
>> >> > STATIC_URL = '/static/' 
>> >> > STATIC_ROOT='/mysite/static/'``` 
>> >> > 
>> >> > what's part should i notice? 
>> >> > 
>> >> > -- 
>> >> > 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...@googlegroups.com. 
>> >> > To post to this group, send email to django...@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/ef2ea6eb-d1cb-40e2-abef-1af246e02e98%40googlegroups.com.
>>  
>>
>> >> > For more options, visit https://groups.google.com/d/optout. 
>> >> 
>> >> 
>> >> 
>> >> -- 
>> >> 
>> >> Cordialement, Coues Ludovic 
>> >> +336 148 743 42 
>> > 
>> > -- 
>> > 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...@googlegroups.com. 
>> > To post to this group, send email to django...@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/a699584c-d57f-4b84-a38b-fe03638caefd%40googlegroups.com.
>>  
>>
>> > 
>> > For more options, visit https://groups.google.com/d/optout. 
>>
>>
>>
>> -- 
>>
>> Cordialement, Coues Ludovic 
>> +336 148 743 42 
>>
>

-- 
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+unsubscr...@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/c24cc8e8-39f9-47ac-afb0-394eaf1f724c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 https://gist.github.com/ to share 
> it 
>
> 2016-09-11 17:58 GMT+02:00 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 
> >> staticfiles tag 
> >> 
> >> 2016-09-11 7:29 GMT+02:00 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 - index.html 
> >> > 
> >> >  - images 
> >> >  - static - mysite - assets - css - main.css 
> >> > 
> >> > - js 
> >> > 
> >> > ... 
> >> > In my index.html 
> >> > 
> >> > add 
> >> > 
> >> > `{% load staticfiles % } 
> >> > ` 
> >> > 
> >> > it said i have a Invalid block tag about TemplateSyntaxError 
> >> > `` 
> >> > 
> >> > views.py (about static files part) 
> >> > ```STATICFILES_DIRS = [ 
> >> > os.path.join(BASE_DIR, "static"), 
> >> > '/mysite/static/', 
> >> > ] 
> >> > STATIC_URL = '/static/' 
> >> > STATIC_ROOT='/mysite/static/'``` 
> >> > 
> >> > what's part should i notice? 
> >> > 
> >> > -- 
> >> > 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...@googlegroups.com. 
> >> > To post to this group, send email to django...@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/ef2ea6eb-d1cb-40e2-abef-1af246e02e98%40googlegroups.com.
>  
>
> >> > For more options, visit https://groups.google.com/d/optout. 
> >> 
> >> 
> >> 
> >> -- 
> >> 
> >> Cordialement, Coues Ludovic 
> >> +336 148 743 42 
> > 
> > -- 
> > 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...@googlegroups.com . 
> > To post to this group, send email to django...@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/a699584c-d57f-4b84-a38b-fe03638caefd%40googlegroups.com.
>  
>
> > 
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
>
> Cordialement, Coues Ludovic 
> +336 148 743 42 
>

-- 
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+unsubscr...@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/6e864bf6-c12b-49bc-b906-d2c35a5e884b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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
>> staticfiles tag
>>
>> 2016-09-11 7:29 GMT+02:00 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 - index.html
>> >
>> >  - images
>> >  - static - mysite - assets - css - main.css
>> >
>> > - js
>> >
>> > ...
>> > In my index.html
>> >
>> > add
>> >
>> > `{% load staticfiles % }
>> > `
>> >
>> > it said i have a Invalid block tag about TemplateSyntaxError
>> > ``
>> >
>> > views.py (about static files part)
>> > ```STATICFILES_DIRS = [
>> > os.path.join(BASE_DIR, "static"),
>> > '/mysite/static/',
>> > ]
>> > STATIC_URL = '/static/'
>> > STATIC_ROOT='/mysite/static/'```
>> >
>> > what's part should i notice?
>> >
>> > --
>> > 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...@googlegroups.com.
>> > To post to this group, send email to django...@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/ef2ea6eb-d1cb-40e2-abef-1af246e02e98%40googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>>
>> Cordialement, Coues Ludovic
>> +336 148 743 42
>
> --
> 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+unsubscr...@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/a699584c-d57f-4b84-a38b-fe03638caefd%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
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+unsubscr...@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/CAEuG%2BTboNzdcLQ77g5qv0ee2HmE3QparcpmSGjpb0yuNX2J3SA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 
> staticfiles tag 
>
> 2016-09-11 7:29 GMT+02:00 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 - index.html 
> > 
> >  - images 
> >  - static - mysite - assets - css - main.css 
> > 
> > - js 
> > 
> > ... 
> > In my index.html 
> > 
> > add 
> > 
> > `{% load staticfiles % } 
> > ` 
> > 
> > it said i have a Invalid block tag about TemplateSyntaxError 
> > `` 
> > 
> > views.py (about static files part) 
> > ```STATICFILES_DIRS = [ 
> > os.path.join(BASE_DIR, "static"), 
> > '/mysite/static/', 
> > ] 
> > STATIC_URL = '/static/' 
> > STATIC_ROOT='/mysite/static/'``` 
> > 
> > what's part should i notice? 
> > 
> > -- 
> > 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...@googlegroups.com . 
> > To post to this group, send email to django...@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/ef2ea6eb-d1cb-40e2-abef-1af246e02e98%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
>
> Cordialement, Coues Ludovic 
> +336 148 743 42 
>

-- 
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+unsubscr...@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/a699584c-d57f-4b84-a38b-fe03638caefd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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
> https://docs.djangoproject.com/en/1.10/intro/tutorial06/
>
> my project name:mysite
>
> structure:
>
> - mysite-
>
>  - mysite - urls.py
>
>-views.py
>
> ...
>
>  - templates - index.html
>
>  - images
>  - static - mysite - assets - css - main.css
>
> - js
>
> ...
> In my index.html
>
> add
>
> `{% load staticfiles % }
> `
>
> it said i have a Invalid block tag about TemplateSyntaxError
> ``
>
> views.py (about static files part)
> ```STATICFILES_DIRS = [
> os.path.join(BASE_DIR, "static"),
> '/mysite/static/',
> ]
> STATIC_URL = '/static/'
> STATIC_ROOT='/mysite/static/'```
>
> what's part should i notice?
>
> --
> 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+unsubscr...@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/ef2ea6eb-d1cb-40e2-abef-1af246e02e98%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
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+unsubscr...@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/CAEuG%2BTZkk8ZRhgO1qyROMa4f5PcuFTpCTNyGN-OE%2Bme-6BSEJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


AssertionError: database connection isn't set to UTC

2016-09-11 Thread Lars Olafsson
Dear Reader, 

I hope someone here can help me, resolve this issue.

I have installed a new server and even though i have the same exact setup 
running, and I have even cloned the database from my other server. I get 
this error when i try to connect to Django on the web. And I cannot figure 
out why. 

Internal Server Error: /teams/
Traceback (most recent call last):
  File "/usr/lib64/python3.4/site-packages/django/core/handlers/base.py", 
line 149, in get_response
response = self.process_exception_by_middleware(e, request)
  File "/usr/lib64/python3.4/site-packages/django/core/handlers/base.py", 
line 147, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib64/python3.4/site-packages/django/views/generic/base.py", 
line 68, in view
return self.dispatch(request, *args, **kwargs)
  File "/usr/lib64/python3.4/site-packages/django/views/generic/base.py", 
line 88, in dispatch
return handler(request, *args, **kwargs)
  File "/var/www/djc/TeamTournament/teamTournamentApp/views.py", line 167, 
in get
return 
HttpResponseRedirect(reverse('teamTournamentApp:team_tournament',args=(Tournament.objects.latest('start_date').id,)))
  File "/usr/lib64/python3.4/site-packages/django/db/models/manager.py", 
line 122, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/lib64/python3.4/site-packages/django/db/models/query.py", line 
544, in latest
return self._earliest_or_latest(field_name=field_name, direction="-")
  File "/usr/lib64/python3.4/site-packages/django/db/models/query.py", line 
538, in _earliest_or_latest
return obj.get()
  File "/usr/lib64/python3.4/site-packages/django/db/models/query.py", line 
381, in get
num = len(clone)
  File "/usr/lib64/python3.4/site-packages/django/db/models/query.py", line 
240, in __len__
self._fetch_all()
  File "/usr/lib64/python3.4/site-packages/django/db/models/query.py", line 
1074, in _fetch_all
self._result_cache = list(self.iterator())
  File "/usr/lib64/python3.4/site-packages/django/db/models/query.py", line 
68, in __iter__
for row in compiler.results_iter(results):
  File 
"/usr/lib64/python3.4/site-packages/django/db/models/sql/compiler.py", line 
805, in results_iter
for rows in results:
  File 
"/usr/lib64/python3.4/site-packages/django/db/models/sql/compiler.py", line 
1239, in cursor_iter
sentinel):
  File 
"/usr/lib64/python3.4/site-packages/django/db/models/sql/compiler.py", line 
1238, in 
for rows in iter((lambda: cursor.fetchmany(GET_ITERATOR_CHUNK_SIZE)),
  File "/usr/lib64/python3.4/site-packages/django/db/utils.py", line 102, 
in inner
return func(*args, **kwargs)
  File 
"/usr/lib64/python3.4/site-packages/django/db/backends/postgresql/utils.py", 
line 6, in utc_tzinfo_factory
raise AssertionError("database connection isn't set to UTC")
AssertionError: database connection isn't set to UTC

I am running Django 1.9.2. 

Find more information 
on 
http://stackoverflow.com/questions/38807296/django-1-9-2-assertionerror-database-connection-isnt-set-to-utc

I hope someone can help me?

I do not believe the error is actually what the problem is, there most be 
something else in the setup which is incorrect. 

-- 
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+unsubscr...@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/a14f8c82-bec6-4e4a-8db9-66e4160acf22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 - index.html 
   
 - images 
 - static - mysite - assets - css - main.css
 
- js

...
In my index.html

add

`{% load staticfiles % }
`

it said i have a Invalid block tag about TemplateSyntaxError
``

views.py (about static files part)
```STATICFILES_DIRS = [
os.path.join(BASE_DIR, "static"),
'/mysite/static/',
]
STATIC_URL = '/static/'
STATIC_ROOT='/mysite/static/'```

what's part should i notice?

-- 
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+unsubscr...@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/ef2ea6eb-d1cb-40e2-abef-1af246e02e98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.