Re: NoReverseMatch at / ' homepage' is not a registered namespace

2018-06-26 Thread pranay reddy
Incorrect syntax used Correction Views.py: from .models import Topic def index(request): """the homepage for the homepage""" return render(request, 'homepage/index.html', name="something") Base.html: main Follow the same process for every view and template Sent via the

Re: Websocket connection failed: Error during WebSocket handshake: Unexpected response code: 200

2018-06-26 Thread Mikhailo Keda
That post is outdated (it's not for Chanels 2), you nginx.conf is wrong, ws isn't location, it's protocol so you web sockets connections are forwarded to unix://myproject/experiment_platform.sock; and this triggers your error You just need forward all connections to daphne (except /static) --

Using Django admin datepicker in a custom form

2018-06-26 Thread sum abiut
I am trying to use a django admin datepicker in a custom form. it is displaying alright but the year only begin in 2018 but no later than 2018. Please assist, below is my form.py #my form.py from django.forms.extras.widgets import SelectDateWidgetclass ContactForm(forms.ModelForm): class

Re: Websocket connection failed: Error during WebSocket handshake: Unexpected response code: 200

2018-06-26 Thread Xiaoyun Huang
Thanks for your information! I just did all the configurations again following this post( http://masnun.rocks/2016/11/02/deploying-django-channels-using-daphne/). And I think it is extremely useful for me and my website is now running. And you are right, I don't need both uwsgi and daphne. Only

Re: Websocket connection failed: Error during WebSocket handshake: Unexpected response code: 200

2018-06-26 Thread 赖信桃
Again, websocket is different from HTTP, both are built on TCP. So Nginx preoxy_pass is for HTTP forward, so you can not use it for HTTP for tanspond. Maybe remove location /ws would work. Just use daphne as ws server. Spend some time reading the docs:

Re: Newbie : Object copy - weird error :-)

2018-06-26 Thread 赖信桃
Can you format your code or post it on a gist? On Wed, Jun 27, 2018 at 00:17 wrote: > Hi all :-) > > I'd like to archive some data. > > I did that : > > class AbstractDataModel(models.Model): > > xxx > > > class Meta: > abstract = True > > > def __iter__(self): > > return

Re: Forms in Bootstrap 4 Modals?

2018-06-26 Thread Alexander Joseph
Hey Kirby, Any ideas on where I should take this next? Thanks On Thursday, June 21, 2018 at 10:12:41 AM UTC-6, C. Kirby wrote: > > Ok, this is good to work with. Let us tackle this issue by issue. The > first issue is that your modal is not showing up. I see several possible > issues: > >

Re: Websocket connection failed: Error during WebSocket handshake: Unexpected response code: 200

2018-06-26 Thread flora . xiaoyun . huang
I think I must have messed the ports up. Here is a summary: redis: 6379 daphne: 8000 (if running daphne with this command: daphne experiment_platform.asgi:channel_layer --port 8000 --bind 0.0.0.0 -v2 &) ws (see *nginx.conf*): 8000 [I guess the error message in the browser console "WebSocket

Re: django display a row vale

2018-06-26 Thread sum abiut
Thanks, Here is my view.py and it works for me def display_data(request,id): selected_objects = minutes.objects.filter(pk__in=id) return render(request,'test.html',locals()) cheers, On Wed, Jun 27, 2018 at 8:15 AM, Ryan Nowakowski wrote: > On Tue, Jun 26, 2018 at 04:33:41PM +1100, sum

Re: django display a row vale

2018-06-26 Thread Ryan Nowakowski
On Tue, Jun 26, 2018 at 04:33:41PM +1100, sum abiut wrote: > Hi, > i need some assistance, i have a table and want to be able to only display > the values of a particular row when ever the particular row is selected. > > please point me to right direction. > I assume you're talking about an

Re: NoReverseMatch at / ' homepage' is not a registered namespace

2018-06-26 Thread Jason
ok, and that has nothing to do with what I mentioned in my original response. this has nothing to do with your templates and how they're structured. it has everything to do with the way your urls are defined On Tuesday, June 26, 2018 at 10:38:15 AM UTC-4, Tim Vogt wrote: > > I am building my

Re: Importing classes from one app to another in a project

2018-06-26 Thread Jason
I would suggest you read on how python imports work https://docs.python.org/3/tutorial/modules.html#more-on-modules On Tuesday, June 26, 2018 at 12:07:45 PM UTC-4, john speny wrote: > > How do you import a class I have created, from forms. Py in the cart app > to views. Py in the shop app >

Re: Where setting up templates directory in settings.py

2018-06-26 Thread Mikhailo Keda
> > you can use bitbucket or something similar for project sharing > there is an example of template directory settings - https://bitbucket.org/voron-raven/games/src/3fa65824be0d7fed2f8042ca189a3039ef016f28/games/settings.py#lines-102 -- You received this message because you are subscribed

Re: Newbie : Object copy - weird error :-)

