Problems with authenticate in Django 1.10

2019-08-23 Thread Marcos Fraga
HI, I'm trying to migrate an application from *Django1.8.5/Python2.7* to *Django 1.10/Python3.6* and having problems with code below: def clean_password(self): username = self.cleaned_data.get('username') password = self.cleaned_data.get('password')

Re: Template.render(Context) in django 1.10+

2018-03-13 Thread James Bennett
On Mon, Mar 12, 2018 at 5:44 PM, Craig de Stigter < craig.destig...@koordinates.com> wrote: > Thanks for the reply. > > So I guess there are actually now two types of templates, and they have > incompatible API. Neither is deprecated. > > Has this confused anyone else? Is this a desirable/necessar

Re: Template.render(Context) in django 1.10+

2018-03-13 Thread Mike Dewhirst
On 13/03/2018 4:55 PM, Craig de Stigter wrote: Cheers Mike That deprecation notice says to me that Context itself is not deprecated, but the `current_app` argument is. I don't think that's a problem for us as I don't think we've ever used it. Perhaps I can clarify. As far as I can tell, acco

Re: Template.render(Context) in django 1.10+

2018-03-12 Thread Craig de Stigter
Cheers Mike That deprecation notice says to me that Context itself is not deprecated, but the `current_app` argument is. I don't think that's a problem for us as I don't think we've ever used it. Perhaps I can clarify. As far as I can tell, according to the errors and deprecation warnings I'm rec

Re: Template.render(Context) in django 1.10+

2018-03-12 Thread Mike Dewhirst
On 13/03/2018 11:44 AM, Craig de Stigter wrote: Thanks for the reply. So I guess there are actually now two types of templates, and they have incompatible API. Neither is deprecated. Craig I don't think your guess is correct. Or at least I'm missing something if it is! I remember bringing

Re: Template.render(Context) in django 1.10+

2018-03-12 Thread Craig de Stigter
Thanks for the reply. So I guess there are actually now two types of templates, and they have incompatible API. Neither is deprecated. Has this confused anyone else? Is this a desirable/necessary situation? I think in order to have consistent template usage in our project we really need to jus

Re: Template.render(Context) in django 1.10+

2018-03-11 Thread Daniel Roseman
On Sunday, 11 March 2018 21:06:51 UTC, Craig de Stigter wrote: > > Hi folks > > I'm upgrading a large app from 1.8 to 1.11 and coming up against this as I > traverse through django 1.9: > > >>> from django.template import engines, Context > ... t = engines['django'].from_string('') > ... t.render(

Template.render(Context) in django 1.10+

2018-03-11 Thread Craig de Stigter
Hi folks I'm upgrading a large app from 1.8 to 1.11 and coming up against this as I traverse through django 1.9: >>> from django.template import engines, Context ... t = engines['django'].from_string('') ... t.render(Context({})) ... /path/to/bin/django-admin.py:3: RemovedInDjango110Warning: rend

Re: How to save foreign key along with parent object in django 1.10

2017-12-04 Thread Constantine Covtushenko
length=255L, blank=True) > > > class Book(models.Model): > author = models.ForeignKey(Author) > > > I want to do: > > > author = Author('Robert Frost') > > book = Book(author) > > book.save() > > Can this be done in Django 1.10 ? > &g

How to save foreign key along with parent object in django 1.10

2017-12-04 Thread Priyanka Thakur
Model): name = models.CharField(max_length=255L, blank=True) class Book(models.Model): author = models.ForeignKey(Author) I want to do: author = Author('Robert Frost') book = Book(author) book.save() Can this be done in Django 1.10 ? Regards, Priyanka -- You receiv

Re: Result of queryset in Django 1.10 is not sorted

2017-09-05 Thread Jani Tiainen
Hi, Unless you have applied ordering, either in model Meta, or in your query clause, results are really "in no particular order". Most of the databases do return results in order the data is read from the disk, but that's not quaranteed. If you require ordering, add .order_by() to your query

