Django Channel Error

2017-12-07 Thread Maitreya Verma
I am following this tutorial 
 to learn 
django channels. 
The following procedure was used :

   - Add the following code in settings.py
   redis_host=os.environ.get('REDIS_HOST','localhost')
   
   CHANNEL_LAYERS={
   "default":{
   "BACKEND":"asgi_redis.RedisChannelLayer",
   "CONFIG":{
   "hosts":[(redis_host),6379],
   },
   "ROUTING":'channelproj.routing.channel_routing',
   },
   }
   
   - Create a file routing.py and add the following code
   from channels import route
   # This function will display all messages received in the console
   def message_handler(message):
   print(message['text'])
   
   channel_routing = [
   route("websocket.receive", message_handler),
   ]
   
   - run server using python manage.py runserver and then try to connect to 
   server using  ws.connect("ws://localhost:8000/")

I am getting the following error
websocket._exceptions.WebSocketBadStatusException: Handshake status 200

What can be the reason for this error and how can it be rectified?


-- 
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/d560ebbb-242c-4481-b688-42e2d65c112a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Channel Error

2017-12-07 Thread Maitreya Verma
I am using Django 2.0, django-channels 0.7.0, asgi-redis 1.4.3

On Thursday, December 7, 2017 at 1:33:22 PM UTC+5:30, Maitreya Verma wrote:
>
> I am following this tutorial 
>  to 
> learn django channels. 
> The following procedure was used :
>
>- Add the following code in settings.py
>redis_host=os.environ.get('REDIS_HOST','localhost')
>
>CHANNEL_LAYERS={
>"default":{
>"BACKEND":"asgi_redis.RedisChannelLayer",
>"CONFIG":{
>"hosts":[(redis_host),6379],
>},
>"ROUTING":'channelproj.routing.channel_routing',
>},
>}
>
>- Create a file routing.py and add the following code
>from channels import route
># This function will display all messages received in the console
>def message_handler(message):
>print(message['text'])
>
>channel_routing = [
>route("websocket.receive", message_handler),
>]
>
>- run server using python manage.py runserver and then try to connect 
>to server using  ws.connect("ws://localhost:8000/")
>
> I am getting the following error
> websocket._exceptions.WebSocketBadStatusException: Handshake status 200
>
> What can be the reason for this error and how can it be rectified?
>
>
>

-- 
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/7a052cd8-7070-4606-8e94-b3a6ad4a4840%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Channel Error

2017-12-07 Thread Andrew Godwin
That error means you are not actually running a websocket-capable server.
Did you add "channels" to INSTALLED_APPS?

Andrew

On Thu, Dec 7, 2017 at 12:03 AM, Maitreya Verma 
wrote:

> I am following this tutorial
>  to
> learn django channels.
> The following procedure was used :
>
>- Add the following code in settings.py
>redis_host=os.environ.get('REDIS_HOST','localhost')
>
>CHANNEL_LAYERS={
>"default":{
>"BACKEND":"asgi_redis.RedisChannelLayer",
>"CONFIG":{
>"hosts":[(redis_host),6379],
>},
>"ROUTING":'channelproj.routing.channel_routing',
>},
>}
>
>- Create a file routing.py and add the following code
>from channels import route
># This function will display all messages received in the console
>def message_handler(message):
>print(message['text'])
>
>channel_routing = [
>route("websocket.receive", message_handler),
>]
>
>- run server using python manage.py runserver and then try to connect
>to server using  ws.connect("ws://localhost:8000/")
>
> I am getting the following error
> websocket._exceptions.WebSocketBadStatusException: Handshake status 200
>
> What can be the reason for this error and how can it be rectified?
>
>
> --
> 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/d560ebbb-242c-4481-b688-42e2d65c112a%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/CAFwN1uqzOi%2BqzANQL%2Bzw%2BZYYQM3YP_xNR631_%3DpDM_oYaej5%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Saving webp image near jpg version

