Re: Running django tests with postgres

2018-09-15 Thread Mike Dewhirst
My software classifies chemical hazards according to intrinsic physical 
properties. This requires accessing large quantities of reference data 
imported from jurisdictions around the world. The tests demand correct 
classification for known properties.


There are dozens of different classification types for physical, health 
and environmental hazards. Here is the current spec ...

https://www.unece.org/trans/danger/publi/ghs/ghs_rev07/07files_e0.html

Then we have transport hazards based on UN reference data for air, sea 
and land transport. Here is the current spec ...

https://www.unece.org/trans/danger/publi/unrec/rev20/20files_track_e.html

Then there are regulatory workplace exposure limits and biological 
monitoring criteria which has to be fetched from more reference tables 
based on jurisdictions specified.


Then there are mixtures. Known properties of ingredients in various 
proportions produc different classifications. The software (and tests) 
must classify a mixture correctly. Some ingredients react together in 
known stoichiometric proportions to form a reaction product with its own 
known properties. In such a mixture partly reacted like that the tests 
have to prove correct classification.


Some of the properties are common and some depend on whether a substance 
is gas, liquid or solid. Nano is another. So there are core 
classification methods plus a separate set each for gas, liquid and 
solid. Then there are other sets for different acute toxicity routes 
(skin, inhalation, ingestion), chronic toxicity, specific organ toxicity 
for single and multiple exposures, explosion characteristics, oxidizing 
properties, corrosive to metal, skin and eyes, carcinogenicity, 
mutagenicity, ototoxicity and the list continues with aquatic and other 
environmental classifications.


There is more but I really have difficulty working out how to test 
end-points without invoking the calculations which in turn require 
construction of test substances and mixtures with model methods doing 
self-classification according to assigned test properties and the 
reference material.


On the topic of testing via SQLite3 when the production environment uses 
Postgres, I have found remarkably identical behaviour. Provided you 
*also* test with the same DBMS I see no problem.


Nothing gets into production without being tested with Postgres using 
BuildBot to manage it. As it happens the development server always uses 
Postgres. I have the option of testing in development with either 
SQLite3 or Postgres but cannot remember the last time I tested in 
development with Postgres.


Most of my dev testing is restricted to individual test classes which 
run relatively (for me!) quickly. I only run the full suite when I head 
off to lunch or Pilates or for a bike ride.


However, I would love my tests to run as fast as yours. How much would 
you charge me to make that happen?


Cheers

Mike

On 16/09/2018 3:33 AM, Jason wrote:
Agreed.  Something is definitely off.  At work, the legacy monolith 
django app has about 7800 tests.  It takes about 18 minutes to run the 
full test suite in docker with the latest MBP (four cores, 5GB RAM 
allocated in docker machine), including creating the db and four 
parallel test streams running.  A smaller service I work on has about 
780 tests, and it takes about 4 minutes to run in total.  And like 
Andreas, I find that too long at times!

--
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...@googlegroups.com 
.
To post to this group, send email to django-users@googlegroups.com 
.

Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/07a56866-c2ef-4bf3-8349-a5faa54e7d28%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5e6d7abd-fbf4-3664-ad18-0881c68d40b3%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Channels thread count is increasing

2018-09-15 Thread vishal sharma
In post API How to return response to network machine in Django ?


On Sun, 16 Sep 2018 at 4:32 AM, erkin kabataş  wrote:

> Hi All,
>
> I am new to python and django.
> I am using Python 3.6.5, Django 2.1 and Channels 2.1.2.
> My problem is when I switch to ASGI from WSGI server, in every request,
> thread count is increasing. Same thing is happening when I use
> sync_to_async function in consumers.py. Is this a normal behaviour?
>
> Thanks,
> Erkin
>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8635d3c1-c1e6-43d2-a70c-3db2ef3cc1f3%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADdVhnZR8r%2B0T%3DgeLajrxFCwKLtHmgy5MttSUvvxUOJN%3DH9NzQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Channels thread count is increasing

2018-09-15 Thread erkin kabataş
Hi All,

I am new to python and django. 
I am using Python 3.6.5, Django 2.1 and Channels 2.1.2.
My problem is when I switch to ASGI from WSGI server, in every request, 
thread count is increasing. Same thing is happening when I use 
sync_to_async function in consumers.py. Is this a normal behaviour?