Re: Result of queryset in Django 1.10 is not sorted

2017-09-05 Thread Antonis Christofides
Hi, if you don't specifically ask for the query results to be sorted, their order will be undefined. Differences in your Django version or the RDBMS version or the OS or the environment or anything may result in a different sort order. If you want the query to be sorted, you must either use the or

Result of queryset in Django 1.10 is not sorted

2017-09-04 Thread Priyanka Thakur
Hi, As part of migration to Django 1.10.4 from 1.7, I have noticed that queryset results are unsorted, compared to previous version. Has same behaviour been observed by anyone? Regards, Priyanka -- You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Trouble upgrading ModelField class for django 1.10

2017-06-03 Thread Alexis Roda
El 03/06/17 a les 16:27, Simon Charette ha escrit: Hello Alexis, As you've noticed Django 1.8 changed values()/values_list() to converts values returned from the database just like any other ORM method[0]. If you want to use the json module to serialize your horari.Horari instances you'll ha

Re: Trouble upgrading ModelField class for django 1.10

2017-06-03 Thread Simon Charette
2017 08:44:07 UTC-4, Alexis Roda a écrit : > > Hi, > > I have a custom ModelField (HorariField, a simple weekly timetable) > written for django 1.7 and I'm trying to upgrade it to work with django > 1.10, so I have removed the SubfieldBase metaclass and added the >

Trouble upgrading ModelField class for django 1.10

2017-06-03 Thread Alexis Roda
Hi, I have a custom ModelField (HorariField, a simple weekly timetable) written for django 1.7 and I'm trying to upgrade it to work with django 1.10, so I have removed the SubfieldBase metaclass and added the from_db_value method. The field inherits from CharField and stores Horari inst

Re: Form.changed_data no longer includes changes to related fields as of Django 1.10?

2017-04-11 Thread Tim Graham
03:18 PM UTC-4, Robert Rollins wrote: > > I've got code that expects Form.changed_data to include the Groups to > which a User belongs when the User edit form I wrote changes them. It works > in Django 1.9.13, but tests fails in Django 1.10. > > Is there a known change to

Form.changed_data no longer includes changes to related fields as of Django 1.10?

2017-04-11 Thread Robert Rollins
I've got code that expects Form.changed_data to include the Groups to which a User belongs when the User edit form I wrote changes them. It works in Django 1.9.13, but tests fails in Django 1.10. Is there a known change to Django that would cause this? I don't see any

Re: Django 1.10 with Python 3.5 on Mac with Fink

2017-01-31 Thread Alan
Found the problem, a old wrongly set DJANGO_SETTINGS_MODULE pointing to the offending module. On 30 January 2017 at 22:49, Alan wrote: > So I installed django 1.10 and then when I try to do this; > > python3.5 -m django --version > > Traceback (most recent call last): &g

Django 1.10 with Python 3.5 on Mac with Fink

