Re: Django 1.9.8 with mysql 'Commands out of sync; you can't run this command now' exception

2018-09-23 Thread mottaz hejaze
try latest_message = Message.objects.filter(example_field=1)[::-1].first() On Mon, Sep 24, 2018 at 5:55 AM wrote: > I am a python developer and I am using Django 1.9.8 for my project. > I am having a problem with MySQL like below: > > I have a model named 'Message' and sometimes when running t

Re: Django 1.9.8 with mysql 'Commands out of sync; you can't run this command now' exception

2018-09-23 Thread Adolfo Cueto
i know it, that problem ocurred when mysql is being used by other process... so you can add CONN_MAX_AGE: 0 in your conection string... and also try to use a diferent database and avoid to use multi threading processes El dom., 23 sept. 2018 a las 23:41, escribió: > Thank you so much Adolfo. I

Re: Django 1.9.8 with mysql 'Commands out of sync; you can't run this command now' exception

2018-09-23 Thread thanh
Thank you so much Adolfo. I know your code is the best practice but are you sure your code will solve the problem? On Monday, September 24, 2018 at 11:13:14 AM UTC+7, Adolfo Cueto wrote: > > Hey man try to change you code line like this > > latest_message = > Message.objects.filter(example_f

Re: Django 1.9.8 with mysql 'Commands out of sync; you can't run this command now' exception

2018-09-23 Thread Adolfo Cueto
Hey man try to change you code line like this latest_message = Message.objects.filter(example_field=1).order_by("-id").first() El dom., 23 sept. 2018 a las 22:55, escribió: > I am a python developer and I am using Django 1.9.8 for my project. > I am having a problem with MySQL like below:

Django 1.9.8 with mysql 'Commands out of sync; you can't run this command now' exception

2018-09-23 Thread thanh
I am a python developer and I am using Django 1.9.8 for my project. I am having a problem with MySQL like below: I have a model named 'Message' and sometimes when running this code, I got the exception 'Commands out of sync; you can't run this command now' latest_message = Message.objects.orde

Re: Update django 1.8 project to 2.0 lts

2018-09-23 Thread Jason
django 2.x is not lts, next LTS version is 2.2, as said before. That said, I'd break this into three chunks: migrate 1.8 to 1.11 migrate 2.7 to 3.6 (or 3.7) migrate 1.11 to 2.1 or 2.2, depending on the timing. 2.2 will be out in April 2019, which is seven months from now. I would separate fram

Re: Update django 1.8 project to 2.0 lts

2018-09-23 Thread carlos
Django 2.0 Not LTS warning!! the next LTS Django version is 2.2 Cheers On Sun, Sep 23, 2018 at 6:08 PM Mike Dewhirst wrote: > On 23/09/2018 11:15 PM, 'David Brown' via Django users wrote: > > I have a large django project built in 1.8 with about 14 apps and a > large amount of dependencies. > >

Re: Update django 1.8 project to 2.0 lts

2018-09-23 Thread Mike Dewhirst
On 23/09/2018 11:15 PM, 'David Brown' via Django users wrote: I have a large django project built in 1.8 with about 14 apps and a large amount of dependencies. I already have a good idea about how I'm going to update the 2.7 code to 3.6 or possibly just make it compatible with both, however, I

error at re_path

2018-09-23 Thread shiva kumar
getting error saying page not found when using re_path for defining our own url pattern. re_path(r'^home/(?p[0-9]{4})/$',views.home1), this was how i used the function and it showing error at ?p. is there any mistake suggest a solution. -- You received this message because you are subscribed

Re: Unable to open http://127.0.0.1:8000

2018-09-23 Thread 'Rohit' via Django users
I figured out the issue. Port 8000 and 8080 are being used by Jenkins. I tried to change it to 8282 and executed this line from the project folder in the command prompt: python manage.py runserver 8282 Once the development server started, I typed the IP as below from the browser. It worked.

Re: Unable to open http://127.0.0.1:8000

2018-09-23 Thread 'Rohit' via Django users
Django project I already created using PyCharm. The folder structure and basic .py files already there. On Sunday, September 23, 2018 at 11:35:56 PM UTC+5:30, SHUBHAM .SINGH. RATHORE wrote: > > Django-admin startaproject and project name > > On Sun 23 Sep, 2018 11:29 pm 'Rohit' via Django use

Re: Unable to open http://127.0.0.1:8000

2018-09-23 Thread 'Rohit' via Django users
I am using PyCharm. Do I still need to execute that code from command prompt? On Sunday, September 23, 2018 at 11:35:56 PM UTC+5:30, SHUBHAM .SINGH. RATHORE wrote: > > Django-admin startaproject and project name > > On Sun 23 Sep, 2018 11:29 pm 'Rohit' via Django users, < > django...@googlegr

Re: Unable to open http://127.0.0.1:8000

2018-09-23 Thread SHUBHAM .SINGH. RATHORE
Django-admin startaproject and project name On Sun 23 Sep, 2018 11:29 pm 'Rohit' via Django users, < django-users@googlegroups.com> wrote: > Hi, > > I am new to Django and started my first app. When I try to check the > development server using http://127.0.0.1:8000, I am getting: 404 Not > Foun

Unable to open http://127.0.0.1:8000

2018-09-23 Thread 'Rohit' via Django users
Hi, I am new to Django and started my first app. When I try to check the development server using http://127.0.0.1:8000, I am getting: 404 Not Found. How to fix this? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this g

what's the difference between TemplateView, ListView and DetailView ?

2018-09-23 Thread Mateusz
My answer was not fully on the topic. You shouldn't do what you want to do but if there's a real need for that... You can add context by overriding get_context() method. (context = super().get_context(); context['type'] = list; return context). {% if type == list %} This is a list {% elif type

Re: Django - using intermediate user group model

2018-09-23 Thread Mateusz
Is that User [N] -- [N] Group with many to many through Enrollment (something like that: User [1] -- [N] Enrollment [N] -- [1] Group)? Then, the answer in this gist here . W dniu piątek, 21 września 2018 20:16:05 UTC+2 użytkownik Fernando Balmaceda napi

Re: serializer for multipele views

2018-09-23 Thread Mateusz
You probably solved that already but... You go to *.../api/bookings*/ while your urls.py makes a redirection for *.../api/booking *(there's an analogy to .../api/workspace from the right image). W dniu niedziela, 23 września 2018 11:17:51 UTC+2 użytkownik Tim Vogt napisał: > > I have made an Re

Re: what's the difference between TemplateView, ListView and DetailView ?

2018-09-23 Thread Mateusz
> > Django provides base view classes which will suit a wide range of > applications. All views inherit from the View > > > class, which handles linking the view in to the URLs, HTTP method > di

Re: Update django 1.8 project to 2.0 lts

2018-09-23 Thread Mateusz
This can take a lot of time but if you're really into this, you can see the the release notes for every version between 1.8 and 2.0 (especially for version 2.0 ) and seek for things you can change in your code that were optimised in the meanti

Re: How to create form??

2018-09-23 Thread Mateusz
This may not seem simple, but it is. 1) You need a model with all the fields (docs ), 2) Register that model to be visible on admin page (docs ), 3) Create a form