Thanks,
Erkin

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8635d3c1-c1e6-43d2-a70c-3db2ef3cc1f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: new to django

2018-09-15 Thread Jayram Rawat
Thanks 4 the advice.. i will follow as you mentioned..😊😊

On Sat, Sep 15, 2018, 6:37 PM Shahil Hussain  wrote:

> Django is cool technology through which you make a web app(or you can say
> website) in which the backend(the database, all the information) and
> frontend (the website that you see from your device, the designed pages)
> are connected together.
>
> I am also a slightly experienced beginner. ; ) Django is amazing but you
> have to do practice learning it.
>
>
> I will recommend Django girls tutorial website to learn Django ( it is
> really easy)
>
> On Sat, Sep 15, 2018, 5:28 PM Jayram Rawat  wrote:
>
>> hello everyone , i am new to django can any one tell me that how to use
>> django and whats the main purpose of it. thank you
>>
>> --
>> 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...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/d76a9509-64ef-49be-abc1-225a5f73dfdc%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALJixFwRBkHF%2BXpvxy3eJ%3D4m7P_2gu-0TDpciq9VhSnScJ-0aQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMoLkiEED60_goeDF%3DmBDHLCRVM0bfjA_Wt76_yv2q2_9jv9fA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running django tests with postgres

2018-09-15 Thread Jason
Agreed.  Something is definitely off.  At work, the legacy monolith django 
app has about 7800 tests.  It takes about 18 minutes to run the full test 
suite in docker with the latest MBP (four cores, 5GB RAM allocated in 
docker machine), including creating the db and four parallel test streams 
running.  A smaller service I work on has about 780 tests, and it takes 
about 4 minutes to run in total.  And like Andreas, I find that too long at 
times!

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/07a56866-c2ef-4bf3-8349-a5faa54e7d28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: about project

2018-09-15 Thread Tim Vogt (Tim Vogt)
These are nice projects

tim
https://wsvincent.com/django-contact-form/



> Op 15 sep. 2018, om 16:11 heeft vikamadithya reddy 
>  het volgende geschreven:
> 
> can anyone suggest me a good project for undergraduation course using django?
> 
> -- 
> 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...@googlegroups.com 
> .
> To post to this group, send email to django-users@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/19290ef3-dc19-4878-8b4b-3a24a8a7a6af%40googlegroups.com
>  
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/80AA7039-F187-494F-AECC-22D92E0E8C0B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


update the date from the serializer with a new dict

2018-09-15 Thread georgenistor . ro
I have created a simple service which returns the data from a single table 
based on a param in the URL as follow:
Enter code here...http://127.0.0.1:8000/api/figo?figonr=1078924300-01

output is the json:
HTTP 200 OKAllow: GETContent-Type: application/jsonVary: Accept
[
   {
"figonr": "1078924300-01",
"description": "F150/C+W/CC/GE201S/S/OE/SE",
"productgroup": null
   }]


I would like to add in the json list a small dict with values like
Enter code here...{

"execution_time": "13:00"}


so the final result will be
Enter code here...[

{
"figonr": "1078924300-01",
"description": "F150/C+W/CC/GE201S/S/OE/SE",
"productgroup": null
},
{
"execution_time": "13:00"
}]



here is my serilalizer code
Enter code here...from rest_framework import serializers

from servicesapp.models import Figo
import datetime

class ServiceAppSerializer(serializers.ModelSerializer):
ExecutionTime = serializers.SerializerMethodField()  # add field

class Meta:
model = Figo
fields=('figonr','description', 'username', 'timestmp', 'ExecutionTime')

def get_ExecutionTime(self, obj):
# here write the logic to compute the value based on object
george=1
return datetime.datetime.now()




-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/90db9196-7cdc-44f0-a4a0-8e100c768ae5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: about project

2018-09-15 Thread Vivek Bhardwaj
  Monitoring Systems like Inventory Management System etc.Sent from my BlackBerry 10 smartphone.From: vikamadithya reddySent: Saturday 15 September 2018 10:10 PMTo: Django usersReply To: django-users@googlegroups.comSubject: about projectcan anyone suggest me a good project for undergraduation course using django?



-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/19290ef3-dc19-4878-8b4b-3a24a8a7a6af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.




-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20180915164932.32022615.9316.28788%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running django tests with postgres