2017-01-30 Thread Alan
So I installed django 1.10 and then when I try to do this; python3.5 -m django --version Traceback (most recent call last): File "/sw/lib/python3.5/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/sw/lib/python3.5/runpy.py", line

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-28 Thread 'Peter Müller' via Django users
I do not think that "Each view is responsible for doing one of two things: Returning an > HttpResponse object containing the content for the requested page, or > raising an exception such as Http404. The rest is up to you." > is easy for a beginner to understand. Also the tutorial directly ask

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-28 Thread Vijay Khemlani
> A quick one is e.g. that there is no explanation of what a view is and what > > its purpose is. "The code above maps URLs, as simple regular expressions, to the location of Python callback functions (“views”)" "Each view is responsible for doing one of two things: Returning an HttpResponse obje

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-28 Thread 'Peter Müller' via Django users
If I could I would gladly rewrite the tutorial. But sadly I do not have enough time to do so. However I think it is bad since it not only completely disregards the zen of py but also its own principles (DRY etc.) If you need concrete examples I can name you tons. A quick one is e.g. that there

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-27 Thread Melvyn Sopacua
https://github.com/django/django/pulls The tutorial has a very logical order, going from the database abstraction up to the template layer and beyond. But feel free to rewrite it and submit it to the project. I never follow tutorials to the letter - for example back when I did it in Django 1.

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-27 Thread 'Peter Müller' via Django users
What do you mean by PR? Am Freitag, 27. Januar 2017 18:32:23 UTC+1 schrieb Melvyn Sopacua: > > On Monday 16 January 2017 07:49:00 'Peter Müller' via Django users wrote: > > > > > Also I used the tutorial just that I abstracted the concept since I > > > think the tutorial is more than bad. > >

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-27 Thread Melvyn Sopacua
On Monday 16 January 2017 07:49:00 'Peter Müller' via Django users wrote: > Also I used the tutorial just that I abstracted the concept since I > think the tutorial is more than bad. Awaiting your PRs. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Gr

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-27 Thread 'Peter Müller' via Django users
But if I do a direct import via python's import statement. it will execute the content of the file before loading apps and that raises that error. No matter what you import you *have* to use django's import system. Also it just works fine now. Am Dienstag, 17. Januar 2017 23:05:10 UTC+1 schrieb

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-17 Thread Vijay Khemlani
The only "custom include" in Django is for loading other url files The rest of the imports are typical Python module / packages On 1/17/17, 'Peter Müller' via Django users wrote: > Ah I now see the problem. However I tried to remove the entry in the > __init__.py file > Python is then unable to

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-17 Thread 'Peter Müller' via Django users
Ah I now see the problem. However I tried to remove the entry in the __init__.py file Python is then unable to find *any *module in that directory. Don't ask me why that is. Also I noticed that django has its completely own import ecosystem. So I used django.conf.urls.include to include a new ur

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-16 Thread Michal Petrucha
On Mon, Jan 16, 2017 at 12:23:09PM -0800, 'Peter Müller' via Django users wrote: > Am Montag, 16. Januar 2017 21:20:53 UTC+1 schrieb Daniel Roseman: > > The traceback shows that you are importing your views module in the > > __init__.py of your app. Don't do that. > > Well else python doesn't fi

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-16 Thread 'Peter Müller' via Django users
e views file. > > > > *From:* 'Peter Müller' via Django users [mailto:django...@googlegroups.com > ] > *Sent:* Monday, January 16, 2017 2:23 PM > *To:* Django users > *Subject:* Re: Am I stupid or is there an essential error in Django 1.10 > Docs? > > > >

