different behaviour of datetime.datetime object before vs after save

2015-09-23 Thread Alex Kleider
I'm baffled by the fact that the __str__ method of an instance fails before the instance is saved but works fine afterwards. The relevant snippet from my models.py file: class Journal(models.Model): date = models.DateTimeField(default=timezone.now) user = models.CharField(max_length=24)

Re: custom setting provided by myapp

2015-09-23 Thread Gergely Polonkai
Hello, Most apps I know don't do such things. They write everything needed for them to work in their docs, and if something is not set, they either work with a sane default, or raise ImproperlyConfigured. I do the same myself. Also, Python does this in general; it assumes you read the manual befo

[ANNOUNCE] Django 1.9 alpha 1 released

2015-09-23 Thread Tim Graham
We've made the first release on the way to Django's next major release, Django 1.9! 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.djangoproject.com/weblog/2

Re: Django admin suitable for external users?

2015-09-23 Thread Luis Zárate
Sure, you could have several admin site with the same models. I read an specific page about how to do that, but right now can remember what is the specific url. Those other links could help you. https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#the-register-decorator http://blog.tryolabs.

Re: Problem with date validator

2015-09-23 Thread Simon Charette
Hi Felix, The way you create your validator instance it is passed the value returned by `date.today()` at module initialization time. That is when the Python process starts. It means that if you started your development server or say a gunicorn process on your server yesterday the max value the v

Re: Django admin suitable for external users?

2015-09-23 Thread Joshua Pokotilow
That's an interesting idea. Thanks. I suppose it's possible to register models with two different admin sites, although I've never tried doing that myself. On Wednesday, September 23, 2015 at 5:21:04 PM UTC-4, luisza14 wrote: > > I suggest you to create a custom admin site for your external user

Re: Django admin suitable for external users?

2015-09-23 Thread Joshua Pokotilow
> > How technical are your users? Not very technical, necessarily. They're normal end-users. What are your security constraints? We're in the medical industry, so security is a key consideration for us in general. I think the main concerns about Django admin specifically were that it encompas

Re: Django admin suitable for external users?

2015-09-23 Thread Luis Zárate
I suggest you to create a custom admin site for your external user where you expose only the models that interact with the external user and create a middleware for forbidden access to the other admin site. 2015-09-23 14:49 GMT-06:00 Bill Freeman : > How technical are your users? > What are your

Re: custom setting provided by myapp

2015-09-23 Thread Bill Freeman
If you have a system based on Django (some CMS for example), rather than an app for folks to add to a site that has a lot of unrelated stuff, then sure, generate one, but don't replace one that may have hours of customization work into it. Let the site owner/tech do the merging. If there are no s

Re: custom setting provided by myapp