2018-09-15 Thread Andréas Kühne
I would just be scared that some minor issues are different between the
database implementations - therefore some test that would work in the tests
and during development, doesn't work in production.

I usually try to use the same things in production and development (or as
close as possible).

That being said - Tests that take 300 minutes is just too much :-)

We have around 750 tests are it takes around 5 minutes to run - Something
that I find to be too long still

Regards,

Andréas


Den lör 15 sep. 2018 kl 02:29 skrev Mike Dewhirst :

> +1 Andréas
>
> One of my projects runs (currently) 1,248 tests using SQLite3 in 72
> minutes on my local Windows 10 dev laptop. That laptop has both a SSD
> and a hard disk. Foolishly I opted to use the SSD for software
> installations and the hard disk for development and thus the tests. I
> was concerned that overexercising the SSD might wear it out. I've since
> been advised that I shouldn't worry so one of these days I'll reorganise
> things and maybe see that 72 minutes drop somewhat.
>
> However, those same tests take 285 minutes on a headless PC running
> Ubuntu 16.04 LTS server with Postgres 9.6
>
> There are only one or two tests which generate slightly different error
> messages between SQLite3 and Postgres and that is trivial to manage.
>
> Most tests are database heavy, requiring queries and calling/testing
> model methods.
>
> Consequently, I use - and recommend - SQLite for dev tests and Postgres
> for deployment testing.
>
> Cheers
>
> Mike
>
> On 15/09/2018 1:45 AM, Andréas Kühne wrote:
> > Hi,
> >
> > Just my 5 cents. I think you are doing the tests wrong. I don't
> > believe that doing testing against hard coded values is at all correct
> > - and it isn't actually that hard to change the tests to a simpler
> > way. The values of the PK's aren't really necessary for your test to
> > be true either - how does that translate to a real use case? You
> > should probably check for A value in the pk field, but not a specific
> > value, because that doesn't result in any added value for your customer?
> >
> > Also changing the way django runs tests feels like working against the
> > framework rather than with it? I would probably much prefer changing
> > the tests than changing the way the framework runs my tests
> > Another issue you may face is if Django changes the underlying code,
> > then you will get strange failures as well...
> >
> > I don't think that 70 tests is that much to change either - we work
> > with a project that could fail a considerable amount of tests during a
> > refactor - and then we need to fix them. The same goes here I think -
> > you did a change to the infrastructure that made the tests invalid -
> > rewrite the tests :-)
> >
> > Best regards,
> >
> > Andréas
> >
> >
> > Den fre 14 sep. 2018 kl 17:32 skrev Hezi Halpert  > >:
> >
> > I would like to share with you an issue we encounter while moving
> > from sqlite to postgres with heavily use of Django testing.
> >
> > We have Django app with ~700 tests. Most of them accessing
> > database. We recently migrated the database from sqlite to postgres.
> > Many of our tests were written in a way that compares actual pk’s
> > (hard-coded pks or just file/json comparisons) . Since Django
> > testing on sqlite (testcases.TestCase class) creates in-memory
> > database (which is being reseted every unit test by default), we
> > never had a problem with it.
> > However, Django TestCase on postgres create completely another
> > test db which preserves the pk sequences between different tests.
> > And since many of our tests were written in a way that compares
> > actual pk’s they all start fail - depends on the exact tests
> > execution order.
> > Even tests which expect some pk and are were not failed yet, can
> > potentially failed in the future - depends on adding/editing other
> > tests which may change the db sequence
> >
> > We consider the following solutions:
> >
> >  1. Move to TransactionTestCase (instead of TestCase) and use
> > “reset_sequences = True” flag. Cons:
> > TransactionTestCase reduces performance dramatically (~4 times
> > longer in some of the tests)
> >  2. Refactor all failed tests: remove all hard-coded references to
> > the pk. Cons: Require much Dev effort (we had more then 70
> > such tests)
> >  3. Route the database in settings.py such it will use sqlite
> > instead of postgres when running tests. Cons: It will not
> > actually test the real scenarios - not an option
> >  4. Combine reset_sequences flag with TestCase in our own version
> > to TestCase: OurTestCase class and make everything to inherit
> > from it. This is the option we finally decided of. See below.
> >
> >
> > fromdjango.test import TestCase, testcases
> >
> > class OurTestCase(TestCase):
> >

about project

