Re: Trying to deploy Django 2.0.2 (DigitalOcean)

2018-02-07 Thread drone4four
Yes I know, *sacrac*. My venv was configured with Python 3.4 and pip3 pulled Django 2.0.1 beautifully from the start. I resolved my issue. The problem was with my Apache mod_wsgi version was with python 2. I found and installed libapache2-mod-wsgi-py3. Now my site runs perfectly. On Wednesday

Re: Trying to deploy Django 2.0.2 (DigitalOcean)

2018-02-07 Thread carlos
i think you install with python 3 right, django 2.0.x run only version python3!! On Wed, Feb 7, 2018 at 9:13 PM, drone4four wrote: > I am struggling deploying Django 2.0.2 on my DigitalOcean Droplet (Ubuntu > 14.04) with Apache mod_wsgi. > > I’ve followed this guide >

Trying to deploy Django 2.0.2 (DigitalOcean)

2018-02-07 Thread drone4four
I am struggling deploying Django 2.0.2 on my DigitalOcean Droplet (Ubuntu 14.04) with Apache mod_wsgi. I’ve followed this guide closely. That guide focuses on setting

How to test get_success_url in CreateView in Django

2018-02-07 Thread Tony
I am trying to write a test for the get_success_url method in a CreateView, to make sure it redirects to the newly created page. But the response status code is 200 instead of 302 as I expected. views.py class BlogCreate(CreateView): model = Blog fields = [‘author’, 'title', ’post’]

Re: Testing Channels 2.0 consumers - problem with routing

2018-02-07 Thread Andrew Godwin
I'm not going to address the mocking, as there's subtle details there (e.g. you mocked group_name as a non-property, I think), but look at the main issue. Can you make your code print out what _is_ in `self.scope`? url_route should definitely be in there, but I am curious what it looks like if it

Testing Channels 2.0 consumers - problem with routing

2018-02-07 Thread Azamat Galimzhanov
Hello, I'm setting up an auctions application using channels and websockets. When I'm running the server the code works just fine, troubles arise when I'm trying to test my app. asgiref==2.1.3 daphne==2.0.2 Django==2.0.2 channels==2.0.1 channels-redis==2.0.2 pytest==3.4.0 pytest-asyncio==0.8.0

Re: Channels 2.0 WebSocket demultiplexing

2018-02-07 Thread Daniel Gilge
Oh, thanks. Sorry, I didn’t realise that this issue is related to Channels 2. > Am 07.02.2018 um 19:09 schrieb Andrew Godwin : > > Hi, > > It's not yet been re-implemented - here's the issue to track it: > https://github.com/django/channels/issues/825 >

Re: Channels 2.0 WebSocket demultiplexing

2018-02-07 Thread Andrew Godwin
Hi, It's not yet been re-implemented - here's the issue to track it: https://github.com/django/channels/issues/825 Andrew On Wed, Feb 7, 2018 at 1:53 AM, Daniel Gilge wrote: > Hi, > > how do you demultiplex in Channels 2.0 using WebSockets? > > I want to use a single WebSocket connection and b

Re: Testing Channels database data missing in Consumer

2018-02-07 Thread Andrew Godwin
Interesting. I did note that you called ORM methods in an async context, which is not how you are supposed to do it, but I also believe that should work. Maybe try splitting the ORM methods into a separate function and awaiting it using SyncToAsync? As for the staticfiles in live test case problem

Re: Testing Channels database data missing in Consumer

2018-02-07 Thread Daniel Gilge
Hi Andrew, thanks for your reply. This test is passing (using the same packages): def test_fixture(db_with_segment, admin_client): assert models.MyModel.objects.count() == 1 response = admin_client.get('/api/my_model/list/') assert len(response.json()['results']) == 1 I tried to wri

Syntax error with TruncDay

2018-02-07 Thread Andrea
I have the following model in Django 1.11.10: class Test(models.Model): ... date_start = models.DateTimeField() ... The following works fine: Test.objects.annotate(day_start=TruncDate(ExpressionWrapper(F('date_start') - timedelta(hours=5), output_field=models.DateField())) If I replace Tr

Channels 2.0 WebSocket demultiplexing

2018-02-07 Thread Daniel Gilge
Hi, how do you demultiplex in Channels 2.0 using WebSockets? I want to use a single WebSocket connection and be able to address different models according to the path. Daniel -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe fro