Re: from django.utils.six.moves import range, ImportError: cannot import name 'range'

2017-09-02 Thread James Schneider
On Sep 2, 2017 11:17 PM, "Derek Zeng"  wrote:

Hi,

Today I tried to install my django project on a new mac computer. I used
virutalenv to setup the packages.

After I start the app by running './mange.py runserver' and access the home
page I got the error

from django.utils.six.moves import range, ImportError: cannot import name
> 'range'


Really not sure why it has this weird error. I'm using python 3.6.2

Any help is appreciated!


Is the referenced error coming from code that you wrote?

There's a comma at the end of the import line, which may cause that error.

Also make sure that you've installed Django within your virtualenv. If it
is, then also make sure you have six installed (although Django should have
done that already).

-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%2BciXBx28t5kOo4FdSarW-h4O44UO%3D2JoO-00yd_6o%3DLhPxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


from django.utils.six.moves import range, ImportError: cannot import name 'range'

2017-09-02 Thread Derek Zeng
Hi,

Today I tried to install my django project on a new mac computer. I used 
virutalenv to setup the packages. 

After I start the app by running './mange.py runserver' and access the home 
page I got the error 

from django.utils.six.moves import range, ImportError: cannot import name 
> 'range'


Really not sure why it has this weird error. I'm using python 3.6.2 

Any help is appreciated!

-- 
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/cf286bfb-2879-46d5-95b6-05dc56fc384f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: deploying django project

2017-09-02 Thread Andréas Kühne
You will have to specify your problem more if you want any more help. It's
hard to help you troubleshoot without any more information :-)

Regards,

Andréas

2017-09-02 14:17 GMT+02:00 k2527806 :

> I tried this but my problem was not resolved
>
> On Saturday, September 2, 2017 at 1:44:50 PM UTC+4:30, Andréas Kühne wrote:
>>
>> You could also check out the tutorial at digitalocean:
>>
>> https://www.digitalocean.com/community/tutorials/how-to-serv
>> e-django-applications-with-uwsgi-and-nginx-on-ubuntu-16-04
>>
>> Regards,
>>
>> Andréas
>>
>> 2017-09-02 10:51 GMT+02:00 Antonis Christofides <
>> ant...@djangodeployment.com>:
>>
>>> Hello,
>>>
>>> Deployment is such a big thing it can't easily be summarized in small
>>> step-by-step guides. This is why people are so often frustrated over such
>>> guides and can't get them to work. It's as if a person with zero Python
>>> knowledge says "give me a step-by-step guide on how to build a blog with
>>> Django". You can write a guide, but it's not going to help much.
>>>
>>> You could start (shameless plug) by taking my free Linux course at
>>> http://djangodeployment.com/.
>>>
>>> Regards,
>>>
>>> Antonis
>>>
>>> Antonis Christofideshttp://djangodeployment.com
>>>
>>>
>>> On 2017-09-01 18:29, k2527806 wrote:
>>>
>>> I want deploying my django project on ubuntu 16.04 with nginx and uwsgi
>>> i need some Tips step by step from zero
>>> --
>>> 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/ms
>>> gid/django-users/307ae8ea-4655-40de-9a2c-f138f04af8d8%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...@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/ms
>>> gid/django-users/651f48f8-a30b-3f7a-bd4d-28bfcc810ef8%40djan
>>> godeployment.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/1e55f004-9aff-4663-8dcf-5368d66f11d7%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/CAK4qSCeE-4%3DYH8GeYwQp4nLBzMs-DJ3HzpNa_nMPjq%2B-__R41g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: deploying django project

2017-09-02 Thread k2527806
I tried this but my problem was not resolved