RE: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-16 Thread Matthew Pava
.com] Sent: Monday, January 16, 2017 2:23 PM To: Django users Subject: Re: Am I stupid or is there an essential error in Django 1.10 Docs? Well else python doesn't find the view.py file? Am Montag, 16. Januar 2017 21:20:53 UTC+1 schrieb Daniel Roseman: On Monday, 16 January 2017 15:53:56 UTC, Pet

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-16 Thread 'Peter Müller' via Django users
Stranvr ist the project made with startproject and db_testing is an app made with startapp. So: ProjectRoot -StranvrProject --urls.py --settings.py --wsgi.py -db_testing --views.py --__init__.py --models.py --admin.py --apps.py also the app is added to settings.py Am Montag, 16. Januar 2017 22

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-16 Thread Andreas Kuhne
What does the project structure look like? Is Stranvr the name of the project? It looks to me like you haven't created an app - or have you called your app "db_testing" and the project "Stranvr"? Because you first have to create you project with "django-admin.py startproject " and then within th

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-16 Thread 'Peter Müller' via Django users
Well else python doesn't find the view.py file? Am Montag, 16. Januar 2017 21:20:53 UTC+1 schrieb Daniel Roseman: > > On Monday, 16 January 2017 15:53:56 UTC, Peter Müller wrote: >> >> For the traceback: http://pastebin.com/Wy7And6M >> And the views configuration: http://pastebin.com/q0V3bQay >> >

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-16 Thread Daniel Roseman
On Monday, 16 January 2017 15:53:56 UTC, Peter Müller wrote: > > For the traceback: http://pastebin.com/Wy7And6M > And the views configuration: http://pastebin.com/q0V3bQay > > > thanks > > Peter > The traceback shows that you are importing your views module in the __init__.py of your app. Don't

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-16 Thread 'Peter Müller' via Django users
y. >> >> >> I just began learning how to use django. So I wanted to include data from >> the database in a testwebsite. >> Therefore I made a new app and created a model called "user" and a view >> that should fill a template with data from that model.

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-16 Thread 'Peter Müller' via Django users
cts before tackling a major one so just going with the standard > User model should be no impediment in the early stages. Then maybe look > through the docs to see how to customise/replace that User model. > > Cheers > > Mike > > > a view that should fill a template

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-16 Thread Daniel Roseman
nd a view > that should fill a template with data from that model. > To do this (according to Django 1.10 Docs/Tutorial) I need to import the > model class into the view file and for example use models.user.all(). > However on import of the view Django complains about > django.core.exce

Re: Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-15 Thread Mike Dewhirst
ew that should fill a template with data from that model. To do this (according to Django 1.10 Docs/Tutorial) I need to import the model class into the view file and for example use models.user.all(). However on import of the view Django complains about | django.core.exceptions.AppRegistryNotReady:Ap

Am I stupid or is there an essential error in Django 1.10 Docs?

