Re: Bug in 2.0 tutorial?

2018-03-02 Thread Cictani
Well it was my mistake I forgot the '/' in the urls.py of my site where I 
included the polls urls. So no bug :)

Am Samstag, 3. März 2018 08:09:01 UTC+1 schrieb Cictani:
>
> Hi,
>
> I'm doing the tutorial right now and I'am at step 3: 
> https://docs.djangoproject.com/en/2.0/intro/tutorial03/
>
> I think the path is not correct in the tutorial.
>
> In the tutorial:
>
> path('/', views.detail, name='detail'),
>
> If I do it like that I get a 404 I have to use:
>
> path('//', views.detail, name='detail'),
>
> if you agree that this is a bug I will report it.
>
>

-- 
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/89116638-bdae-4d7a-8d48-e8b00632604f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Bug in 2.0 tutorial?

2018-03-02 Thread Cictani
Hi,

I'm doing the tutorial right now and I'am at step 3: 
https://docs.djangoproject.com/en/2.0/intro/tutorial03/

I think the path is not correct in the tutorial.

In the tutorial:

path('/', views.detail, name='detail'),

If I do it like that I get a 404 I have to use:

path('//', views.detail, name='detail'),

if you agree that this is a bug I will report it.

-- 
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/81c64052-3350-4064-83c1-aa0b791ff115%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 2.0.2, Channels 2.0.2 and Celery 4.1 Issue

2018-03-02 Thread G Broten
Two big thumbs up for Ken! 
His keen eyes spotted the problem, which was attempting an asynchronous 
send from the Celery task. I changed the code to use the synchronous send 
and, bingo, the consumer now receives events via the channel layer.

A big thank-you to Ken! And, I'm sure anyone else using Channels 2.0 with 
Celery will find this thread of use.

G Broten

On Friday, March 2, 2018 at 12:57:01 PM UTC-6, Ken Whitesell wrote:
>
> Taking a stab at this - I believe the original problem may be here:
> channel_layer.group_send(
> settings.CHANNEL_GROUP,
> {"type": "epics.message", "text": "Hello World"},
> )
>
> Your updateData method is a synchronous method. However, 
> channel_layer.group_send is an asynchronous method.
>
> What you might try is wrapping the group_send method in the async_to_sync 
> function.
> See the documentation at 
> http://channels.readthedocs.io/en/latest/topics/channel_layers.html#synchronous-functions
>
> async_to_sync(channel_layer.group_send)(
> settings.CHANNEL_GROUP,
> {"type": "epics.message", "text": "Hello World"},
> )
>
>
> Your first solution to make updateData an asynchronous method might work 
> with some other work involved in adding that task to the event loop - but 
> that answer is beyond me at the moment.
>
> Hope this helps,
>  Ken
>
>
> On Friday, March 2, 2018 at 1:36:08 PM UTC-5, G Broten wrote:
>>
>> Hi All:
>>  I'm migrating a small application from Django 1.x/Channels 1.x to Django 
>> 2.0.2 and Channels 2.0. I've run into an issue whose cause I'm trying to 
>> determine. It could be due to a failure on my part to correctly implement 
>> the channel_layer or it could be due to an
>> incompatibility with Celery 4.1. The basics are:
>> - Run a periodic Celery task
>> - Use the channel_layer to perform a group_send
>> - Have the consumer receive the group_send event and push a json  message 
>> over the socket
>>
>> Show below is my simple consumer.py module:
>> class mstatusMessage(AsyncJsonWebsocketConsumer):
>>
>> # WebSocket event handlers
>>
>> async def connect(self):
>> """
>> Called when the websocket is handshaking as part of initial 
>> connection.
>> """
>> logging.info("### Connected ###")
>> # Accept the connection
>> await self.accept()
>>
>> # Add to the group so they get messages
>> await self.channel_layer.group_add(
>> settings.CHANNEL_GROUP,
>> self.channel_name,
>> )
>>
>> async def disconnect(self, code):
>> """
>> Called when the WebSocket closes for any reason.
>> """
>> # Remove them from the group
>> await self.channel_layer.group_discard(
>> settings.CHANNEL_GROUP,
>> self.channel_name,
>> )
>>
>> # Handlers for messages sent over the channel layer
>>
>> # These helper methods are named by the types we send - so epics.join 
>> becomes epics_join
>> async def epics_message(self, event):
>> """
>> Called when the Celery task queries Epics.
>> """
>> logging.error("### Received Msg ###")
>> # Send a message down to the client
>> await self.send_json(
>> {
>> "text": event["message"],
>> },
>> )
>>
>> The routing is simple:
>> application = ProtocolTypeRouter({
>> "websocket":  mstatusMessage
>> })
>>
>> The Celery task is as follows:
>> @shared_task
>> def updateData(param):
>>
>> logger.error('# updateData #')
>>
>> # # Get an instance of the channel layer for
>> # # inter task communications
>> channel_layer = get_channel_layer()
>>
>> channel_layer.group_send(
>> settings.CHANNEL_GROUP,
>> {"type": "epics.message", "text": "Hello World"},
>> )
>>
>> The results are promising as the websocket connect opens successfully and 
>> the Celery task run as show by the debugging output given below:
>> 127.0.0.1:59818 - - [02/Mar/2018:09:32:11] "GET /" 200 100639
>> 127.0.0.1:59844 - - [02/Mar/2018:09:32:12] "WSCONNECTING /epics/" - -
>> 2018-03-02 09:32:12,280 INFO ### Connected ###
>> 127.0.0.1:59844 - - [02/Mar/2018:09:32:12] "WSCONNECT /epics/" - -
>> [2018-03-02 09:32:12,312: ERROR/ForkPoolWorker-2] 
>> mstatus.tasks.updateData[8d329e61-]: # updateData #
>> [2018-03-02 09:32:13,310: ERROR/ForkPoolWorker-2] 
>> mstatus.tasks.updateData[786f51a6-]: # updateData #
>>
>> BUT ... although the Celery task runs the consumer never 
>> receives a message via the channel layer. This could be due to an
>> implementation error or, maybe, a compatibility issue. The application 
>> doesn't crash but the following warning is issued:
>>
>> [2018-03-02 09:32:02,105: WARNING/ForkPoolWorker-2] 
>> /mstatus/mstatus/tasks.py:33: RuntimeWarning: coroutine 
>> 'RedisChannelLayer.group_send' was never awaited
>>   {"type": 

Django 1,11 upgrade, render template with context in template.Node

2018-03-02 Thread Christian Ledermann
In Django 1,8 it  worked but in Django 1.11 it throws:

TypeError: context must be a dict rather than RequestContext.

The code is:

class EpilogueNode(template.Node):

def __init__(self):  # noqa: D102
self.epilogue_template =
template.loader.get_template('themes/presenter_epilogue.html')

def render(self, context):  # noqa: D102
rendered = self.epilogue_template.render(context)

In https://docs.djangoproject.com/en/1.11/ref/templates/upgrading/ it
is documeted that I need to pass a dict as context, but the context
passed to Node,render is a
RequestContext.

How can I upgrade this to 1.11?



-- 
Best Regards,

Christian Ledermann

Newark-on-Trent - UK
Mobile : +44 7474997517

https://uk.linkedin.com/in/christianledermann
https://github.com/cleder/


<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don’t drive species to extinction

2) Don’t destroy a habitat that species rely on.