On Saturday, September 2, 2017 at 1:44:50 PM UTC+4:30, Andréas Kühne wrote:
>
> You could also check out the tutorial at digitalocean:
>
>
> https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-uwsgi-and-nginx-on-ubuntu-16-04
>
> Regards,
>
> Andréas
>
> 2017-09-02 10:51 GMT+02:00 Antonis Christofides <
> ant...@djangodeployment.com >:
>
>> Hello,
>>
>> Deployment is such a big thing it can't easily be summarized in small 
>> step-by-step guides. This is why people are so often frustrated over such 
>> guides and can't get them to work. It's as if a person with zero Python 
>> knowledge says "give me a step-by-step guide on how to build a blog with 
>> Django". You can write a guide, but it's not going to help much.
>>
>> You could start (shameless plug) by taking my free Linux course at 
>> http://djangodeployment.com/.
>>
>> Regards,
>>
>> Antonis
>>
>> Antonis Christofideshttp://djangodeployment.com
>>
>>
>> On 2017-09-01 18:29, k2527806 wrote:
>>
>> I want deploying my django project on ubuntu 16.04 with nginx and uwsgi
>> i need some Tips step by step from zero 
>> -- 
>> 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/307ae8ea-4655-40de-9a2c-f138f04af8d8%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...@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/651f48f8-a30b-3f7a-bd4d-28bfcc810ef8%40djangodeployment.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/1e55f004-9aff-4663-8dcf-5368d66f11d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: deploying django project

2017-09-02 Thread Andréas Kühne
You could also check out the tutorial at digitalocean:

https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-uwsgi-and-nginx-on-ubuntu-16-04

Regards,

Andréas

2017-09-02 10:51 GMT+02:00 Antonis Christofides <
anto...@djangodeployment.com>:

> Hello,
>
> Deployment is such a big thing it can't easily be summarized in small
> step-by-step guides. This is why people are so often frustrated over such
> guides and can't get them to work. It's as if a person with zero Python
> knowledge says "give me a step-by-step guide on how to build a blog with
> Django". You can write a guide, but it's not going to help much.
>
> You could start (shameless plug) by taking my free Linux course at
> http://djangodeployment.com/.
>
> Regards,
>
> Antonis
>
> Antonis Christofideshttp://djangodeployment.com
>
>
> On 2017-09-01 18:29, k2527806 wrote:
>
> I want deploying my django project on ubuntu 16.04 with nginx and uwsgi
> i need some Tips step by step from zero
> --
> 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/307ae8ea-4655-40de-9a2c-f138f04af8d8%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/651f48f8-a30b-3f7a-bd4d-28bfcc810ef8%
> 40djangodeployment.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/CAK4qSCfZ5X1Qm1gjqX3nv_tzV8xE9SVY_0BX3bMqZ7Of2FrzTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: deploying django project

2017-09-02 Thread Antonis Christofides
Hello,

Deployment is such a big thing it can't easily be summarized in small
step-by-step guides. This is why people are so often frustrated over such guides
and can't get them to work. It's as if a person with zero Python knowledge says
"give me a step-by-step guide on how to build a blog with Django". You can write
a guide, but it's not going to help much.

You could start (shameless plug) by taking my free Linux course at
http://djangodeployment.com/.

Regards,

Antonis

Antonis Christofides
http://djangodeployment.com


On 2017-09-01 18:29, k2527806 wrote:
> I want deploying my django project on ubuntu 16.04 with nginx and uwsgi
> i need some Tips step by step from zero 
> -- 
> 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/307ae8ea-4655-40de-9a2c-f138f04af8d8%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/651f48f8-a30b-3f7a-bd4d-28bfcc810ef8%40djangodeployment.com.
For more options, visit https://groups.google.com/d/optout.


Re: Render Javascript code

2017-09-02 Thread Antonis Christofides
You probably also need to use the "safe" filter, {{variable_name|safe}}.

Antonis Christofides
http://djangodeployment.com

On 2017-09-02 09:28, James Schneider wrote:
>
>
> On Sep 1, 2017 5:05 PM, "Ahmed Ablak"  > wrote:
>
> Hello, 
>
> I am using Django and have an expensive computing process that takes about
> 12 or 13 hours and generates javascript charts.
>
> When you say JS charts, are you simply referring to data sets, or actual JS
> that includes your data sets?
>
>
> I did the computing using the management command and stored the charts in
> the models as TextField.
>
>
> My question is how to display this javascript code on the template? using
>
> |
> {{variable_name }}
> |
> results in plain javascript text
>
>
> and using 
>
>
>  {{ variable_name}} 
>
>
> results in hidden text with special characters.
>
> JS code will not show when properly identified as JS code. Without surrounding
> it in