2018-09-15 Thread vikamadithya reddy
can anyone suggest me a good project for undergraduation course using 
django?

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/19290ef3-dc19-4878-8b4b-3a24a8a7a6af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: new to django

2018-09-15 Thread Shahil Hussain
Django is cool technology through which you make a web app(or you can say
website) in which the backend(the database, all the information) and
frontend (the website that you see from your device, the designed pages)
are connected together.

I am also a slightly experienced beginner. ; ) Django is amazing but you
have to do practice learning it.


I will recommend Django girls tutorial website to learn Django ( it is
really easy)

On Sat, Sep 15, 2018, 5:28 PM Jayram Rawat  wrote:

> hello everyone , i am new to django can any one tell me that how to use
> django and whats the main purpose of it. thank you
>
> --
> 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...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/d76a9509-64ef-49be-abc1-225a5f73dfdc%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALJixFwRBkHF%2BXpvxy3eJ%3D4m7P_2gu-0TDpciq9VhSnScJ-0aQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 2 NoReverseMatch (Default Django Reset Password View)

2018-09-15 Thread Jason
so, Django has a couple views for password resets.  First is the actual 
password reset page, which sends a POST request, then redirects to Done 
which is the template returned to the server.  What's happening here is 
Django can't find the URL name password_reset_done, and throws this error

If you're customizing password reset, I would suggest looking at 
https://wsvincent.com/django-user-authentication-tutorial-password-reset/

https://github.com/django-extensions/django-extensions has a great utility, 
show_urls, as a management command.  This shows all the URLs in your 
project, along with the view classes/functions mapped to them as well as 
the url namespaces.  I wonder if you've done somethign else that removed 
password_reset_done from the project?

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d2b64377-3db1-43a0-8061-9bb5b60abc4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 2 NoReverseMatch (Default Django Reset Password View)

2018-09-15 Thread Emprex KG
I found the solution

by adding success_url to the path

path('reset_password/', 
PasswordResetView.as_view(template_name='accounts/reset_password.html',
 success_url='/account/reset_password/done'), name='reset_password'),





On Saturday, September 15, 2018 at 12:58:49 PM UTC+1, Emprex KG wrote:
>
> Hey Everyone,
>
> I have been getting to grips wit Django over the last week no real issue :D
>
> However today since adding namespaces to my apps, I have gotten this error
>
> NoReverseMatch
>at /account/reset_password/
>   
>
> Reverse for 'password_reset_done' not found. 'password_reset_done' is not a 
> valid view function or pattern name.  
>
> Request Method: POST
> Request URL: http://127.0.0.1:8000/account/reset_password/
> Django Version: 2.1.1
> Exception Type: NoReverseMatch
> Exception Value: 
>
> Reverse for 'password_reset_done' not found. 'password_reset_done' is not a 
> valid view function or pattern name.
>
> Exception Location: 
> C:\Users\gilbe\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\urls\resolvers.py
>  
> in _reverse_with_prefix, line 622
> Python Executable: 
> C:\Users\gilbe\AppData\Local\Programs\Python\Python37-32\python.exe
> Python Version: 3.7.0
> Python Path: 
>
> ['C:\\Users\\gilbe\\Desktop\\testapplication',
>  'C:\\Users\\gilbe\\Desktop\\testapplication',
>  
> 'C:\\Users\\gilbe\\AppData\\Local\\Programs\\Python\\Python37-32\\python37.zip',
>  'C:\\Users\\gilbe\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs',
>  'C:\\Users\\gilbe\\AppData\\Local\\Programs\\Python\\Python37-32\\lib',
>  'C:\\Users\\gilbe\\AppData\\Local\\Programs\\Python\\Python37-32',
>  
> 'C:\\Users\\gilbe\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages',
>  'C:\\Program Files\\JetBrains\\PyCharm '
>  '2018.2.3\\helpers\\pycharm_matplotlib_backend']
>
> Server time: Sat, 15 Sep 2018 11:36:06 +
>
>  
> I know that I need to change the post_reset_redirect but not sure how to 
> do it
>
> current url.py
>
> path('reset_password/', 
> PasswordResetView.as_view(template_name='accounts/reset_password.html'),
>  name='reset_password'),
>
>
>
>
>
>
>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/98064fe9-1156-4287-b775-1d3ac1d331a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django 2 NoReverseMatch (Default Django Reset Password View)