2017-01-15 Thread 'Peter Müller' via Django users
Hello everybody. I just began learning how to use django. So I wanted to include data from the database in a testwebsite. Therefore I made a new app and created a model called "user" and a view that should fill a template with data from that model. To do this (according to Django

Re: Multiple Fields as Primary Key in MySQL - Django 1.10

2017-01-05 Thread ramesh
Thank you very much Simone and Michal for your timely response. I made all the fields those are part of primary keys as unique and added a dummy auto-increment ID for these tables and did migrations. So far so good. Thanks, Ramesh. On Tuesday, January 3, 2017 at 5:35:07 PM UTC+5:30, ramesh wro

Re: Multiple Fields as Primary Key in MySQL - Django 1.10

2017-01-03 Thread Michal Petrucha
On Tue, Jan 03, 2017 at 01:56:00PM +0100, Simone Federici wrote: > Hi, > > from compositekey import db > > On my compositekey project the development is stopped on 1.5 django release. > https://github.com/simone/django-compositekey > > The Django 1.6 release, with an huge ORM refactoring and a h

Re: Multiple Fields as Primary Key in MySQL - Django 1.10

2017-01-03 Thread Simone Federici
Hi, from compositekey import db On my compositekey project the development is stopped on 1.5 django release. https://github.com/simone/django-compositekey The Django 1.6 release, with an huge ORM refactoring and a huge testing refactoring, let my work hard to maintains. What I understand after t

Multiple Fields as Primary Key in MySQL - Django 1.10

2017-01-03 Thread ramesh
Hi, Below is the model generated for one of the table from the legacy database using "inspectdb" class Test(models.Model): field1 = models.AutoField(db_column='Field1') # Field name made lowercase. field2 = models.ForeignKey('Field2', models.DO_NOTHING, db_column='Field2') # Field n

Re: django 1.10 error (SSL error: called a function you should not call)

2016-11-03 Thread Melvyn Sopacua
On Thursday 03 November 2016 12:11:29 Luc Jean wrote: > (SSL error: called a function you should not call) > It seems to occur while querying the database. > > # django/db/backends/utils.py line 64 > return self.cursor.execute(sql, params) This would only make sense if you use SSL to connect to

django 1.10 error (SSL error: called a function you should not call)

2016-11-03 Thread Luc Jean
Hello, I have a Python 3.5/Django 1.10 app served by Apache/mod_wsgi over SSL. It is connected to a Postgres 9.5.2 database (with psycopg2==2.6.2) and is running on a server at AlwaysData It works fine most of time but I have sometimes an error that I don't understand. (SSL error: cal

Re: Django 1.10 "Cannot force an update in save() with no primary key", using model with composite primary key (unique_together)

2016-10-29 Thread Tim Graham
Try bisecting to find the commit in Django where the behavior changed: https://docs.djangoproject.com/en/dev/internals/contributing/triaging-tickets/#bisecting-a-regression On Saturday, October 29, 2016 at 9:57:53 AM UTC-4, in...@lucasvandijk.nl wrote: > > Hi all, > > I have a simple model which

Django 1.10 "Cannot force an update in save() with no primary key", using model with composite primary key (unique_together)

2016-10-29 Thread info
Hi all, I have a simple model whichs acts as custom many-to-many association table with additional data. ``` class NetworkLinkAssociation(models.Model): """ We use our own many-to-many association table, because we want to keep track which links are added, and which links are deleted

Re: Subtracting UNIX_TIMESTAMPS broke in Django 1.10

2016-08-17 Thread Simon Charette
o 1.9.9: > SELECT (left(start, 10)) AS `day`, SUM((UNIX_TIMESTAMP(`TaskLog`.`stop`) - > UNIX_TIMESTAMP(`TaskLog`.`start`))) AS `sum` FROM `TaskLog` WHERE > (`TaskLog`.`user_id` = 22) GROUP BY UNIX_TIMESTAMP(`TaskLog`.`stop`), > UNIX_TIMESTAMP(`TaskLog`.`start`), (left(start, 10)) ORDER BY NULL &

Subtracting UNIX_TIMESTAMPS broke in Django 1.10

2016-08-16 Thread Dan Edwards
RE (`TaskLog`.`user_id` = 22) GROUP BY UNIX_TIMESTAMP(`TaskLog`.`stop`), UNIX_TIMESTAMP(`TaskLog`.`start`), (left(start, 10)) ORDER BY NULL Django 1.10: SELECT (left(start, 10)) AS `day`, SUM(TIMESTAMPDIFF(MICROSECOND, UNIX_TIMESTAMP(`TaskLog`.`start`), UNIX_TIMESTAMP(`TaskLog`.`stop`))) AS `sum

Re: Django 1.10 How to Take form Inputs (ie field one + field two = field three) and auto update before submitting the form.

2016-08-15 Thread Paul Kudla
} > > > (The script don't work as is but should give the general idea) > This way, the user see instantly the effect of their change but your > application only work with safe value. > > I hope I didn't go too far off-path and that will be useful to you :)

Re: Django 1.10 How to Take form Inputs (ie field one + field two = field three) and auto update before submitting the form.

2016-08-14 Thread ludovic coues
is way, the user see instantly the effect of their change but your application only work with safe value. I hope I didn't go too far off-path and that will be useful to you :) 2016-08-13 22:12 GMT+02:00 Paul Kudla : > I am running django 1.10 and assume i will need to use java scripts, jqu

Django 1.10 How to Take form Inputs (ie field one + field two = field three) and auto update before submitting the form.

2016-08-13 Thread Paul Kudla
I am running django 1.10 and assume i will need to use java scripts, jquery or angularjs Simply put i have a decimal field that i want to add to another decimal field and place the answer in a third decimal field. I want this to be displayed on the fly as the form gets data inputed on the

Django 1.10, Issues with prefix_default_language

2016-08-12 Thread Keith Hackbarth
I'm having two issues with "prefix_default_language" that I was hoping to shed some insight on. My URL conf is as follows: urlpatterns += i18n_patterns( url(r'^(?P.+-parking)/?$', CityView.as_view()), prefix_default_language=False ) Issue #1: Prefixes If a city that matches my regex ALS