2015-09-23 Thread Luis Zárate
Hi, Sure, but why not auto-generate the setting file?, for example I know various CMS than have an installer that provide a custom setting with auto-generate configuration file (I don't know how to do that). Other idea is that my app can add configuration if is not set explicitly, so the user hav

Problem with date validator

2015-09-23 Thread felix
When today's date is entered in the form it shows a form error saying that this date (today) is in the future. What is wrong with the validator I'm using to allow dates until today? models.py ... import datetime ... class SolicitudBase(models.Model): fecha = models.DateField(

Re: Django admin suitable for external users?

2015-09-23 Thread Bill Freeman
How technical are your users? What are your security constraints? How much work can you do to make it "pretty"? (Believe me, someone will ask.) Are there fields that you want to administer internally but don't want to expose to the users? Will your users object if you decide to move to a newer Dja

Django admin suitable for external users?

2015-09-23 Thread Joshua Pokotilow
Hello! I just had a fairly lengthy conversation with my colleagues about whether or not Django admin is well-suited to external users outside our company. I took the position that for certain use-cases, exposing Django admin to third parties makes a lot of sense, given that the admin applicatio

Re: Reverse for 'post_detail' with arguments '()' and keyword arguments '{'pk': 1}' not found. 1 pattern(s) tried:

2015-09-23 Thread Luis Zárate
As Remco said your problem are with your pattern because starts with $ or have ^*$* [projectname]/ ├── [projectname]/ │ ├── __init__.py │ ├── settings.py │ ├── urls.py <-- The error is here │ └── wsgi.py └── manage.py └── blog/ └── __init__.py └── models.py └──

Re: Reverse for 'post_detail' with arguments '()' and keyword arguments '{'pk': 1}' not found. 1 pattern(s) tried:

2015-09-23 Thread sankar vasu
Dear Luis, As you said, i tried but can't success. Thanks in advance Sankar B On Wed, Sep 23, 2015 at 12:29 AM, Luis Zárate wrote: > > 2015-09-22 12:48 GMT-06:00 sankar vasu : > >> {{ post.title >> }} > > > try: > > {{ post.title }} > > If not found then check your project url.py , do you have

Re: custom setting provided by myapp

2015-09-23 Thread Bill Freeman
I would be upset to find an app that I installed fiddling with my project settings. On Wed, Sep 23, 2015 at 12:53 PM, Luis Zárate wrote: > Hi, > > l have an app than need other apps to run well, I create a requirements > file and setup file and insert the required apps in my settings, also > inc

custom setting provided by myapp

2015-09-23 Thread Luis Zárate
Hi, l have an app than need other apps to run well, I create a requirements file and setup file and insert the required apps in my settings, also include my custom configurations. I want to build the settings file automatically (with installer script) or when the user put my app in his installed_

Re: Django 1.8 - It translates or it falls back when it should'nt...

2015-09-23 Thread Luis Zárate
I had the same problem with 1.8, l solved editing with external program called poedit. I don't know why django build wrong po file, but when compile the translation is not complete. El miércoles, 23 de septiembre de 2015, PyMan escribió: > Oh shame on me! I had this problem may years ago.here

Re: Django 1.8 - It translates or it falls back when it should'nt...

2015-09-23 Thread PyMan
Oh shame on me! I had this problem may years ago.here I go with the ugettext_lazy http://stackoverflow.com/questions/2694798/django-form-and-i18n/2694847#2694847 Il giorno mercoledì 23 settembre 2015 14:23:38 UTC+2, PyMan ha scritto: > > Hi, > I'm using django 1.8.4 with these settings

Django 1.8 - It translates or it falls back when it should'nt...

2015-09-23 Thread PyMan
Hi, I'm using django 1.8.4 with these settings LANGUAGE_CODE = 'en' ugettext = lambda s: s LANGUAGES = ( ('it', ugettext('LANG_ITALIANO')), ('en', ugettext('LANG_INGLESE')), ) LOCALE_PATHS = ( 'C:/path1/locale', 'C:/path2/locale', ) In b

Re: Debugging Django using Pycharm

2015-09-23 Thread varun naganathan
Here's an article that might help: https://www.jetbrains.com/pycharm/help/run-debug-configuration-django-test.html Also PDB,the python debugger does a very good job of debuuging your Django App. In case you've never used pdb,this should get you started: https://gimmebar-assets.s3.amazonaws.com/4fe

ANN: eGenix mxODBC Connect 2.1.4 - Remote Python Database Interface

2015-09-23 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Connect Remote Python Database Interface Version 2.1.4 mxODBC Connect is our commercially supported client-server product

Re: Django oauth2 extend auth.user result in errors

2015-09-23 Thread Shekar Tippur
I have tried to follow https://docs.djangoproject.com/en/1.8/topics/auth/customizing/#a-full-example and i get an error: django.contrib.admin.sites.AlreadyRegistered: The model CustomUser is already registered -- You received this message because you are subscribed to the Google Groups "Dja

Django oauth2 extend auth.user result in errors

2015-09-23 Thread Shekar Tippur
I am sorry if this is a duplicate. I did post the same on Django REST Framework. I was not sure where I should post this. I am trying to add some custom fields to oauth2. I am using python 3.4 and django 1.8. I am having varying errors. But with the combination I got below, the error I get is