3) Don’t change the climate in ways that will result in the above.

}<(((*>

-- 
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/CABCjzWp-Z4SNhjj7kSDDoanvMtcsVfiDyuvAU%3Dc-fRx%2BYALm%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 2.0.2, Channels 2.0.2 and Celery 4.1 Issue

2018-03-02 Thread Ken Whitesell
Taking a stab at this - I believe the original problem may be here:
channel_layer.group_send(
settings.CHANNEL_GROUP,
{"type": "epics.message", "text": "Hello World"},
)

Your updateData method is a synchronous method. However, 
channel_layer.group_send is an asynchronous method.

What you might try is wrapping the group_send method in the async_to_sync 
function.
See the documentation at 
http://channels.readthedocs.io/en/latest/topics/channel_layers.html#synchronous-functions

async_to_sync(channel_layer.group_send)(
settings.CHANNEL_GROUP,
{"type": "epics.message", "text": "Hello World"},
)


Your first solution to make updateData an asynchronous method might work 
with some other work involved in adding that task to the event loop - but 
that answer is beyond me at the moment.

Hope this helps,
 Ken


On Friday, March 2, 2018 at 1:36:08 PM UTC-5, G Broten wrote:
>
> Hi All:
>  I'm migrating a small application from Django 1.x/Channels 1.x to Django 
> 2.0.2 and Channels 2.0. I've run into an issue whose cause I'm trying to 
> determine. It could be due to a failure on my part to correctly implement 
> the channel_layer or it could be due to an
> incompatibility with Celery 4.1. The basics are:
> - Run a periodic Celery task
> - Use the channel_layer to perform a group_send
> - Have the consumer receive the group_send event and push a json  message 
> over the socket
>
> Show below is my simple consumer.py module:
> class mstatusMessage(AsyncJsonWebsocketConsumer):
>
> # WebSocket event handlers
>
> async def connect(self):
> """
> Called when the websocket is handshaking as part of initial 
> connection.
> """
> logging.info("### Connected ###")
> # Accept the connection
> await self.accept()
>
> # Add to the group so they get messages
> await self.channel_layer.group_add(
> settings.CHANNEL_GROUP,
> self.channel_name,
> )
>
> async def disconnect(self, code):
> """
> Called when the WebSocket closes for any reason.
> """
> # Remove them from the group
> await self.channel_layer.group_discard(
> settings.CHANNEL_GROUP,
> self.channel_name,
> )
>
> # Handlers for messages sent over the channel layer
>
> # These helper methods are named by the types we send - so epics.join 
> becomes epics_join
> async def epics_message(self, event):
> """
> Called when the Celery task queries Epics.
> """
> logging.error("### Received Msg ###")
> # Send a message down to the client
> await self.send_json(
> {
> "text": event["message"],
> },
> )
>
> The routing is simple:
> application = ProtocolTypeRouter({
> "websocket":  mstatusMessage
> })
>
> The Celery task is as follows:
> @shared_task
> def updateData(param):
>
> logger.error('# updateData #')
>
> # # Get an instance of the channel layer for
> # # inter task communications
> channel_layer = get_channel_layer()
>
> channel_layer.group_send(
> settings.CHANNEL_GROUP,
> {"type": "epics.message", "text": "Hello World"},
> )
>
> The results are promising as the websocket connect opens successfully and 
> the Celery task run as show by the debugging output given below:
> 127.0.0.1:59818 - - [02/Mar/2018:09:32:11] "GET /" 200 100639
> 127.0.0.1:59844 - - [02/Mar/2018:09:32:12] "WSCONNECTING /epics/" - -
> 2018-03-02 09:32:12,280 INFO ### Connected ###
> 127.0.0.1:59844 - - [02/Mar/2018:09:32:12] "WSCONNECT /epics/" - -
> [2018-03-02 09:32:12,312: ERROR/ForkPoolWorker-2] 
> mstatus.tasks.updateData[8d329e61-]: # updateData #
> [2018-03-02 09:32:13,310: ERROR/ForkPoolWorker-2] 
> mstatus.tasks.updateData[786f51a6-]: # updateData #
>
> BUT ... although the Celery task runs the consumer never 
> receives a message via the channel layer. This could be due to an
> implementation error or, maybe, a compatibility issue. The application 
> doesn't crash but the following warning is issued:
>
> [2018-03-02 09:32:02,105: WARNING/ForkPoolWorker-2] 
> /mstatus/mstatus/tasks.py:33: RuntimeWarning: coroutine 
> 'RedisChannelLayer.group_send' was never awaited
>   {"type": "epics.message", "text": "Hello World"},
>
> This warning appears related to the Python asyncio functionality. Under 
> the Celery task module, the channel_layer.group_send
> doesn't use the await directive as it's inclusion hangs the Celery task. 
> Changing the Celery task to:
> async def updateData(param):
>
> logger.error('# updateData #')
>
> # # Get an instance of the channel layer for
> # # inter task communications
> channel_layer = get_channel_layer()
>
> await channel_layer.group_send(
> settings.CHANNEL_GROUP,
> {"type": "epics.message", 

Django 2.0.2, Channels 2.0.2 and Celery 4.1 Issue

2018-03-02 Thread G Broten
Hi All:
 I'm migrating a small application from Django 1.x/Channels 1.x to Django 
2.0.2 and Channels 2.0. I've run into an issue whose cause I'm trying to 
determine. It could be due to a failure on my part to correctly implement 
the channel_layer or it could be due to an
incompatibility with Celery 4.1. The basics are:
- Run a periodic Celery task
- Use the channel_layer to perform a group_send
- Have the consumer receive the group_send event and push a json  message 
over the socket

Show below is my simple consumer.py module:
class mstatusMessage(AsyncJsonWebsocketConsumer):

# WebSocket event handlers

async def connect(self):
"""
Called when the websocket is handshaking as part of initial 
connection.
"""
logging.info("### Connected ###")
# Accept the connection
await self.accept()

# Add to the group so they get messages
await self.channel_layer.group_add(
settings.CHANNEL_GROUP,
self.channel_name,
)

async def disconnect(self, code):
"""
Called when the WebSocket closes for any reason.
"""
# Remove them from the group
await self.channel_layer.group_discard(
settings.CHANNEL_GROUP,
self.channel_name,
)

# Handlers for messages sent over the channel layer

# These helper methods are named by the types we send - so epics.join 
becomes epics_join
async def epics_message(self, event):
"""
Called when the Celery task queries Epics.
"""
logging.error("### Received Msg ###")
# Send a message down to the client
await self.send_json(
{
"text": event["message"],
},
)

The routing is simple:
application = ProtocolTypeRouter({
"websocket":  mstatusMessage
})

The Celery task is as follows:
@shared_task
def updateData(param):

logger.error('# updateData #')

# # Get an instance of the channel layer for
# # inter task communications
channel_layer = get_channel_layer()

channel_layer.group_send(
settings.CHANNEL_GROUP,
{"type": "epics.message", "text": "Hello World"},
)

The results are promising as the websocket connect opens successfully and 
the Celery task run as show by the debugging output given below:
127.0.0.1:59818 - - [02/Mar/2018:09:32:11] "GET /" 200 100639
127.0.0.1:59844 - - [02/Mar/2018:09:32:12] "WSCONNECTING /epics/" - -
2018-03-02 09:32:12,280 INFO ### Connected ###
127.0.0.1:59844 - - [02/Mar/2018:09:32:12] "WSCONNECT /epics/" - -
[2018-03-02 09:32:12,312: ERROR/ForkPoolWorker-2] 
mstatus.tasks.updateData[8d329e61-]: # updateData #
[2018-03-02 09:32:13,310: ERROR/ForkPoolWorker-2] 
mstatus.tasks.updateData[786f51a6-]: # updateData #

BUT ... although the Celery task runs the consumer never 
receives a message via the channel layer. This could be due to an
implementation error or, maybe, a compatibility issue. The application 
doesn't crash but the following warning is issued:

[2018-03-02 09:32:02,105: WARNING/ForkPoolWorker-2] 
/mstatus/mstatus/tasks.py:33: RuntimeWarning: coroutine 
'RedisChannelLayer.group_send' was never awaited
  {"type": "epics.message", "text": "Hello World"},

This warning appears related to the Python asyncio functionality. Under the 
Celery task module, the channel_layer.group_send
doesn't use the await directive as it's inclusion hangs the Celery task. 
Changing the Celery task to:
async def updateData(param):

logger.error('# updateData #')

# # Get an instance of the channel layer for
# # inter task communications
channel_layer = get_channel_layer()

await channel_layer.group_send(
settings.CHANNEL_GROUP,
{"type": "epics.message", "text": "Hello World"},
)

This results in the following runtime warning and the Celery task fails to 
run (the debug message is never printed) :

[2018-03-02 09:45:19,804: WARNING/ForkPoolWorker-2] 
/home/broteng/.pyenv/versions/3.6.3/envs/djchannels2/lib/python3.6/site-packages/billiard/pool.py:358:
 
RuntimeWarning: coroutine 'updateData' was never awaited
  result = (True, prepare_result(fun(*args, **kwargs)))

I'm sure these warnings are understood by someone who can provide guidance 
with respect to a solution.

Thanks,

G Broten

Reference:

The application has be tried under two OS versions:
CentOS 7.4
Alpine Linux 3.7

A partial pip list of the significant packages:
asgi-redis (1.4.3)
asgiref (2.1.6)
async-timeout (2.0.0)
billiard (3.5.0.3)
cached-property (1.4.0)
celery (4.1.0)
channels (2.0.2)
channels-redis (2.1.0)
daphne (2.0.4)
Django (2.0.2)
redis (2.10.6)





-- 
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 

Re: Django sending syntax errors on ES syntax of imported JS file

2018-03-02 Thread Jani Tiainen
Well that was my intention to mean that this particular feature (import
statement) seems to lack support for somewhat popular browsers.

Also I think caniuse lags a bit since if I'm not mistaken latest FF
supports import.

And in any case JS errors are not Django related.

2.3.2018 13.30 "Jason"  kirjoitti:

> Jani Tiainen, Your assertion that ES is not very well supported is
> incorrect.  Most of ES6 is in fact highly supported across browsers except
> for certain specifications that are still being worked on regarding
> implementation details.  For reference, look at http://kangax.github.io/
> compat-table/es6/. It all depends on your target audience, but using
> babel to transpile by default is a good practice.
>
> As to the original issue, the problem is OP is using a non-compatible
> browser for imports, as you can see at https://caniuse.com/#feat=
> es6-module  Firefox and IE are the big names that have  no native support
> and will require a transpiled version to work.
>
> TL;dr front end can be a mess, OP got caught in it and there are ways
> around it.
>
> --
> 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/fbc86dde-6230-4bab-a2d3-65c669584dbe%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/CAHn91ocBr8x1nQnW19fbJt79Z-BQFS2s-QmvtzhdmBk1f-CJhQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin site not working properly using passenger on shared hosting. Need help setting it up properly

2018-03-02 Thread team . readerspoint


On Friday, March 2, 2018 at 9:27:29 PM UTC+6, Vinicius Assef wrote:
>
> My bad. It's urls.py 
>
> On 2 March 2018 at 12:25, Vinicius Assef  
> wrote: 
> > Probably you have a problem with route. 
> > 
> > Check your routes.py again. 
> > 
> > On 2 March 2018 at 10:28,   wrote: 
> >> 
> >> 
> >> On Friday, March 2, 2018 at 6:24:49 PM UTC+6, Vinicius Assef wrote: 
> >>> 
> >>> Some time ago I wrote this post [0]  about setting Python and Django 
> >>> on Dreamhost. They use passenger. 
> >>> 
> >>> Maybe it's useful to you. 
> >>> 
> >>> 
> >>> [0] 
> >>> 
> http://aprenda-python.blogspot.com.br/2016/06/setup-python-with-django-or-pyramid-on-dreamhost.html
>  
> >>> 
> >> 
> >>> 
> >>> 
> >>> 
> >>> On 2 March 2018 at 04:56, Tanvir Ahmed  wrote: 
> >>> > Hello, 
> >>> > 
> >>> > I am fairly new to the web hosting world. I recently purchased a 
> plan at 
> >>> > a2hosting. It's a shared hosting plan. After some problems with 
> FastCGI, 
> >>> > I 
> >>> > was told to use passenger to host django. I couldn't find much on 
> this 
> >>> > topic 
> >>> > and somehow managed to get the website working. However, soon I 
> realized 
> >>> > that the post forms weren't working. More importantly, the admin 
> site 
> >>> > wasn't 
> >>> > working properly. I get to the admin site login but once I try to 
> login, 
> >>> > I 
> >>> > get a page not found error. 
> >>> > 
> >>> > I have contacted the hosting provider and they seem to think that my 
> >>> > configuration with passenger is wrong. They were kind enough to 
> offer to 
> >>> > change any server side settings if needed. So any idea what I am 
> doing 
> >>> > wrong? Could you guys provide me the steps to get django working 
> with 
> >>> > passenger? Or is it some server side settings fault? 
> >>> > 
> >>> > Please note that I decided to get rid of everything and start fresh. 
> I 
> >>> > created a project by, first creating a virtualenv using CPanel's 
> setup 
> >>> > python app. This also creates a passenger_wsgi.py and a .htaccess 
> file. 
> >>> > I 
> >>> > edited the passenger_wsgi.py to the following code: 
> >>> > from projectname.wsgi import application 
> >>> > 
> >>> > After that I configured the settings where I made changes to the 
> allowed 
> >>> > hosts and provided the static and media files and directories. Then 
> I 
> >>> > ran 
> >>> > collectstatics and made migrations and created superuser. Then, 
> (keep in 
> >>> > mind I am using the project I just created and haven't changed 
> anything 
> >>> > or 
> >>> > added any apps) I went to, www.example.com/admin and the login 
> appeared. 
> >>> > But, once I do try to login, I get a page not found error. 
> >>> > 
> >>> > The directory looks something like this: 
> >>> > 
> >>> > root(/home/username) 
> >>> > -virtualenv 
> >>> > -website 
> >>> > -passenger_wsgi.py 
> >>> > -manage.py 
> >>> > -public 
> >>> > -tmp 
> >>> > -project 
> >>> > -__init__.py 
> >>> > -settings.py 
> >>> > -wsgi.py 
> >>> > -urls.py 
> >>> > 
> >>> > Please note: there are other files but I included the ones I thought 
> >>> > were 
> >>> > necessary. 
> >>> > 
> >>> > Thank you in advance and sorry for any inconveniences 
> >>> > 
> >>> > -- 
> >>> > 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/CAOe4Nxf_ux%2B9xN1f1Vn0qNN4%2Bi%3DU%2BBsfNy2oAEmgyUV39Pc-Kw%40mail.gmail.com.
>  
>
> >>> > For more options, visit https://groups.google.com/d/optout. 
> >> 
> >> 
> >> Hello, 
> >> 
> >> Just followed the tutorial you have provided. The website is up and I 
> do get 
> >> the welcome page. I also do get the admin login site. However, as I try 
> to 
> >> login in with one of the superuser I have created, I get a page not 
> found 
> >> error. 
> >> 
> >> Page not found (404) 
> >> 
> >> 
> >> Request Method: POST 
> >> 
> >> Request URL: https://www.website.com/admin/login/?next=/admin/ 
> >> 
> >> Raised by: django.contrib.admin.sites.login 
> >> 
> >> 
> >> Using the URLconf defined in readerspoint.urls, Django tried these URL 
> >> patterns, in this order: 
> >> 
> >> 
> >> 1) admin/ 
> >> 
> >> 
> >> The empty path didn't match any of these. 
> >> 
> >> You're seeing this error because you have DEBUG = True in your Django 
> >> settings file. Change that to False, and Django will display a standard 
> 404 
> >> page. 
> >> 
> >> 
> >> This is what the error looks 

Re: Admin site not working properly using passenger on shared hosting. Need help setting it up properly

2018-03-02 Thread Vinicius Assef
My bad. It's urls.py

On 2 March 2018 at 12:25, Vinicius Assef  wrote:
> Probably you have a problem with route.
>
> Check your routes.py again.
>
> On 2 March 2018 at 10:28,   wrote:
>>
>>
>> On Friday, March 2, 2018 at 6:24:49 PM UTC+6, Vinicius Assef wrote:
>>>
>>> Some time ago I wrote this post [0]  about setting Python and Django
>>> on Dreamhost. They use passenger.
>>>
>>> Maybe it's useful to you.
>>>
>>>
>>> [0]
>>> http://aprenda-python.blogspot.com.br/2016/06/setup-python-with-django-or-pyramid-on-dreamhost.html
>>>
>>
>>>
>>>
>>>
>>> On 2 March 2018 at 04:56, Tanvir Ahmed  wrote:
>>> > Hello,
>>> >
>>> > I am fairly new to the web hosting world. I recently purchased a plan at
>>> > a2hosting. It's a shared hosting plan. After some problems with FastCGI,
>>> > I
>>> > was told to use passenger to host django. I couldn't find much on this
>>> > topic
>>> > and somehow managed to get the website working. However, soon I realized
>>> > that the post forms weren't working. More importantly, the admin site
>>> > wasn't
>>> > working properly. I get to the admin site login but once I try to login,
>>> > I
>>> > get a page not found error.
>>> >
>>> > I have contacted the hosting provider and they seem to think that my
>>> > configuration with passenger is wrong. They were kind enough to offer to
>>> > change any server side settings if needed. So any idea what I am doing
>>> > wrong? Could you guys provide me the steps to get django working with
>>> > passenger? Or is it some server side settings fault?
>>> >
>>> > Please note that I decided to get rid of everything and start fresh. I
>>> > created a project by, first creating a virtualenv using CPanel's setup
>>> > python app. This also creates a passenger_wsgi.py and a .htaccess file.
>>> > I
>>> > edited the passenger_wsgi.py to the following code:
>>> > from projectname.wsgi import application
>>> >
>>> > After that I configured the settings where I made changes to the allowed
>>> > hosts and provided the static and media files and directories. Then I
>>> > ran
>>> > collectstatics and made migrations and created superuser. Then, (keep in
>>> > mind I am using the project I just created and haven't changed anything
>>> > or
>>> > added any apps) I went to, www.example.com/admin and the login appeared.
>>> > But, once I do try to login, I get a page not found error.
>>> >
>>> > The directory looks something like this:
>>> >
>>> > root(/home/username)
>>> > -virtualenv
>>> > -website
>>> > -passenger_wsgi.py
>>> > -manage.py
>>> > -public
>>> > -tmp
>>> > -project
>>> > -__init__.py
>>> > -settings.py
>>> > -wsgi.py
>>> > -urls.py
>>> >
>>> > Please note: there are other files but I included the ones I thought
>>> > were
>>> > necessary.
>>> >
>>> > Thank you in advance and sorry for any inconveniences
>>> >
>>> > --
>>> > 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/CAOe4Nxf_ux%2B9xN1f1Vn0qNN4%2Bi%3DU%2BBsfNy2oAEmgyUV39Pc-Kw%40mail.gmail.com.
>>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>> Hello,
>>
>> Just followed the tutorial you have provided. The website is up and I do get
>> the welcome page. I also do get the admin login site. However, as I try to
>> login in with one of the superuser I have created, I get a page not found
>> error.
>>
>> Page not found (404)
>>
>>
>> Request Method: POST
>>
>> Request URL: https://www.website.com/admin/login/?next=/admin/
>>
>> Raised by: django.contrib.admin.sites.login
>>
>>
>> Using the URLconf defined in readerspoint.urls, Django tried these URL
>> patterns, in this order:
>>
>>
>> 1) admin/
>>
>>
>> The empty path didn't match any of these.
>>
>> You're seeing this error because you have DEBUG = True in your Django
>> settings file. Change that to False, and Django will display a standard 404
>> page.
>>
>>
>> This is what the error looks like.
>>>
>>>
>>
>> --
>> 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
>> 

Re: Admin site not working properly using passenger on shared hosting. Need help setting it up properly

2018-03-02 Thread Vinicius Assef
Probably you have a problem with route.

Check your routes.py again.

On 2 March 2018 at 10:28,   wrote:
>
>
> On Friday, March 2, 2018 at 6:24:49 PM UTC+6, Vinicius Assef wrote:
>>
>> Some time ago I wrote this post [0]  about setting Python and Django
>> on Dreamhost. They use passenger.
>>
>> Maybe it's useful to you.
>>
>>
>> [0]
>> http://aprenda-python.blogspot.com.br/2016/06/setup-python-with-django-or-pyramid-on-dreamhost.html
>>
>
>>
>>
>>
>> On 2 March 2018 at 04:56, Tanvir Ahmed  wrote:
>> > Hello,
>> >
>> > I am fairly new to the web hosting world. I recently purchased a plan at
>> > a2hosting. It's a shared hosting plan. After some problems with FastCGI,
>> > I
>> > was told to use passenger to host django. I couldn't find much on this
>> > topic
>> > and somehow managed to get the website working. However, soon I realized
>> > that the post forms weren't working. More importantly, the admin site
>> > wasn't
>> > working properly. I get to the admin site login but once I try to login,
>> > I
>> > get a page not found error.
>> >
>> > I have contacted the hosting provider and they seem to think that my
>> > configuration with passenger is wrong. They were kind enough to offer to
>> > change any server side settings if needed. So any idea what I am doing
>> > wrong? Could you guys provide me the steps to get django working with
>> > passenger? Or is it some server side settings fault?
>> >
>> > Please note that I decided to get rid of everything and start fresh. I
>> > created a project by, first creating a virtualenv using CPanel's setup
>> > python app. This also creates a passenger_wsgi.py and a .htaccess file.
>> > I
>> > edited the passenger_wsgi.py to the following code:
>> > from projectname.wsgi import application
>> >
>> > After that I configured the settings where I made changes to the allowed
>> > hosts and provided the static and media files and directories. Then I
>> > ran
>> > collectstatics and made migrations and created superuser. Then, (keep in
>> > mind I am using the project I just created and haven't changed anything
>> > or
>> > added any apps) I went to, www.example.com/admin and the login appeared.
>> > But, once I do try to login, I get a page not found error.
>> >
>> > The directory looks something like this:
>> >
>> > root(/home/username)
>> > -virtualenv
>> > -website
>> > -passenger_wsgi.py
>> > -manage.py
>> > -public
>> > -tmp
>> > -project
>> > -__init__.py
>> > -settings.py
>> > -wsgi.py
>> > -urls.py
>> >
>> > Please note: there are other files but I included the ones I thought
>> > were
>> > necessary.
>> >
>> > Thank you in advance and sorry for any inconveniences
>> >
>> > --
>> > 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/CAOe4Nxf_ux%2B9xN1f1Vn0qNN4%2Bi%3DU%2BBsfNy2oAEmgyUV39Pc-Kw%40mail.gmail.com.
>> > For more options, visit https://groups.google.com/d/optout.
>
>
> Hello,
>
> Just followed the tutorial you have provided. The website is up and I do get
> the welcome page. I also do get the admin login site. However, as I try to
> login in with one of the superuser I have created, I get a page not found
> error.
>
> Page not found (404)
>
>
> Request Method: POST
>
> Request URL: https://www.website.com/admin/login/?next=/admin/
>
> Raised by: django.contrib.admin.sites.login
>
>
> Using the URLconf defined in readerspoint.urls, Django tried these URL
> patterns, in this order:
>
>
> 1) admin/
>
>
> The empty path didn't match any of these.
>
> You're seeing this error because you have DEBUG = True in your Django
> settings file. Change that to False, and Django will display a standard 404
> page.
>
>
> This is what the error looks like.
>>
>>
>
> --
> 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/0b59e202-8ce2-4d42-9d99-e217864b791d%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 

Re: Admin site not working properly using passenger on shared hosting. Need help setting it up properly

2018-03-02 Thread team . readerspoint


On Friday, March 2, 2018 at 6:24:49 PM UTC+6, Vinicius Assef wrote:
>
> Some time ago I wrote this post [0]  about setting Python and Django 
> on Dreamhost. They use passenger. 
>
> Maybe it's useful to you. 
>
>
> [0] 
> http://aprenda-python.blogspot.com.br/2016/06/setup-python-with-django-or-pyramid-on-dreamhost.html
>  
>
>  

>
>
> On 2 March 2018 at 04:56, Tanvir Ahmed  > wrote: 
> > Hello, 
> > 
> > I am fairly new to the web hosting world. I recently purchased a plan at 
> > a2hosting. It's a shared hosting plan. After some problems with FastCGI, 
> I 
> > was told to use passenger to host django. I couldn't find much on this 
> topic 
> > and somehow managed to get the website working. However, soon I realized 
> > that the post forms weren't working. More importantly, the admin site 
> wasn't 
> > working properly. I get to the admin site login but once I try to login, 
> I 
> > get a page not found error. 
> > 
> > I have contacted the hosting provider and they seem to think that my 
> > configuration with passenger is wrong. They were kind enough to offer to 
> > change any server side settings if needed. So any idea what I am doing 
> > wrong? Could you guys provide me the steps to get django working with 
> > passenger? Or is it some server side settings fault? 
> > 
> > Please note that I decided to get rid of everything and start fresh. I 
> > created a project by, first creating a virtualenv using CPanel's setup 
> > python app. This also creates a passenger_wsgi.py and a .htaccess file. 
> I 
> > edited the passenger_wsgi.py to the following code: 
> > from projectname.wsgi import application 
> > 
> > After that I configured the settings where I made changes to the allowed 
> > hosts and provided the static and media files and directories. Then I 
> ran 
> > collectstatics and made migrations and created superuser. Then, (keep in 
> > mind I am using the project I just created and haven't changed anything 
> or 
> > added any apps) I went to, www.example.com/admin and the login 
> appeared. 
> > But, once I do try to login, I get a page not found error. 
> > 
> > The directory looks something like this: 
> > 
> > root(/home/username) 
> > -virtualenv 
> > -website 
> > -passenger_wsgi.py 
> > -manage.py 
> > -public 
> > -tmp 
> > -project 
> > -__init__.py 
> > -settings.py 
> > -wsgi.py 
> > -urls.py 
> > 
> > Please note: there are other files but I included the ones I thought 
> were 
> > necessary. 
> > 
> > Thank you in advance and sorry for any inconveniences 
> > 
> > -- 
> > 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/CAOe4Nxf_ux%2B9xN1f1Vn0qNN4%2Bi%3DU%2BBsfNy2oAEmgyUV39Pc-Kw%40mail.gmail.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 


Hello, 

Just followed the tutorial you have provided. The website is up and I do 
get the welcome page. I also do get the admin login site. However, as I try 
to login in with one of the superuser I have created, I get a page not 
found error. 

*Page not found (404)*


*Request Method: POST*

*Request URL: https://www.website.com/admin/login/?next=/admin/ 
*

*Raised by: django.contrib.admin.sites.login*


*Using the URLconf defined in readerspoint.urls, Django tried these URL 
patterns, in this order:*


*1) admin/*


*The empty path didn't match any of these.*

*You're seeing this error because you have DEBUG = True in your Django 
settings file. Change that to False, and Django will display a standard 404 
page.*


This is what the error looks like.

>  

-- 
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/0b59e202-8ce2-4d42-9d99-e217864b791d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin site not working properly using passenger on shared hosting. Need help setting it up properly

2018-03-02 Thread emepe
On Friday, March 2, 2018 at 9:19:10 AM UTC-3, Tanvir Ahmed wrote:
>
> I am fairly new to the web hosting world. I recently purchased a plan at 
> a2hosting. It's a shared hosting plan. After some problems with FastCGI, I 
> was told to use passenger to host django. I couldn't find much on this 
> topic and somehow managed to get the website working. However, soon I 
> realized that the post forms weren't working. More importantly, the admin 
> site wasn't working properly. I get to the admin site login but once I try 
> to login, I get a page not found error. 
>

For simple websites I might recommend using Webfaction. It is really easy 
and fast to have a site with Django and has a lot of support for Django 
sites.

- Ezequiel
https://flickrock.com/mikelpierre

-- 
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/44cf118f-912b-4804-b57b-3e3bae76d936%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin site not working properly using passenger on shared hosting. Need help setting it up properly

2018-03-02 Thread emepe

On Friday, March 2, 2018 at 9:19:10 AM UTC-3, Tanvir Ahmed wrote:
>
> I am fairly new to the web hosting world. I recently purchased a plan at 
> a2hosting. It's a shared hosting plan. After some problems with FastCGI, I 
> was told to use passenger to host django. I couldn't find much on this 
> topic and somehow managed to get the website working. However, soon I 
> realized that the post forms weren't working. More importantly, the admin 
> site wasn't working properly. I get to the admin site login but once I try 
> to login, I get a page not found error. 
>

Para websites sencillos podría recomendar usar Webfaction.  Es realmente 
fácil y rápido tener un sitio con Django y tiene mucho soporte para sitios 
Django.

- Ezequiel
http://flickrock.com/mikelpierre 

-- 
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/4cbd86d3-6795-4eea-b969-1accdc1c2b37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin site not working properly using passenger on shared hosting. Need help setting it up properly

2018-03-02 Thread Vinicius Assef
Some time ago I wrote this post [0]  about setting Python and Django
on Dreamhost. They use passenger.

Maybe it's useful to you.


[0] 
http://aprenda-python.blogspot.com.br/2016/06/setup-python-with-django-or-pyramid-on-dreamhost.html



On 2 March 2018 at 04:56, Tanvir Ahmed  wrote:
> Hello,
>
> I am fairly new to the web hosting world. I recently purchased a plan at
> a2hosting. It's a shared hosting plan. After some problems with FastCGI, I
> was told to use passenger to host django. I couldn't find much on this topic
> and somehow managed to get the website working. However, soon I realized
> that the post forms weren't working. More importantly, the admin site wasn't
> working properly. I get to the admin site login but once I try to login, I
> get a page not found error.
>
> I have contacted the hosting provider and they seem to think that my
> configuration with passenger is wrong. They were kind enough to offer to
> change any server side settings if needed. So any idea what I am doing
> wrong? Could you guys provide me the steps to get django working with
> passenger? Or is it some server side settings fault?
>
> Please note that I decided to get rid of everything and start fresh. I
> created a project by, first creating a virtualenv using CPanel's setup
> python app. This also creates a passenger_wsgi.py and a .htaccess file. I
> edited the passenger_wsgi.py to the following code:
> from projectname.wsgi import application
>
> After that I configured the settings where I made changes to the allowed
> hosts and provided the static and media files and directories. Then I ran
> collectstatics and made migrations and created superuser. Then, (keep in
> mind I am using the project I just created and haven't changed anything or
> added any apps) I went to, www.example.com/admin and the login appeared.
> But, once I do try to login, I get a page not found error.
>
> The directory looks something like this:
>
> root(/home/username)
> -virtualenv
> -website
> -passenger_wsgi.py
> -manage.py
> -public
> -tmp
> -project
> -__init__.py
> -settings.py
> -wsgi.py
> -urls.py
>
> Please note: there are other files but I included the ones I thought were
> necessary.
>
> Thank you in advance and sorry for any inconveniences
>
> --
> 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/CAOe4Nxf_ux%2B9xN1f1Vn0qNN4%2Bi%3DU%2BBsfNy2oAEmgyUV39Pc-Kw%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/CAFmXjSADGMPzkwvPA-aDtV7y6%2B3VtrG6wFPK2Oh2RjHu7BTpDg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Admin site not working properly using passenger on shared hosting. Need help setting it up properly

2018-03-02 Thread Tanvir Ahmed
Hello,

I am fairly new to the web hosting world. I recently purchased a plan at
a2hosting. It's a shared hosting plan. After some problems with FastCGI, I
was told to use passenger to host django. I couldn't find much on this
topic and somehow managed to get the website working. However, soon I
realized that the post forms weren't working. More importantly, the admin
site wasn't working properly. I get to the admin site login but once I try
to login, I get a page not found error.

I have contacted the hosting provider and they seem to think that my
configuration with passenger is wrong. They were kind enough to offer to
change any server side settings if needed. So any idea what I am doing
wrong? Could you guys provide me the steps to get django working with
passenger? Or is it some server side settings fault?

Please note that I decided to get rid of everything and start fresh. I
created a project by, first creating a virtualenv using CPanel's setup
python app. This also creates a passenger_wsgi.py and a .htaccess file. I
edited the passenger_wsgi.py to the following code:
from projectname.wsgi import application

After that I configured the settings where I made changes to the allowed
hosts and provided the static and media files and directories. Then I ran
collectstatics and made migrations and created superuser. Then, (keep in
mind I am using the project I just created and haven't changed anything or
added any apps) I went to, www.example.com/admin and the login appeared.
But, once I do try to login, I get a page not found error.

The directory looks something like this:

root(/home/username)
-virtualenv
-website
-passenger_wsgi.py
-manage.py
-public
-tmp
-project
-__init__.py
-settings.py
-wsgi.py
-urls.py

Please note: there are other files but I included the ones I thought were
necessary.

Thank you in advance and sorry for any inconveniences

-- 
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/CAOe4Nxf_ux%2B9xN1f1Vn0qNN4%2Bi%3DU%2BBsfNy2oAEmgyUV39Pc-Kw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels: channel_layer appears to time out

2018-03-02 Thread operator
Andrew,

Thanks for taking the time to reply. 

In classic fashion, the issue has gone away and I'm not entirely sure why. 
I suspect there might have been a page with older code buried somewhere, 
trying to do websocket things wrongly, and that was throwing things off. 
I'm sure it will rear it's head again, and if it does I will try and get a 
reproducible test case.

Toby

On Thursday, March 1, 2018 at 9:48:59 PM UTC, Andrew Godwin wrote:
>
> Hi Toby,
>
> Do you have the latest versions of daphne, channels, asgiref and 
> channels_redis? This sounds supiciously like a bug I fixed a couple weeks 
> ago.
>
> Andrew
>
> On Thu, Mar 1, 2018 at 5:45 AM,  wrote:
>
>> Hello,
>>
>> I have a project that uses Channels as a worker queue, with a 
>> SyncConsumer that runs a heavy computation task. This works great.
>>
>> I transitioned the project to have a 'task in process' page that opens a 
>> websocket and through the magic of channel's groups it gets pushed the 
>> computation updates as they happen. This works great.
>>
>> I'm now transitioning the project to be a single-page-app that 
>> communicates via a websocket. Using `runserver`, this works great, the 
>> websocket stays open. However, the messages from the SyncConsumer stop 
>> after a few seconds. I've established that time is whatever the value of 
>> `websocket_handshake_timeout` is, but this doesn't make sense to me AFAIK 
>> as the channel_layer is independent from the JsonWebsocketConsumer 
>> instance, and the websocket is happily connected and still passing messages.
>>
>> Any ideas? Is this a bug or am I doing something wrong? 
>>
>> Thanks,
>>
>> Toby
>>
>> -- 
>> 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/a329b26e-89f5-42d1-86b2-28ad1c85bb90%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/64436f7a-18d7-452b-a9cf-3580d7636b73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django sending syntax errors on ES syntax of imported JS file

2018-03-02 Thread Jason
Jani Tiainen, Your assertion that ES is not very well supported is 
incorrect.  Most of ES6 is in fact highly supported across browsers except 
for certain specifications that are still being worked on regarding 
implementation details.  For reference, look at 
http://kangax.github.io/compat-table/es6/. It all depends on your target 
audience, but using babel to transpile by default is a good practice.

As to the original issue, the problem is OP is using a non-compatible 
browser for imports, as you can see at https://caniuse.com/#feat=es6-module  
Firefox and IE are the big names that have  no native support and will 
require a transpiled version to work.

TL;dr front end can be a mess, OP got caught in it and there are ways 
around it.

-- 
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/fbc86dde-6230-4bab-a2d3-65c669584dbe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to access the key attributes of a model

2018-03-02 Thread Julio Biason
Hi Alberto,

I'm guessing `def blog(request):` is actually `blog_category_posts`, right?
Because you have `` on your URL, our view will receive it as another
parameter, after request. So it should be `def
blog_category_posts(requests, slug):` and then you can get the slug, filter
the posts and return them to the template.

On Thu, Mar 1, 2018 at 7:37 PM, Alberto Sanmartin <
albertosanmartinmarti...@gmail.com> wrote:

> This is mi code:
>
> models.py:
>
> @autoconnect
> class Category(models.Model):
> name = models.CharField(max_length=100)
> slug = models.CharField(max_length=100, blank=True)
> description = models.CharField(max_length=200)
> creation_date = models.DateTimeField(auto_now_add=True)
>
> def __unicode__(self):
> return self.name
>
> def pre_save(self):
> """metodo de la clase Category para calcular el slug de una
> categoria"""
> self.slug = self.name.replace(" ", "_").lower()
> print(self.slug)
>
>
> @autoconnect
> class Post(models.Model):
> Status = ((1, "Publicado"), (2, "Borrador"), (3, "Eliminado"))
> status = models.IntegerField(choices=Status, default=2, blank=False)
> title = models.CharField(max_length=100, blank=False)
> slug = models.CharField(max_length=100, default=' ', blank=True)
> description = models.CharField(max_length=200, blank=False)
> content = models.TextField(default=" ", blank=False)
> category = models.ForeignKey(Category, default=1, blank=False)
> creation_date = models.DateTimeField(auto_now_add=True)
> image = models.ImageField(upload_to="photos", default='/image.jpg',
> blank=False)
> author = models.ForeignKey(User, default=1)
>
> views.py:
>
> def blog(request):
> posts = models.Post.objects.filter(status=1).order_by("-creation_
> date")
> print(posts)
> categories = models.Category.objects.order_by("name")
> context = {
> "posts":posts,
> "categories":categories
> }
> return render(request, "blog.html", context)
>
> urls.py:
>
> url(r'^blog/categorias/(?P\w+)/$', views.blog_category_posts,
> name='blog_category_posts'),
>
> blog.html:
>
> {% for post in posts %}
> {{ post.title }}
> {{ post.description }}
> {{ post.category.name }}
> {{ post.author.username }}
> {{ post.creation_date }}
> {% endfor %}
>
> When I click on the link of the category in the blog.html, I want to be
> able to pass the attribute slug to url, but it does not work.
> Please help
> 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/dccfe67f-c6cc-4239-91ef-2c9a85b43099%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Julio Biason*, Sofware Engineer
*AZION*  |  Deliver. Accelerate. Protect.
Office: +55 51 3083 8101   |  Mobile: +55 51
*99907 0554*

-- 
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/CAEM7gE2O3Yq32-U1BxZJtqOtVmP%2BCdyZTdk6itk9Fz%3DShxs-Ow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: GSOC WITH DJANGO

2018-03-02 Thread Babatunde Akinyanmi
You need to give a proposal detailing what you want to work on. Note that
while you may ultimately improve your skills with the project, your main
goal will be to improve the project.

On 1 March 2018 at 05:25, tola temitope  wrote:

> hey, good day guys i am a Django developer thats been building for almost
> a year now and i am participating with gsoc this year with django, I want
> to improve my skills, solve problems and build the community too.
>
> --
> 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/5ab71783-19bf-479d-8f22-5eacf1d21b5b%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/CA%2BWjgXPqLsaOLmzjmf4jhpc-KBMi%2BNieTRfXLS9bYG%2B31e6KrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrade django from 1.8 to 1.9 - issue

2018-03-02 Thread OliveTree
Thanks @Jani Tiainen, I'll try to do it :)

-- 
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/2c4a319e-00f2-4a55-9143-75a891576527%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.