2017-12-07 Thread Egor Smolyakov
Actually, you need to use any background library ( like 
https://github.com/arteria/django-background-tasks/ ) for processing 
large-time operations such as image processing. 

On Friday, 17 November 2017 15:24:25 UTC+2, Дмитрий Горобец wrote:
>
> I want to save webp image near jpg version.
>
> Now I'm doing it this way:
> class ProductImage(models.Model):
> product = models.ForeignKey(
> to=Product,
> related_name='images',
> on_delete=models.CASCADE,
> )
>
> image = models.ImageField(
> upload_to=upload_product_image,
> default='',
> blank=True,
> max_length=255,
> )
>
> def save(self, **kwargs):
> super().save(**kwargs)
> self.create_webp_image()
>
> def create_webp_image(self):
> image = Image.open(self.image.path)
> path = os.path.splitext(self.image.path)[0] + '.webp'
> image.save(path, 'WEBP')
>
> Is there more elegant way to do it?
>
> Thank you.
>

-- 
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/a5c78827-bc18-4857-aacc-712916c85fef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Login

2017-12-07 Thread Egor Smolyakov
You can have a look at my project: 
https://github.com/egorsmkv/simple-django-login-and-register

It is simple and uses the built in Django Auth module.

On Monday, 4 December 2017 19:49:32 UTC+2, chaitanya.creator wrote:
>
> Hi 
>  i am new users django .please help in making a login system using django 
> Thank you 
>
>

-- 
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/56f417ed-e9af-4168-99e9-4f46268ad5d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Email and activation key in django.contrib.auth

2017-12-07 Thread Egor Smolyakov
I know that topic is old, but I also find a method for this functionality. 
I don't found so I create it by myself.

See this commit: 
https://github.com/egorsmkv/simple-django-login-and-register/commit/a8ca21f1a6bb4fa4eacbc4e904d9ce9adebdf576


On Wednesday, 12 January 2011 03:18:09 UTC+2, Micah Carrick wrote:
>
> Hey guys,
>
> I've been looking into this for a few hours now and don't have a good 
> solution. I want to use the built in authentication system for a project. 
> However, it's essential that (a) users login using their email address and 
> password only (no username or username=email) and that (b) they must 
> "activate" their account via email containing an activation key.
>
> This is a VERY common authentication paradigm and I can only assume I'm 
> missing something. I've seen many people with the same problem, however, 
> most responses seem to be hacks or very outdated. I'm relatively new to 
> Django (10 years PHP) and am hoping somebody has a link or a few vocabulary 
> words to point me in the right direction. Obviously I could implement this 
> myself, but, I really want to use the built-in auth system. DRY. I would 
> expect it to be relatively simple... override a few class methods or 
> something along those lines.
>
> Any help would be much appreciated. Thanks!
>
> -- 
> Micah Carrick, Founder
>
> *Green Tackle* - *Environmentally Friendly Fishing Tackle*
> www.GreenTackle.com 
>
>  Email: mi...@greentackle.com 
>  Phone: 971.270.2206
>  Toll Free: 877.580.9165
>  Fax: 503.946.3106
>
>
>

-- 
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/ff32a045-7a64-4aa8-82e6-9641ce130bbe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problems with translating URL patterns.

2017-12-07 Thread Egor Smolyakov
I can't do it. Describe what do you want?

On Sunday, 3 December 2017 22:29:05 UTC+2, Juan José Meneses wrote:
>
> Hello, I'm having problems with translating URL patterns. If I set a URL 
> patter to be, for example, 
> url(_(r'^admin/'), admin.site.urls)
>
> where 
> _()
>
> is ugettext_lazy and access a no defined URL, lets say /404/, Instead of 
> getting a 404 error I'm getting a 500 internal error.
> It looks from the log that the ugettext_lazy is not printable? Any ideas? 
> Thanks. 
>
> Here is the log https://dpaste.de/RmWR 
>

-- 
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/d519253c-fc83-4f48-8d06-4e45aa6de413%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to make a subscription form for use with Stripe / dj-stripe?

2017-12-07 Thread Egor Smolyakov
Check out the template folder of the project:

https://github.com/dj-stripe/dj-stripe/tree/master/djstripe/templates/djstripe

On Tuesday, 5 December 2017 01:21:47 UTC+2, Daniel Grace wrote:
>
> I have set up a Stripe account and installed dj-stripe, but I can't find 
> information on how to set up a subscription form.  I understand that 
> dj-stripe looks for a template in the djstripe directory, but I don't know 
> what should be in the template.
>

-- 
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/5700d458-5d6e-4546-b8c7-ca9204d58054%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


uwsgi stats middleware for Django

2017-12-07 Thread Etienne Robillard

Hi,

I would like to access the uWSGI stats API from within Django by 
creating a custom WSGI middleware.


Could it be possible to compute the number of requests currently being 
used by uWSGI workers in Python/Django ?


Ideally, i could then retrieve the active connections in use in a 
standard Django view:


def someview(request):

    # retrieve the number of active requests (connections)

    connections = request.environ['uwsgi.requests']


What do you think?


Etienne


--
Etienne Robillard
tkad...@yandex.com
https://www.isotopesoftware.ca/

--
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/849152fb-01ba-e59f-2022-eb02a4ffceee%40yandex.com.
For more options, visit https://groups.google.com/d/optout.


Django groups and specialpermissions

2017-12-07 Thread mounikesh mintu
Can any one guide me in this is there any way to create django groups where 
there should be a group admin who can control the activity of the group and 
cand add members and themembers can share any kind of photos within the group 
and the other members outside the group cant view/access the photos/media 
Thanks in advance

-- 
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/5ab4d20d-f580-4a97-ad4a-82cd2bc73efd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django groups and specialpermissions

2017-12-07 Thread Jani Tiainen
Hi.

There isn't anything built in to satisfy your needs but you can easily
create such a mechanism with few models and helper funcs or methods.


7.12.2017 18.17 "mounikesh mintu"  kirjoitti:

> Can any one guide me in this is there any way to create django groups
> where there should be a group admin who can control the activity of the
> group and cand add members and themembers can share any kind of photos
> within the group and the other members outside the group cant view/access
> the photos/media Thanks in advance
>
> --
> 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/5ab4d20d-f580-4a97-ad4a-82cd2bc73efd%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/CAHn91oezX4COhtG-QTWxVDm3y0XuNPKbEgEdZ-yPqbEZP0tAGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django groups and specialpermissions

2017-12-07 Thread Egor Smolyakov
Hello!

Check out this library
https://github.com/vintasoftware/django-role-permissions

On 7 December 2017 at 18:52, Jani Tiainen  wrote:

> Hi.
>
> There isn't anything built in to satisfy your needs but you can easily
> create such a mechanism with few models and helper funcs or methods.
>
>
> 7.12.2017 18.17 "mounikesh mintu"  kirjoitti:
>
>> Can any one guide me in this is there any way to create django groups
>> where there should be a group admin who can control the activity of the
>> group and cand add members and themembers can share any kind of photos
>> within the group and the other members outside the group cant view/access
>> the photos/media Thanks in advance
>>
>> --
>> 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/ms
>> gid/django-users/5ab4d20d-f580-4a97-ad4a-82cd2bc73efd%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/CAHn91oezX4COhtG-QTWxVDm3y0XuNPKbEgEdZ-
> yPqbEZP0tAGw%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Kind Regards, Egor Smolyakov.

-- 
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/CACL14xoV0HjV2ZaN_20JXiDB%2BoZTdToDaB4D4uRgiFAOOApjwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: uwsgi stats middleware for Django

2017-12-07 Thread Ádler Oliveira Silva Neves
Sounds like you want retrieving statistics from uWSGI's stats server.

http://uwsgi-docs.readthedocs.io/en/latest/StatsServer.html

In order to get that JSON via HTTP requests, your server ".ini" should
receive extra arguments to start an stats server listening to the
specified port and application must be somehow aware of such port
number, which has a side-effect of increasing coupling.

Sincerely,

Adler

On 07/12/2017 13:13, Etienne Robillard wrote:
> Hi,
>
> I would like to access the uWSGI stats API from within Django by
> creating a custom WSGI middleware.
>
> Could it be possible to compute the number of requests currently being
> used by uWSGI workers in Python/Django ?
>
> Ideally, i could then retrieve the active connections in use in a
> standard Django view:
>
> def someview(request):
>
>     # retrieve the number of active requests (connections)
>
>     connections = request.environ['uwsgi.requests']
>
>
> What do you think?
>
>
> Etienne
>
>

-- 
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/c6d79973-28b8-5236-a64e-4c24ed3c30a7%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Failed to create a new django project

2017-12-07 Thread yuzezhong2012
Hi, 

I encounter an error when I try to create a new django project use the 
command "django-admin startproject mysite". Could you tell me how to fix 
it? Thanks a lot.

Python version: 3.6.3 
Django version: I have tried both 1.8 and 2.0.

By the way, it doesn't have any problems when I use python 2.7.





Traceback (most recent call last):
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\Scripts\django-admin-script.py",
 
line 11, in 
load_entry_point('Django==1.8.18', 'console_scripts', 'django-admin')()
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\core\management\__init__.py",
 
line 354, in execute_from_command_line
utility.execute()
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\core\management\__init__.py",
 
line 328, in execute
django.setup()
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\__init__.py",
 
line 15, in setup
from django.utils.log import configure_logging
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\utils\log.py",
 
line 16, in 
from django.views.debug import ExceptionReporter, 
get_exception_reporter_filter
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\views\debug.py",
 
line 9, in 
from django.core.urlresolvers import Resolver404, resolve
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\core\urlresolvers.py",
 
line 17, in 
from django.http import Http404
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\http\__init__.py",
 
line 4, in 
from django.http.response import (
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\http\response.py",
 
line 13, in 
from django.core.serializers.json import DjangoJSONEncoder
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\core\serializers\__init__.py",
 
line 24, in 
from django.core.serializers.base import SerializerDoesNotExist
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\core\serializers\base.py",
 
line 6, in 
from django.db import models
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\db\models\__init__.py",
 
line 6, in 
from django.db.models.query import Q, QuerySet, Prefetch  # NOQA
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\db\models\query.py",
 
line 16, in 
from django.db.models import sql
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\db\models\sql\__init__.py",
 
line 2, in 
from django.db.models.sql.subqueries import *  # NOQA
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\db\models\sql\subqueries.py",
 
line 7, in 
from django.db.models.query_utils import Q
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\db\models\query_utils.py",
 
line 13, in 
from django.db.backends import utils
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\db\backends\utils.py",
 
line 11, in 
from django.utils.timezone import utc
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\django-1.8.18-py3.6.egg\django\utils\timezone.py",
 
line 17, in 
import pytz
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\pytz\__init__.py",
 
line 32, in 
from pytz.lazy import LazyDict, LazyList, LazySet
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\pytz\lazy.py",
 
line 3, in 
from UserDict import DictMixin
  File 
"C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\UserDict.py", 
line 167
raise TypeError, "pop expected at most 2 arguments, got "\





-- 
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/52527bcd-d08b-4912-98cf-e6062ab8b608%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


help me

2017-12-07 Thread kalla giga
help me with the basic of django

-- 
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/317e5fc8-e5f1-4ef8-8a58-c4569bf9568a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: help me

2017-12-07 Thread Alceu Rodrigues de Freitas Junior
http://catb.org/~esr/faqs/smart-questions.html 




Em 07/12/2017 19:04, kalla giga escreveu:

help me with the basic of django
--
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/317e5fc8-e5f1-4ef8-8a58-c4569bf9568a%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/bfc08b2f-e50f-dcbb-cb59-6ce57305386a%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: help me

2017-12-07 Thread Lachlan Musicman
On 8 December 2017 at 08:04, kalla giga  wrote:

> help me with the basic of django
>
>

If you work through the tutorial, it really gives you a good introduction.

https://docs.djangoproject.com/en/2.0/intro/tutorial01/

Cheers
L.

-- 
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/CAGBeqiOTTzUq5qvsdcTTYK6e0mqf4YoHxxQ8AZyxYNkxdfmAuA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Failed to create a new django project

2017-12-07 Thread Egor Smolyakov
Hello.

Can you post the full log onto pastebin.com or another service?


On 8 December 2017 at 00:21,  wrote:

> Hi,
>
> I encounter an error when I try to create a new django project use the
> command "django-admin startproject mysite". Could you tell me how to fix
> it? Thanks a lot.
>
> Python version: 3.6.3
> Django version: I have tried both 1.8 and 2.0.
>
> By the way, it doesn't have any problems when I use python 2.7.
>
>
>
>
>
> Traceback (most recent call last):
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\
> Scripts\django-admin-script.py", line 11, in 
> load_entry_point('Django==1.8.18', 'console_scripts',
> 'django-admin')()
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\core\management\__init__.py",
> line 354, in execute_from_command_line
> utility.execute()
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\core\management\__init__.py",
> line 328, in execute
> django.setup()
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\__init__.py", line 15, in
> setup
> from django.utils.log import configure_logging
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\utils\log.py", line 16, in
> 
> from django.views.debug import ExceptionReporter,
> get_exception_reporter_filter
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\views\debug.py", line 9, in
> 
> from django.core.urlresolvers import Resolver404, resolve
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\core\urlresolvers.py", line
> 17, in 
> from django.http import Http404
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\http\__init__.py", line 4,
> in 
> from django.http.response import (
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\http\response.py", line 13,
> in 
> from django.core.serializers.json import DjangoJSONEncoder
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\core\serializers\__init__.py",
> line 24, in 
> from django.core.serializers.base import SerializerDoesNotExist
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\core\serializers\base.py",
> line 6, in 
> from django.db import models
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\db\models\__init__.py", line
> 6, in 
> from django.db.models.query import Q, QuerySet, Prefetch  # NOQA
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\db\models\query.py", line
> 16, in 
> from django.db.models import sql
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\db\models\sql\__init__.py",
> line 2, in 
> from django.db.models.sql.subqueries import *  # NOQA
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\db\models\sql\subqueries.py",
> line 7, in 
> from django.db.models.query_utils import Q
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\db\models\query_utils.py",
> line 13, in 
> from django.db.backends import utils
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\db\backends\utils.py", line
> 11, in 
> from django.utils.timezone import utc
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\utils\timezone.py", line 17,
> in 
> import pytz
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\pytz\__init__.py", line 32, in 
> from pytz.lazy import LazyDict, LazyList, LazySet
>   File 
> "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\pytz\lazy.py",
> line 3, in 
> from UserDict import DictMixin
>   File 
> "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\UserDict.py",
> line 167
> raise TypeError, "pop expected at most 2 arguments, got "\
>
>
>
>
>
> --
> 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

Re: Failed to create a new django project

2017-12-07 Thread carlos
yes django 2.0 drop python 2.7.x

On Thu, Dec 7, 2017 at 4:21 PM,  wrote:

> Hi,
>
> I encounter an error when I try to create a new django project use the
> command "django-admin startproject mysite". Could you tell me how to fix
> it? Thanks a lot.
>
> Python version: 3.6.3
> Django version: I have tried both 1.8 and 2.0.
>
> By the way, it doesn't have any problems when I use python 2.7.
>
>
>
>
>
> Traceback (most recent call last):
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\
> Scripts\django-admin-script.py", line 11, in 
> load_entry_point('Django==1.8.18', 'console_scripts',
> 'django-admin')()
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\core\management\__init__.py",
> line 354, in execute_from_command_line
> utility.execute()
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\core\management\__init__.py",
> line 328, in execute
> django.setup()
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\__init__.py", line 15, in
> setup
> from django.utils.log import configure_logging
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\utils\log.py", line 16, in
> 
> from django.views.debug import ExceptionReporter,
> get_exception_reporter_filter
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\views\debug.py", line 9, in
> 
> from django.core.urlresolvers import Resolver404, resolve
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\core\urlresolvers.py", line
> 17, in 
> from django.http import Http404
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\http\__init__.py", line 4,
> in 
> from django.http.response import (
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\http\response.py", line 13,
> in 
> from django.core.serializers.json import DjangoJSONEncoder
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\core\serializers\__init__.py",
> line 24, in 
> from django.core.serializers.base import SerializerDoesNotExist
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\core\serializers\base.py",
> line 6, in 
> from django.db import models
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\db\models\__init__.py", line
> 6, in 
> from django.db.models.query import Q, QuerySet, Prefetch  # NOQA
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\db\models\query.py", line
> 16, in 
> from django.db.models import sql
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\db\models\sql\__init__.py",
> line 2, in 
> from django.db.models.sql.subqueries import *  # NOQA
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\db\models\sql\subqueries.py",
> line 7, in 
> from django.db.models.query_utils import Q
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\db\models\query_utils.py",
> line 13, in 
> from django.db.backends import utils
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\db\backends\utils.py", line
> 11, in 
> from django.utils.timezone import utc
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\django-1.8.18-py3.6.egg\django\utils\timezone.py", line 17,
> in 
> import pytz
>   File "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\
> site-packages\pytz\__init__.py", line 32, in 
> from pytz.lazy import LazyDict, LazyList, LazySet
>   File 
> "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\site-packages\pytz\lazy.py",
> line 3, in 
> from UserDict import DictMixin
>   File 
> "C:\Users\hasee\AppData\Local\Programs\Python\Python36\lib\UserDict.py",
> line 167
> raise TypeError, "pop expected at most 2 arguments, got "\
>
>
>
>
>
> --
> 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 d

Re: Django Channel Error

2017-12-07 Thread Maitreya Verma
Yes it worked. I had not installed channels and not added it to
INSTALLED_CHANNELS as well. Thanks Andrew!



On Thu, Dec 7, 2017 at 1:45 PM, Andrew Godwin  wrote:

> That error means you are not actually running a websocket-capable server.
> Did you add "channels" to INSTALLED_APPS?
>
> Andrew
>
> On Thu, Dec 7, 2017 at 12:03 AM, Maitreya Verma 
> wrote:
>
>> I am following this tutorial
>>  to
>> learn django channels.
>> The following procedure was used :
>>
>>- Add the following code in settings.py
>>redis_host=os.environ.get('REDIS_HOST','localhost')
>>
>>CHANNEL_LAYERS={
>>"default":{
>>"BACKEND":"asgi_redis.RedisChannelLayer",
>>"CONFIG":{
>>"hosts":[(redis_host),6379],
>>},
>>"ROUTING":'channelproj.routing.channel_routing',
>>},
>>}
>>
>>- Create a file routing.py and add the following code
>>from channels import route
>># This function will display all messages received in the console
>>def message_handler(message):
>>print(message['text'])
>>
>>channel_routing = [
>>route("websocket.receive", message_handler),
>>]
>>
>>- run server using python manage.py runserver and then try to connect
>>to server using  ws.connect("ws://localhost:8000/")
>>
>> I am getting the following error
>> websocket._exceptions.WebSocketBadStatusException: Handshake status 200
>>
>> What can be the reason for this error and how can it be rectified?
>>
>>
>> --
>> 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/ms
>> gid/django-users/d560ebbb-242c-4481-b688-42e2d65c112a%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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/JDVTYOvAmXk/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/CAFwN1uqzOi%2BqzANQL%2Bzw%2BZYYQM3YP_xNR631_%3DpDM_
> oYaej5%3DQ%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/CABn9xLk8OqC_-6X1ZvMeSusQnSVdennt7wEaiJzH6iJ3QS0Ozw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: help me

2017-12-07 Thread Jani Tiainen
Hi.

As pointed out do the official tutorial. If you feel that it's too short or
doesn't explain things in depth Django Girls do have excellent tutorial.
https://tutorial.djangogirls.org/en/

8.12.2017 2.35 "kalla giga"  kirjoitti:

> help me with the basic of django
>
> --
> 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/317e5fc8-e5f1-4ef8-8a58-c4569bf9568a%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/CAHn91od4GE61W4u-VGYKksrjj1wFxZwiSxGR2W2h9ogCH%3Du%3D%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.