Re: How to create form??

2018-09-23 Thread Jani Tiainen
Hi. If you have done the official tutorial, part 4 is all about this exact problem. su 23. syysk. 2018 klo 18.51 Ansari Sabir kirjoitti: > How to create a form that collect information (like first name, last name, > email address, contact number, gender) and admin can see that information > in

How to create form??

2018-09-23 Thread Ansari Sabir
How to create a form that collect information (like first name, last name, email address, contact number, gender) and admin can see that information in the /admin/ in django. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: Update django 1.8 project to 2.0 lts

2018-09-23 Thread Jani Tiainen
I suppose you do have good unittest code coverage so do gradual upgrades (which is preferred upgrade path) and read release notes on each version. 2to3 tool is great help to check some obvious issues when upgrading to Python 3. su 23. syysk. 2018 klo 16.57 'David Brown' via Django users < django-

Update django 1.8 project to 2.0 lts

2018-09-23 Thread 'David Brown' via Django users
I have a large django project built in 1.8 with about 14 apps and a large amount of dependencies. I already have a good idea about how I'm going to update the 2.7 code to 3.6 or possibly just make it compatible with both, however, I'm not sure what is the best practice and most efficient way to

Re: Error at OneToOneField in models while creating new models class

2018-09-23 Thread Adolfo Cueto
First you have to change your model name Class names starts with uppercase... My friend.. you are not making migrations... look at you have to do this: 1. Delete your migration folder 2. Delete you app table manually (DROP table) 3. python manage.py makemigrations app_name 4. migrate that's al

Re: Sample Datbase data

2018-09-23 Thread Gear Crew
Please more explain about your issues On Friday, 21 September 2018 13:43:47 UTC+2, Sukla Nag wrote: > > Is it possible to download table data of sample databases in the tutorial ? > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscrib

what's the difference between TemplateView, ListView and DetailView ?

2018-09-23 Thread Gear Crew
I want to know when I use TemplateView , ListView and DetailView on my template code -- 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...@

Re: serializer for multipele views

2018-09-23 Thread Jason
the screenshot of the error has a trailing slash in the URL, while the working response doesn;t. -- 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+un