Re: (Is it a bug?) TruncMonth does not work when there is "ordering" in the model Meta (Django 1.10)

2016-08-10 Thread Tim Graham
6 at 3:44:33 PM UTC-4, Neto wrote: >>> >>> I'm trying to get number of records per month, but Django does not >>> return correctly when there is "ordering" in class Meta Model. >>> >>> I have the Abc model, with 4 records

Re: (Is it a bug?) TruncMonth does not work when there is "ordering" in the model Meta (Django 1.10)

2016-08-10 Thread Neto
correctly when there is "ordering" in class Meta Model. >> >> I have the Abc model, with 4 records made this month, look what happens >> (Django 1.10, PostgreSQL): >> >> class Abc(Base): >> >> class Meta: >> ordering = ['-

Re: (Is it a bug?) TruncMonth does not work when there is "ordering" in the model Meta (Django 1.10)

2016-08-10 Thread Tim Graham
Django does not return > correctly when there is "ordering" in class Meta Model. > > I have the Abc model, with 4 records made this month, look what happens > (Django 1.10, PostgreSQL): > > class Abc(Base): > > class Meta: > ordering = [&

(Is it a bug?) TruncMonth does not work when there is "ordering" in the model Meta (Django 1.10)

2016-08-10 Thread Neto
I'm trying to get number of records per month, but Django does not return correctly when there is "ordering" in class Meta Model. I have the Abc model, with 4 records made this month, look what happens (Django 1.10, PostgreSQL): class Abc(Base): class Meta:

Re: Django 1.10

2016-08-09 Thread Tim Graham
Remove the strings at the start of each urlpatterns, e.g. 'matricula.views.Auth'. That's obsolete from when you were using patterns(). urlpatterns should be a list of url()s. On Tuesday, August 9, 2016 at 11:57:09 AM UTC-4, ludovic coues wrote: > > What you are writing is not valid python syntax

Re: Django 1.10

2016-08-09 Thread ludovic coues
What you are writing is not valid python syntax. Here is the problematic code: urlpatterns += urlpatterns['matricula.views.Courses', url('^courses$', list_courses, name='courses'), url('^course/(?P\d+)$', view_course, name='course'),

Re: Django 1.10

2016-08-09 Thread Sergiy Khohlov
On Tue, Aug 9, 2016 at 6:46 PM, wrote: > view_course Send definition of this function view_course Many thanks, Serge +380 636150445 skype: skhohlov -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Django 1.10

2016-08-09 Thread direcoape
Hello I need to know what is my error gretting this is my urls.py from django.conf.urls import url, include from matricula.views.Auth import * from matricula.views.Courses import * from .admin import admin_site from matricula.views.Pages import PageDetail from matricula.views.Enrollments import

[ANNOUNCE] Django 1.10 and 1.9.9 released

2016-08-01 Thread Tim Graham
Django 1.10 and a bug fix release for the 1.9 series (1.9.9) are now available: https://www.djangoproject.com/weblog/2016/aug/01/django-110-released/ With the release of Django 1.10, Django 1.9 has reach end of mainstream support. It will continue to receive security and data loss fixes for

[ANNOUNCE] Django 1.10 beta 1 released

2016-06-21 Thread Tim Graham
We've made the second release on the way to Django's next major release, Django 1.10! With a month and a half until the scheduled final release, we'll need timely testing from the community to ensure an on-time and stable release. Check out the blog post: https://www.djangopro

[ANNOUNCE] Django 1.10 alpha 1 released

2016-05-20 Thread Tim Graham
We've made the first release on the way to Django's next major release, Django 1.10! With two and a half months until the scheduled final release, we'll need timely testing from the community to ensure an on-time and stable release. Check out the blog post: https://www.djangopro