2018-06-26 Thread mickael . barbo
Error typo, I creates a new thread with the good description ;-) Le mardi 26 juin 2018 16:35:27 UTC+2, Nelson Varela a écrit : > > The following class is kinda weird: > class DataModel(DataModel): > > A class which inherits itself??? > > > > On Tuesday, June 26, 2018 at 11:31:24 AM UTC+2,

Newbie : Object copy - weird error :-)

2018-06-26 Thread mickael . barbo
Hi all :-) I'd like to archive some data. I did that : class AbstractDataModel(models.Model): xxx class Meta: abstract = True def __iter__(self): return iter([self.xxx, self.yyy, self.zzz, self.aaa, self.qqq, self.mode_bbb]) class

Re: Where setting up templates directory in settings.py

2018-06-26 Thread Oskar Artur
you could try to create "blog" directory in your templates folder and put the date.html in there... not sure thou as I am very beginner ;) On Tuesday, 26 June 2018 12:02:45 UTC+2, emmanuel wyckens wrote: > > Hello, > > I didn't solve my issue on adding the templates directories in setting.py. >

NoReverseMatch at / ' homepage' is not a registered namespace

2018-06-26 Thread Tim Vogt
I am building my django app from base.html and with child themes and get these errors: any help woud be appreciated. Tim NoReverseMatch at / ' homepage' is not a registered namespace Request Method: GET Request URL:http://localhost:8000/ Django Version: 2.0.6 Exception Type:

Re: Newbie : Object copy - weird error :-)

2018-06-26 Thread Nelson Varela
The following class is kinda weird: class DataModel(DataModel): A class which inherits itself??? On Tuesday, June 26, 2018 at 11:31:24 AM UTC+2, mickae...@gmail.com wrote: > > Hi all :-) > > I'd like to archive some data. > > I did that : > > class AbstractDataModel(models.Model): > xxx > >

Re: Djnago Python (INNER JOIN Query Or JOIN Query)

2018-06-26 Thread Jason
I would suggest you look at the object relational model section of the tutorial. And then browse the documentation for model references, relationships and lookups. Quite frankly, everything you're asking here is covered in detail there. On Tuesday, June 26, 2018 at 8:27:22 AM UTC-4, Pravin

Djnago Python (INNER JOIN Query Or JOIN Query)

2018-06-26 Thread Pravin Yadav
Hello Everyone, *I want to make INNER JOIN Query Or JOIN Query with "Video" and "* *Thumbimages**". Kindly let me know.* *Below my Models:-* *from __future__ import unicode_literals* *from django.db import models* *from django.utils import timezone* *from django.template.defaultfilters import

Where setting up templates directory in settings.py

2018-06-26 Thread emmanuel wyckens
Hello, I didn't solve my issue on adding the templates directories in setting.py. I always the same error : See my project in zip file Thanks in advance Emmanuel TemplateDoesNotExist at /blog/date blog/date.html Request Method: GET Request URL: http://127.0.0.1:8000/blog/date Django

Newbie : Object copy - weird error :-)

2018-06-26 Thread mickael . barbo
Hi all :-) I'd like to archive some data. I did that : class AbstractDataModel(models.Model): xxx class Meta: abstract = True def __iter__(self): return iter([self.xxx, self.yyy, self.zzz, self.aaa, self.qqq, self.mode_bbb]) class DataModel(DataModel): pass

Newbie : Implementation possible ?

2018-06-26 Thread mickael . barbo
Hi community :) I'd like to implement something like "joined image". In Database, I'd like CoreObject to have the key of "Object1" OR "Object2" OR "Object3" (like foreignKey). How can I do that ? The context is that CoreObject is a central DataBaseFile and will receive information from one

Re: how to add radiobuttons to my ModelForm

2018-06-26 Thread Saloni Kalra
*template:* {% extends "posts/post_base.html" %} {% load bootstrap3 %} {% block post_content %} {% if not form.instance.pk %} Create Post {% else %} Update Post {% endif %} {% csrf_token %} {% bootstrap_form form %} {% endblock %} On Monday, 25 June 2018 23:47:07 UTC+5, alex eckert wrote: