Re: path('posts/(?P[0-9]+)/$'

2018-12-02 Thread Lachlan Musicman
On Mon, 3 Dec 2018 at 11:51, wrote: > > > On Sunday, December 2, 2018 at 10:00:17 AM UTC-8, Jani Tiainen wrote: >> >> Hi. >> >> Path is a new url format which uses format of for >> exanple like . If you want to use regular expressions use >> re_path instead. >> >> kirjoitti su 2. jouluk. 2018

Re: path('posts/(?P[0-9]+)/$'

2018-12-02 Thread ehrenfeld1946
I am new to django so I am not sure I understand what you are saying. Can you give me a rewrite of the correct syntax of the line that is not correct? Thank you On Sunday, December 2, 2018 at 10:00:17 AM UTC-8, Jani Tiainen wrote: > > Hi. > > Path is a new url format which uses format of for

Best way to structure this Django project

2018-12-02 Thread Simon Connah
Hi, I have a bit of a problem with structuring a Django project. I have a UserProfile app which stores extra information about users using a OneToOneField to the Django auth user model. I have a products app which has two models relating to two types of products and finally I have a

Re: Unable to do the initial migrations with django-2.1.3 and "mysql 5.5.62-0+deb8u1 (Debian)"

2018-12-02 Thread Periklis Gkolias
Thanks Simon, I havent noticed that. On Sun, Dec 2, 2018 at 10:57 PM Simon Charette wrote: > Hello there, > > Django 2.1 dropped support for MySQL 5.5[0] as the end of > upstream support is December 2018. > > You'll have to update to a more recent version to use Django 2.1+. > > Cheers, > Simon

Re: Unable to do the initial migrations with django-2.1.3 and "mysql 5.5.62-0+deb8u1 (Debian)"

2018-12-02 Thread Simon Charette
Hello there, Django 2.1 dropped support for MySQL 5.5[0] as the end of upstream support is December 2018. You'll have to update to a more recent version to use Django 2.1+. Cheers, Simon [0] https://docs.djangoproject.com/en/2.1/releases/2.1/#dropped-support-for-mysql-5-5 Le dimanche 2

Re: Annotate giving back individual queries rather than results

2018-12-02 Thread Simon Charette
Hey there, I just wanted to clarify that the behavior of including the Meta.ordering fields in aggregation grouping been around for a while and Django 2.2 deprecates it to deal with the exact type of confusion you experienced here. Best, Simon Le dimanche 2 décembre 2018 08:51:17 UTC-5, Coder

Unable to do the initial migrations with django-2.1.3 and "mysql 5.5.62-0+deb8u1 (Debian)"

2018-12-02 Thread Periklis Gkolias
Hi there, I am trying to bootstrap a project with mysql and django with the versions described in the subject line. The app works fine if I just do a "runserver" and ignore the migration warning but when I apply the migrations I am getting the stacktrace you can see in the linked

Re: path('posts/(?P[0-9]+)/$'

2018-12-02 Thread Jani Tiainen
Hi. Path is a new url format which uses format of for exanple like . If you want to use regular expressions use re_path instead. kirjoitti su 2. jouluk. 2018 klo 19.42: > When I run http://localhost:8000/posts/2 > > I get the error: > > > Using the URLconf defined in blog.urls, >

path('posts/(?P[0-9]+)/$'

2018-12-02 Thread ehrenfeld1946
When I run http://localhost:8000/posts/2 I get the error: Using the URLconf defined in blog.urls, Django tried these URL patterns, in this order: 1. admin/ 2. 3. Posts/(?P[0-9]+)/$ 4. ^media/(?P.*)$ The current path, posts/2, didn't match any of these.

Re: Annotate giving back individual queries rather than results

2018-12-02 Thread Coder Dude
Solved It. It seems as of django 2.1, we need to add another parameter order_by *Submission*.*objects*.values('user').annotate(Count('id')).order_by('user') *documentation * *Thanks*

Annotate giving back individual queries rather than results

2018-12-02 Thread Coder Dude
Here are my models: from django.contrib.auth.models import User as DefaultUser class Submission(models.Model): user = models.ForeignKey(to=DefaultUser, on_delete=models.CASCADE ) total_score = models.DecimalField() The query that I am trying is :

Re: Forbidden (CSRF token missing or incorrect.)

2018-12-02 Thread Rabah Saadi
Hi guys. Thank you for the answers. I forgot to tell you that I hit the server in Developement and it is http. (local) I did put these parameters in my settings.py : CSRF_COOKIE_SECURE = False SESSION_COOKIE_SECURE = False but it keeps displaying the same message : Forbidden (CSRF token