Re: Django 2.0 released

2017-12-03 Thread Andréas Kühne
That's a terrible way to find out about a new release. Hope you didn't suffer too much! Regards, Andréas 2017-12-02 19:07 GMT+01:00 Adler Neves : > I guess I noticed it updated the worst way possible: > >- A commit has been pushed >- Continuous Integration tests passes >- CI sends "

Problems with translating URL patterns.

2017-12-03 Thread Juan José Meneses
Hello, I'm having problems with translating URL patterns. If I set a URL patter to be, for example, url(_(r'^admin/'), admin.site.urls) where _() is ugettext_lazy and access a no defined URL, lets say /404/, Instead of getting a 404 error I'm getting a 500 internal error. It looks from the lo

Re: Problems with translating URL patterns.

2017-12-03 Thread chotak lee
Can you help me? 2017-12-04 3:48 GMT+08:00 Juan José Meneses : > Hello, I'm having problems with translating URL patterns. If I set a URL > patter to be, for example, > url(_(r'^admin/'), admin.site.urls) > > where > _() > > is ugettext_lazy and access a no defined URL, lets say /404/, Instead of

Re: Django 2.0 released

2017-12-03 Thread Simon Charette
> My mistake? My "requirements.txt" file did not mention package versions. You should definitely make sure to lock/freeze your requirements to prevent your application's behavior from changing under your feet. Best, Simon Le samedi 2 décembre 2017 15:02:55 UTC-5, Adler Neves a écrit : > > I gues

Re: Django 2.0 released

2017-12-03 Thread Jorge Gimeno
If you use pipenv, it will do that for you. -Jorge On Dec 3, 2017 3:05 PM, "Simon Charette" wrote: > > My mistake? My "requirements.txt" file did not mention package versions. > > You should definitely make sure to lock/freeze your requirements to prevent > your application's behavior from chan

Need Help with Field Validation

2017-12-03 Thread Mark Phillips
I have a model called Document that has a FileField for uploading files. class Document(models.Model): document_id = models.AutoField(primary_key=True) title = models.CharField('title', max_length=200) description = models.TextField('description') storage_file_name = models.FileFie

Re: Login form error not showing up for wrong username/password combo

2017-12-03 Thread Tom Tanner
That did it. On Saturday, December 2, 2017 at 10:59:58 PM UTC-5, Constantine Covtushenko wrote: > > Hi Tom, > > It seems like your are trying to show error that relates to form rather to > particular field. > I see '__all__' key in example from console. > > And you did not create any html tag to

How do I customize form error messages?

2017-12-03 Thread Tom Tanner
In my login form, I have this code: {% if login_form.non_field_errors %} {{ login_form.non_field_errors.as_text|cut:"* "|escape }} {% endif %} If a user enters the wrong username/password combo, the error reads like this: 'Please enter a correct username and password. Note that both fields

Re: How do I customize form error messages?

2017-12-03 Thread Tom Tanner
Nevermind, I figured out I needed to edit `forms.py`. My custom login class... class LoginForm(AuthenticationForm): error_messages= { "invalid_login": _("Incorrect %(username)s/password combo") } # more code here... } On Sunday, December 3, 2017 at 9:46:09 PM UTC-5, Tom Tanner wrote: > > I

How do I customize the "username already exists" message?

2017-12-03 Thread Tom Tanner
My `forms.py` has a custom user-creation class... class RegisterForm(UserCreationForm): error_messages= { "password_mismatch": _("Passwords do not match."), } Which error message do I need to replace for when the user chooses a username that already exists? -- You received this message beca