2018-09-15 Thread Emprex KG
Hey Everyone,

I have been getting to grips wit Django over the last week no real issue :D

However today since adding namespaces to my apps, I have gotten this error

NoReverseMatch
   at /account/reset_password/
  

Reverse for 'password_reset_done' not found. 'password_reset_done' is not a 
valid view function or pattern name.  

Request Method: POST
Request URL: http://127.0.0.1:8000/account/reset_password/
Django Version: 2.1.1
Exception Type: NoReverseMatch
Exception Value: 

Reverse for 'password_reset_done' not found. 'password_reset_done' is not a 
valid view function or pattern name.

Exception Location: 
C:\Users\gilbe\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\urls\resolvers.py
 
in _reverse_with_prefix, line 622
Python Executable: 
C:\Users\gilbe\AppData\Local\Programs\Python\Python37-32\python.exe
Python Version: 3.7.0
Python Path: 

['C:\\Users\\gilbe\\Desktop\\testapplication',
 'C:\\Users\\gilbe\\Desktop\\testapplication',
 
'C:\\Users\\gilbe\\AppData\\Local\\Programs\\Python\\Python37-32\\python37.zip',
 'C:\\Users\\gilbe\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs',
 'C:\\Users\\gilbe\\AppData\\Local\\Programs\\Python\\Python37-32\\lib',
 'C:\\Users\\gilbe\\AppData\\Local\\Programs\\Python\\Python37-32',
 
'C:\\Users\\gilbe\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages',
 'C:\\Program Files\\JetBrains\\PyCharm '
 '2018.2.3\\helpers\\pycharm_matplotlib_backend']

Server time: Sat, 15 Sep 2018 11:36:06 +

 
I know that I need to change the post_reset_redirect but not sure how to do 
it

current url.py

path('reset_password/', 
PasswordResetView.as_view(template_name='accounts/reset_password.html'),
 name='reset_password'),






-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d795a79e-7a35-4ea2-a673-e9194cab7de5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


new to django

2018-09-15 Thread Jayram Rawat
hello everyone , i am new to django can any one tell me that how to use 
django and whats the main purpose of it. thank you

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d76a9509-64ef-49be-abc1-225a5f73dfdc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django 2.1.1 No Reverse Match

2018-09-15 Thread Emprex KG
Hey everyone,

been learning Django for a week or so ago now,

Today I have been having issues with the Django reset_password view after I 
have added namespace to my app

path('reset_password/', 
PasswordResetView.as_view(template_name='accounts/reset_password.html'),
 name='reset_password'),



Error:

NoReverseMatch at /account/reset_password/ 

Reverse for 'password_reset_done' not found. 'password_reset_done' is not a 
valid view function or pattern name.

Request Method: POST 
Request URL: http://127.0.0.1:8000/account/reset_password/ 
Django Version: 2.1.1 
Exception Type: NoReverseMatch 
Exception Value: 

Reverse for 'password_reset_done' not found. 'password_reset_done' is not a 
valid view function or pattern name.

Exception Location: 
C:\Users\gilbe\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\urls\resolvers.py
 
in _reverse_with_prefix, line 622 
Python Executable: 
C:\Users\gilbe\AppData\Local\Programs\Python\Python37-32\python.exe 
Python Version: 3.7.0 
Python Path: 

['C:\\Users\\gilbe\\Desktop\\testapplication',
 'C:\\Users\\gilbe\\Desktop\\testapplication',
 
'C:\\Users\\gilbe\\AppData\\Local\\Programs\\Python\\Python37-32\\python37.zip',
 'C:\\Users\\gilbe\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs',
 'C:\\Users\\gilbe\\AppData\\Local\\Programs\\Python\\Python37-32\\lib',
 'C:\\Users\\gilbe\\AppData\\Local\\Programs\\Python\\Python37-32',
 
'C:\\Users\\gilbe\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages',
 'C:\\Program Files\\JetBrains\\PyCharm '
 '2018.2.3\\helpers\\pycharm_matplotlib_backend']

Server time: Sat, 15 Sep 2018 11:36:06 +
I have looked around and the documentation I have found is referencing 
Django 1 {1.7 … 1.10}

this mentions adding another argument after template name 
post_reset_redirect however this seems to be causing more problems

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b572d959-1ea0-4f81-97da-033a9e37fc1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.