Re: Migrate a many-to-many field to an explicit intermediate ("through") model?

2015-07-23 Thread Carl Meyer
Hi Carsten, On Thursday, July 16, 2015 at 12:44:55 PM UTC-6, Carsten Fuchs wrote: > > Am 2015-07-16 um 18:15 schrieb Gergely Polonkai: > > 1) create the "through" model, add it to the migration file > > 2) migrate all m2m instances (e.g. iterate over all Bereich objects then > > iterate through

Re: Why is Admin login template at admin/login.html instead of registration/login.html?

2015-07-23 Thread Carl Meyer
On 07/23/2015 10:49 AM, Tim Graham wrote: > The admin login only allows staff users to login so it makes sense to me > that if you wanted to add regular user login to your site, it should > have separate URLs. > > As for the template issue, it seems to me the > admin/template/registration template

Re: Why is Admin login template at admin/login.html instead of registration/login.html?

2015-07-23 Thread Carl Meyer
Hi Carsten, On 07/23/2015 11:41 AM, Carsten Fuchs wrote: > Am 23.07.2015 um 18:49 schrieb Tim Graham: >> The admin login only allows staff users to login so it makes sense to >> me that if you >> wanted to add regular user login to your site, it should have separate >> URLs. > > I think what conf

Re: Allow users to submit django form once per day

2015-07-23 Thread Carl Meyer
On 07/23/2015 01:32 PM, Nkansah Rexford wrote: > You can save the datetime of the last form submission and check > whether its oneday or not in the view. If its one day then show pass > the form or else dont. > > Hope this helps. > > > I do know I have to save the date stamp, but

Re: Migrate a many-to-many field to an explicit intermediate ("through") model?

2015-07-23 Thread Carl Meyer
Hi Gergely, On 07/23/2015 02:27 PM, Gergely Polonkai wrote: > Yes, you are right, my attempt is not the solution to your problem; it > seems that this m2m field really cannot be modified like this. With some > slight modifications, though, it may be. > > 1) create the through table > 2) migrate d

Re: Database inserts with autocommit set to off.

2015-07-27 Thread Carl Meyer
Hi Maciej, On 07/27/2015 07:03 AM, Maciej Gol wrote: > I've been recently working (porting to Django 1.8) on a project where we > need to use a few transactions in a single request, and these > transactions cannot be correctly handled by the `atomic` decorator due > to functions calls nesting. Bas

Re: "RuntimeError: Error creating new content types."

2015-07-27 Thread Carl Meyer
On 07/26/2015 10:46 AM, Tobias McNulty wrote: > I just ran into this issue as well when updating an old project to > Django 1.8. The only suitable workaround I found was to update first to > Django 1.7 and fake the initial migrations for my apps (presumably > Django's as well, though it seems to ha

Re: Static Media Server (Tango with Django)

2014-10-13 Thread Carl Meyer
Hi Max, On 10/13/2014 01:39 AM, Max Nathaniel Ho wrote: > Hi all, > > I am going through this tutorial on Tango with Django > - http://www.tangowithdjango.com/book/chapters/templates_static.html > > I extracted the specific part of the tutorial as seen in *BOLD*. > > > *4.4. The Static Med

Re: Upgrade to Django 1.7 - AppRegistryNotReady exception

2014-10-13 Thread Carl Meyer
Hi Luca, To be clear, the call to ``django.setup()`` should be in the ``get_wsgi_application()`` function in the file ``django/core/wsgi.py``, which is part of Django, and you should not need to comment that out. It should not be necessary to have a call to ``django.setup()`` in your project's ws

Re: Naive datetime / time zone warning

2014-10-13 Thread Carl Meyer
Hi Daniel, On 10/13/2014 12:04 PM, Daniel Grace wrote: > Here is my model: > > class Flow(models.Model): > state = models.ForeignKey(State) > created = models.DateTimeField(default=datetime.now) > modified = models.DateTimeField(db_index=True, default=datetime.now) > def __str__(self): > return s

Re: How to "automatically " populate "last_updated_by" DB columns with the current user's id

2014-10-14 Thread Carl Meyer
On 10/14/2014 09:46 AM, Collin Anderson wrote: > If you _really_ want it to be automatic, I think your best bet is to use > a middleware to store the user or request object in a "thread local" > variable, and then have a pre_save signal set the last_updated_by field > based on that. That method is

Re: An elegant and simple way to fire a signal after a Save is complete (completely complete :) )

2014-10-14 Thread Carl Meyer
Hi Spiros, On 10/14/2014 10:05 AM, Spiros Mouzakitis wrote: > I have a model (model Employee) and i want to each time that it is > created / saved to run a specific code block. > My specific code requires that the model is already saved in the > database (i call an external API) > I can't use post

Re: An elegant and simple way to fire a signal after a Save is complete (completely complete :) )

2014-10-14 Thread Carl Meyer
On 10/14/2014 01:58 PM, Spiros Mouzakitis wrote: > What i finally did was to create a post_save signal as usual, and then > in my receiver function i execute the "specific code block" in a thread > (as mentioned > here: > http://stackoverflow.com/questions/11899088/is-django-post-save-signal-async

Re: Need something like the removed Q.add_to_query method

2014-10-16 Thread Carl Meyer
Hi Marc, On 10/16/2014 09:16 AM, m...@tubeards.com wrote: > I have a complex filter system for selecting data. Short said: I need a > possibility in the Django ORM to create a query like this: > > | > SELECT *FROM table > INNER JOIN attributes > WHERE (attributes.id IN ( > SELECT id FROM attr

Re: How to "automatically " populate "last_updated_by" DB columns with the current user's id

2014-10-16 Thread Carl Meyer
Hi Ken, On 10/15/2014 05:58 PM, Ken Winter wrote: > Is this a reasonable summary of what you have said so far?: > > 1. You've suggested two solutions, which I'll call "middleware" (from > Collin) and "save() argument" (from Carl and Tom). > 2. A limitation of both is that they aren't what I

Re: how to use __init__ in a form (passing an extra variable to the form)

2014-10-16 Thread Carl Meyer
Hi dk, On 10/16/2014 12:36 AM, dk wrote: > I have a form,andI want to put the email andthengetsome ratio buttons > withthe information of dishes froma restaurant. > I want to passthe restaurant id to the form,andlet the form init getall > the information andspit outthe form forrendering inthe httm

Re: How to display BST (British Summer Time)?

2014-10-17 Thread Carl Meyer
Hi Daniel, On 10/17/2014 09:14 AM, Daniel Grace wrote: > I have the time zone set as follows: > TIME_ZONE='Europe/London' > USE_TZ = True > > This is the same as GMT. But what I want is BST (British Summer Time) > for display purposes, which is UTC + 1 for the "summer" and UTC for the > rest of

Re: how to use __init__ in a form (passing an extra variable to the form)

2014-10-17 Thread Carl Meyer
On 10/17/2014 01:36 AM, dk wrote: > took me a little bit to get the self.fields, since I was trying to > override directly as ratiooo.choices. Yeah, metaclasses are confusing :-) > and I move the django.setup() to the top of the file after the imports > (meantime). not sure what it does, I kno

Re: How to deny access to a logged user directly to a specific URL

2014-10-17 Thread Carl Meyer
Hello Martin, On 10/17/2014 11:08 AM, Martin Torre Castro wrote: > at my project we need some sort of system for allowing/denying some > access to an URL. > > The example, we want to make some kind of wizard. > > 1. The user inputs the first object at the the first screen (A screen), > and

Re: How to "automatically " populate "last_updated_by" DB columns with the current user's id

2014-10-17 Thread Carl Meyer
Hi Ken, On 10/17/2014 01:09 PM, Ken Winter wrote: > On Thursday, October 16, 2014 12:13:20 PM UTC-4, Carl Meyer wrote: > > I don't see any way this is feasible, if you want it to cover raw SQL > executed through ``cursor.execute``. Are you planning to parse the SQL &g

Re: How to "automatically " populate "last_updated_by" DB columns with the current user's id

2014-10-17 Thread Carl Meyer
Hi Ken, On 10/17/2014 05:16 PM, Ken Winter wrote: > Ken: My idea for doing this goes something like: > > 1. For every session, let's say that the Django app's database > connection is with a user I'll call "myapp" here. User "myapp" has > the CREATEUSER privilege. > 2. Someone requests

Re: How to "automatically " populate "last_updated_by" DB columns with the current user's id

2014-10-20 Thread Carl Meyer
Hi Ken, On 10/18/2014 12:55 PM, Ken Winter wrote: > OK, I've written and unit-tested the database components - see > https://drive.google.com/file/d/0B-thboqjuKZTSjRHTXhqMlo3RlU/view?usp=sharing. > > Now I could use a little advice on the Django part. > > I believe that all that is needed is to

Re: Customize admin page title (from tutorial)

2014-10-20 Thread Carl Meyer
Hi Pat, On 10/18/2014 03:47 PM, Pat Claffey wrote: > Hi, > yes this is possible. I have recently done this tutorial and succeeded > in customizing the title. > In my opinion the instructions in this part of the tutorial are hard to > understand. Here is what I did: > > 1.0 Navigate to the proj

Re: migrate does not store default values in the database

2014-10-24 Thread Carl Meyer
Hi Peter, On 10/24/2014 05:26 PM, Peter Coles wrote: > Should I copy this question over to "django-dev" (do they accept posts > from non-internal devs)? I've seen people complain in the past about > reopening or commenting on closed tickets. Django core dev here. Yes, the django-developers mailin

Re: migrate does not store default values in the database

2014-10-24 Thread Carl Meyer
On 10/24/2014 05:32 PM, Carl Meyer wrote: > Hi Peter, > > On 10/24/2014 05:26 PM, Peter Coles wrote: >> Should I copy this question over to "django-dev" (do they accept posts >> from non-internal devs)? I've seen people complain in the past about >>

Re: New way to use URL dispatchers?

2014-10-25 Thread Carl Meyer
> On Oct 24, 2014, at 8:37 PM, Russell Keith-Magee > wrote: > > When it is released, Django 1.8 will include support for the new preferred > format for URLpatterns. Django 1.7 doesn't support this new format, and the > documentation for version 1.7: > > https://docs.djangoproject.com/en/1.7/

Re: migrate and runserver commands hang, there is no traceback, no clue yet why (1.7.1)

2014-10-25 Thread Carl Meyer
Hi JJ, One thing that can cause hangs when running migrations is having another process (say a ‘manage.py shell’) with a connection to the same database sitting open, possibly with a transaction in progress that is holding locks on the tables the migrations need to touch. Any possibility that’s

Re: AUTH_USER_MODEL does not accept sub application

2014-10-27 Thread Carl Meyer
Hi Frankline, On 10/27/2014 12:38 AM, Frankline wrote: > I am having problems with my custom user model while using Django 1.7.1 > and Python 3.4. > I have declared a Custom user model in an apps.users.AuthUser. I then > have another application (apps.pets) that will use the AuthUser as a > Foreig

Re: AUTH_USER_MODEL does not accept sub application

2014-10-27 Thread Carl Meyer
On 10/27/2014 10:01 AM, Scot Hacker wrote: > > > On Monday, October 27, 2014 8:58:36 AM UTC-7, Scot Hacker wrote: > > > add2virtualenv /path/to/custom/apps/directory > > > > And when its time to deploy, you'll need to do similar on the server, > using an equivalent method in the wsgi def

Re: What is the purpose of the include function?

2014-10-29 Thread Carl Meyer
Hi Ben & Daniel, On 10/29/2014 07:41 AM, Ben Lopatin wrote: > Hi Daniel, in this case I would think the latter would fail - the > `include` function loads a URL conf module and then finds the > `urlpatterns` attribute, whereas `admin.site.urls` is a class method > that dynamically builds a list of

Re: DB foreign key constraints : Django 1.7 regression ?

2014-10-29 Thread Carl Meyer
Hi NotSqrt, On 10/29/2014 11:53 AM, nots...@gmail.com wrote: > Just tested the following: > > * create clean DB > * run syncdb > * compare obtained tables when using Django 1.6.8 and Django 1.7.1 > > My findings : > > In Django 1.7, some fields with models.ForeignKey no longer get the DB

Re: DB foreign key constraints : Django 1.7 regression ?

2014-10-30 Thread Carl Meyer
On 10/30/2014 06:09 AM, nots...@gmail.com wrote: > Thanks Daniel, that was it (instead of removing the migrations folder, I > now use makemigrations). > > I expected everything to work without the need of migrations. > So I guess that with django 1.7, it is simply mandatory to use migrations. > >

Re: Primary keys vs. natural keys

2014-10-31 Thread Carl Meyer
Hi Torsten, > On Oct 31, 2014, at 3:13 AM, Torsten Bronger > wrote: > Do I understand it correctly that in the Django community, it is > preferred to use surrogate primary keys (the auto ID field) instead > of explicitly setting primary keys? Yes, I'd say this is true. > Currently, I add nat

Re: Primary keys vs. natural keys

2014-10-31 Thread Carl Meyer
> On Oct 31, 2014, at 4:19 AM, Torsten Bronger > wrote: > Carl Meyer writes: >> [...] >> >> There is no built in feature for this, but it doesn't seem like a >> hard problem to solve with your own conventions. For instance, >> rather than hardcod

Re: Primary keys vs. natural keys

2014-10-31 Thread Carl Meyer
> On Oct 31, 2014, at 3:26 PM, Torsten Bronger > wrote: > > Hallöchen! > > Carl Meyer writes: > >>> On Oct 31, 2014, at 4:19 AM, Torsten Bronger >>> wrote: >>> >>> [...] >>> >>> Do you mean this: >>>

Re: Warning with 'cycle'

2014-11-01 Thread Carl Meyer
On 11/01/2014 01:36 PM, Neto wrote: > Hi, im using template tag 'cycle' (in Django version 1.7.1,) and is > showing it in my terminal: > > RemovedInDjango18Warning: 'The `cycle` template tag is changing to > escape its arguments; the non-autoescaping version is deprecated. > Load it fr

Re: A migration in one app that adds a field to another

2014-11-01 Thread Carl Meyer
Hi jMyles, On 11/01/2014 04:35 PM, jMyles Holmes wrote: > Using Django 1.7, how can the user perform a migration operation (say, > AddField) on an app other than the app in which the migration lives? > > Here's the use case: > > Mezzanine lets you inject fields on its own stock models using the

Re: How to handle exceptions in RequestContext?

2014-11-03 Thread Carl Meyer
Hi Daniel, On 11/03/2014 11:53 AM, Daniel Grace wrote: > Say I have the following code: > > try: > context_dict = {} > context = RequestContext(request) > ... > except Exception as e: > return render_to_response('error.html', context_dict, context) > > ...then how do I handle the

Re: A migration in one app that adds a field to another

2014-11-04 Thread Carl Meyer
Hi Justin, On 11/04/2014 04:17 PM, Justin Myles Holmes wrote: > Hey Carl. Missed you so very much at DjangoCon. :-) Thanks :-) >> I'm not sure why the mezzanine docs don't mention using the > SOUTH_MIGRATION_MODULES setting (or Django 1.7 equivalent > MIGRATION_MODULES) to override the locatio

Re: A migration in one app that adds a field to another

2014-11-04 Thread Carl Meyer
Hi Justin, On 11/04/2014 04:42 PM, Justin Myles Holmes wrote: >> I don't understand this use case. A ForeignKey impacts only one database > table's schema; the table for the model on which the ForeignKey field is > located. The schema of the model the ForeignKey points to doesn't need > to change

Re: How to handle exceptions in RequestContext?

2014-11-05 Thread Carl Meyer
Hi Daniel, On 11/05/2014 08:44 AM, Daniel Grace wrote: > I see where you are coming from Carl, thanks for the information. Do > you have a suitable example of where one might put error handling in the > view code? Usually I try to keep view code as short and simple as possible (because it is the

Re: Using ContentType to link two different objects together

2014-11-05 Thread Carl Meyer
Hi, On 11/05/2014 11:09 AM, Some Developer wrote: > I'm trying to write my own implementation of the Django comments > framework for various reasons and am wondering how one would link > comments to a particular object (model) of another type. For instance I > could have a ForeignKey in the Commen

Re: Using ContentType to link two different objects together

2014-11-05 Thread Carl Meyer
On 11/05/2014 11:35 AM, Some Developer wrote: > On 05/11/2014 18:16, Carl Meyer wrote: >> On 11/05/2014 11:09 AM, Some Developer wrote: >>> I'm trying to write my own implementation of the Django comments >>> framework for various reasons and am wondering how

Re: ModelMultipleChoiceField forcing required

2014-11-05 Thread Carl Meyer
Hi Scot, On 11/05/2014 12:11 PM, Scot Hacker wrote: > I'm having a strange issue with a pair of ManyToManyFields, where > they're acting like they're required fields in the admin even though > they're not. > > > # In models.py > | > instructors =models.ManyToManyField(Instructor,blank=True)

Re: how to test an application that's using a legacy database

2014-11-10 Thread Carl Meyer
Hi David, On 11/10/2014 08:14 AM, dpalao.pyt...@gmail.com wrote: > Probably I was not clear in my original post. My problem is precisely > how to switch managed to True just before the tests and put it back to > False afterwards to avoid creating of tables by hand during the tests. > That is preci

Re: Where does django store auth migrations?

2014-11-10 Thread Carl Meyer
Hi Ed, On 11/10/2014 03:43 AM, Dr Ed wrote: > I don't really think it's the Custom model that's at fault here - this > migration was created months ago. The point is that auth migrations are > stored in, to my mind, the wrong place > (in > /Users//.virtualenvs//lib/python2.7/site-packages

Re: how to test an application that's using a legacy database

2014-11-11 Thread Carl Meyer
Hi David, On 11/11/2014 07:01 AM, dpalao.pyt...@gmail.com wrote: > I see your point. You might be right, but it is not clear to me how to > do it and if it would work: I have already tried to subclass > DiscoverRunner to modify its behaviour with little success. If there are specific aspects of "

Re: how to test an application that's using a legacy database

2014-11-11 Thread Carl Meyer
Hi David, On 11/11/2014 08:37 AM, dpalao.pyt...@gmail.com wrote: > Dear Carl, > > Thank you for the answer. > > On Tuesday, November 11, 2014 3:13:18 PM UTC+1, Carl Meyer wrote: > > Hi David, > > On 11/11/2014 07:01 AM, dpalao...@gmail.com wrote: >

Re: moving existing django projects

2014-11-12 Thread Carl Meyer
Hi Malik, On 11/12/2014 08:27 PM, Malik Rumi wrote: > Q: This is a ‘help me understand how this works / what it does’ question > rather than a ‘help me I’m stuck’ question. I have an existing Django > project I wanted to get on Heroku. I created a new site on Heroku, > uploaded my project, and ran

Re: Modifying a ModelAdmin instance at runtime

2014-11-12 Thread Carl Meyer
Hi Peter, On 11/12/2014 10:59 PM, Peter Sagerson wrote: > I agree that setting self.exclude will set the instance attribute, > thus hiding the class attribute of the same name. However, it appears > that a given AdminSite instantiates each registered ModelAdmin once > at registration time.[1] The

Re: live server tests

2014-11-15 Thread Carl Meyer
Hi Larry, On 11/14/2014 08:44 PM, Larry Martell wrote: > On Fri, Nov 14, 2014 at 1:41 PM, Larry Martell > wrote: >> I have a suite of selenium live server tests that have been running >> fine (django 1.6, python 2.7, centos 6.5). The host they were running >> on died and I moved them to a new ho

Re: moving existing django projects

2014-11-17 Thread Carl Meyer
Hi Malik, On 11/15/2014 08:52 PM, Malik Rumi wrote: > << What WSGI server are you using in the > Heroku deployment? Can you point to the instructions you followed to > deploy your project on Heroku?>> > > Simple questions with not so simple answers. I started with a Django > getting started tutor

Re: Extending, inheriting User Model or custom User Model?

2014-11-18 Thread Carl Meyer
Hi Tobias & Daniel, On 11/18/2014 09:10 AM, Daniel Roseman wrote: > On Tuesday, 18 November 2014 15:04:19 UTC, Tobias Dacoir wrote: > > I'm trying to figure out how to create my Custom User Model. > > In the official docs I basically found two different strategies: > Extending User M

Re: moving existing django projects

2014-11-18 Thread Carl Meyer
Hi Malik, On 11/18/2014 02:32 PM, Malik Rumi wrote: [snip] > Here are my console logs: The console logs certainly suggest that the root of the problem is in what files you have in git, but there's not much clue why certain files or directories might be disappearing. Carl signature.asc Descrip

Re: Extending, inheriting User Model or custom User Model?

2014-11-18 Thread Carl Meyer
Hi Tobias, On 11/18/2014 11:44 AM, Tobias Dacoir wrote: > Dear Daniel and Carl, > > thanks for your advice. However I'm a bit confused now. So in general > you recommend that I follow the guide for substituting my own custom > model but at the same time Carl is warning me that overwriting > AUTH_

Re: What on earth is causing this "naive datetime" warning?

2014-11-19 Thread Carl Meyer
Hi Daniel, On 11/19/2014 08:07 AM, Daniel Grace wrote: > I have already installed pytz (2014.17) and I have set USE_TZ=True. I > don't use any naive datetimes in my application. This error is caused > by something that the Django test command is doing automatically, if you > look at the tracebac

Re: Warning / Error when testing with W flag

2014-11-19 Thread Carl Meyer
Hi Daniel, On 11/18/2014 02:01 AM, Daniel Grace wrote: > Hi, > I get another warning / error with a test command as follows: >>python -W error manage.py test flow > Traceback (most recent call last): > File "manage.py", line 8, in > from django.core.management import execute_from_command_li

Re: What on earth is causing this "naive datetime" warning?

2014-11-19 Thread Carl Meyer
Hi Daniel, On 11/19/2014 08:58 AM, Daniel Grace wrote: > On Wednesday, 19 November 2014 15:11:27 UTC, Carl Meyer wrote: > On 11/19/2014 08:07 AM, Daniel Grace wrote: > > I have already installed pytz (2014.17) and I have set > USE_TZ=True. I > > don't

Re: ImportError: cannot import name 'GEOSException'

2014-11-19 Thread Carl Meyer
Hello, On 11/18/2014 09:53 AM, jogaserbia wrote: > I just realized something. > > > This are all the files in django.contrib.gis.geos: > > Notice there is no GEOSException, nor is there GEOSGeometry. There is > however geometry.py (which as the class GEOSGeometry in it) and error.py >

Re: ImportError: cannot import name 'GEOSException'

2014-11-19 Thread Carl Meyer
Hi Ivan, On 11/19/2014 02:58 PM, jogaserbia wrote: > Hi Carl, > > Thanks very much for the response. > > I am trying to get GeoDjango up and running (for a couple of days now) > and am having a really hard time. Sorry about that :/ I know the dependencies for GeoDjango can be hard to set up

Re: Is it wrong to disable a lot of the core django features?

2014-11-21 Thread Carl Meyer
Hi John, I'll start with answering the question in your subject: no. There's nothing at all wrong with using the parts of Django that are useful to you, and not using the ones that aren't. In particular, auth and admin are part of "contrib"; that is, useful applications built on top of Django and

Re: Is it wrong to disable a lot of the core django features?

2014-11-21 Thread Carl Meyer
Hi John, On 11/21/2014 02:33 PM, John Rodkey wrote: > Thank you for the quick answer. Using your recommendation, can we simply > disable the admin, groups and permissions, but still use the Authentication > (login/sessions)? The admin is already separate from auth, so that's easy to turn off

Re: How to deal with CSRF middleware from a crawler

2014-11-24 Thread Carl Meyer
Hi Torsten, On 11/24/2014 01:00 PM, Torsten Bronger wrote: > We use crawlers, which in our case a Python scripts that read data > from disk and send a lot of HTTP POST requests to the Django > deployment. The POST requests hit the same URLs/Views that are also > used by the browser to edit someth

Re: How do I supply an appropriate application.wsgi to Gunicorn?

2014-11-24 Thread Carl Meyer
Hi, On 11/24/2014 02:19 PM, Christos Jonathan Seth Hayward wrote: > From > http://stackoverflow.com/questions/27113466/how-can-i-deploy-django-gunicorn-under-apache-proxy > : > > 've run through the documentation and am hitting the same pages over and > over again. At present I've found documenta

Re: How do I supply an appropriate application.wsgi to Gunicorn?

2014-11-24 Thread Carl Meyer
On 11/24/2014 02:38 PM, Christos Jonathan Seth Hayward wrote: > Ok; wonder if I should upgrade Django. > > I just ran a startproject earlier today (I can re-create it; I was just > trying to get it running and see the start page in my browser before going > further). > > cjsh@ps306627:~/cynthia

Re: How do I supply an appropriate application.wsgi to Gunicorn?

2014-11-24 Thread Carl Meyer
On 11/24/2014 02:56 PM, Christos Jonathan Seth Hayward wrote: > Thanks so much! > > Could you confirm the invocation? > > cjsh@ps306627:~/cynthia$ gunicorn cynthia.wsgi 0.0.0.0: > > usage: gunicorn [OPTIONS] [APP_MODULE] > > gunicorn: error: No application module specified. That's the righ

Re: How do I supply an appropriate application.wsgi to Gunicorn?

2014-11-24 Thread Carl Meyer
On 11/24/2014 03:00 PM, Carl Meyer wrote: > On 11/24/2014 02:56 PM, Christos Jonathan Seth Hayward wrote: >> Thanks so much! >> >> Could you confirm the invocation? >> >> cjsh@ps306627:~/cynthia$ gunicorn cynthia.wsgi 0.0.0.0: >> >> usage: gunicorn

Re: Any interest in a multi email field in django?

2014-12-01 Thread Carl Meyer
Hi JJ, On 12/01/2014 05:58 PM, JJ Zolper wrote: > I'm just curious if anyone around the community has an interest in > discussing the possibility of adding a "MultiEmailField" to Django? > > Here is what I found when roaming the internet: > > https://github.com/fle/django-multi-email-field > >

Re: Any interest in a multi email field in django?

2014-12-01 Thread Carl Meyer
Hi JJ, To make a form for users to add/remove emails with a linked model approach, you'll need an inline model formset: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#inline-formsets Carl On 12/01/2014 07:47 PM, JJ Zolper wrote: > Carl, > > I went ahead and tried your implementa

Re: Django 1.7 problem

2014-12-03 Thread Carl Meyer
Hi Andreas, On 12/03/2014 01:34 PM, Andreas Kuhne wrote: > I am trying to migrate our current website to django 1.7. > > Currently we are using a plugin called django-dbgettext to get parts of our > database translated (we are running in 10 different languages). The problem > is that django-dbget

Re: Postgresql Triggers and Django

2014-12-04 Thread Carl Meyer
Hi Philip, On 12/04/2014 02:28 PM, Philip Haynes wrote: > Hi, > I have tracked back through the messages in this group and examined the > documentation for version 1.7 of Django and I have a question. > > The 1.7 documentation > (https://docs.djangoproject.com/en/1.7/howto/initial-data/) > des

Re: Does ticket 19866 apply to Django 1.4

2014-12-05 Thread Carl Meyer
Hi Brian, On 12/04/2014 10:15 PM, yakkades...@gmail.com wrote: > > Does ticket 19866 apply to > Django 1.4? Reading through the notes, it seems it does but I'm still > getting a 500 error. If not, is there a way to keep Django from returning a > 50

Re: POSTing data to a django view from a stand alone script with CSRF

2014-12-05 Thread Carl Meyer
Hi Larry, On 12/05/2014 09:16 PM, Larry Martell wrote: > I have a django view that normally receives POSTed data from a web > page. That all works fine. But now we also want to call that view from > a python script. That is failing with a 403 because of a CSRF > mismatch. I can disable CSRF on my

Re: Testing reusable application: compatible way

2014-12-07 Thread Carl Meyer
Hi Matwey, On 12/07/2014 08:40 AM, Matwey V. Kornilov wrote: > I've followed this documentation: > https://docs.djangoproject.com/en/1.7/topics/testing/advanced/#using-the-django-test-runner-to-test-reusable-applications > and found that it works only for Django 1.7, whereas I would like to > have

Re: Testing reusable application: compatible way

2014-12-07 Thread Carl Meyer
On 12/07/2014 02:28 PM, Carl Meyer wrote: > On 12/07/2014 08:40 AM, Matwey V. Kornilov wrote: >> I've followed this documentation: >> https://docs.djangoproject.com/en/1.7/topics/testing/advanced/#using-the-django-test-runner-to-test-reusable-applications >> and found tha

Re: Testing reusable application: compatible way

2014-12-07 Thread Carl Meyer
On 12/07/2014 12:59 PM, Matwey V. Kornilov wrote: > The following code works perfect for me, why the code in the > documentations so sophisticated? > > def runtests(): > os.environ.setdefault("DJANGO_SETTINGS_MODULE", > "tests.test_settings") > > try: > from django

Re: POSTing data to a django view from a stand alone script with CSRF

2014-12-08 Thread Carl Meyer
Hi Larry, On 12/08/2014 07:14 AM, Larry Martell wrote: > On Sat, Dec 6, 2014 at 1:41 AM, James Schneider > wrote: >> Check out Collin's email from earlier, it has an example using curl but you >> should be able to adapt your web request with the cookie and POST values via >> the python script. T

Re: POSTing data to a django view from a stand alone script with CSRF

2014-12-08 Thread Carl Meyer
On 12/08/2014 09:51 AM, Larry Martell wrote: > Right, but anyone can write a script to bypass the CSRF protection. I > was surprised that it would be so easy to do that. I guess that's not > what CSRF was designed to protect against. Right. There's no such thing as a CSRF attack via script. The de

Re: Seeking for advise on usage MySQL together with MongoDB

2014-12-12 Thread Carl Meyer
On 12/12/2014 10:42 AM, Collin Anderson wrote: > Re: the hacker news thread, (sorry for getting a little off topic,) I just > wanted to mention a few places where we've tried to improve some of those > things recently: > - The ORM is still slow, but we've added prefetch_related() and improved >

Re: Any benefit in storing shorter strings or numbers to represent data for a choice char field?

2014-12-17 Thread Carl Meyer
Hi Radomir, On 12/17/2014 09:56 AM, Radomir Wojcik wrote: > The official django doc uses this as an example (see below). Is there any > point to storing 'FR' instead of 'Freshman" so the choice matches what is > stored? Is it faster at all? Saves room? What about for querying the data? > Then y

Re: Any benefit in storing shorter strings or numbers to represent data for a choice char field?

2014-12-17 Thread Carl Meyer
On 12/17/2014 11:23 AM, Radomir Wojcik wrote: > > Thanks for the insight, I'm on the same page as you. > > My only real concern is that I will have to use a function, such as this > one to get the human readable version of the stored data, then you need to > lookup the value from the dict. And i

Re: Any benefit in storing shorter strings or numbers to represent data for a choice char field?

2014-12-17 Thread Carl Meyer
On 12/17/2014 11:52 AM, Radomir Wojcik wrote: > > So to answer my own question, you wouldn't use the short version in the db if > you plan to do like/contains queries on them. Correct me if I'm wrong. True. I don't think I've ever seen a case where a field had choices and I also wanted to do li

Re: ANN: Django website redesign launched

2014-12-17 Thread Carl Meyer
Hi John, On 12/17/2014 03:40 PM, John Schmitt wrote: > Looks nice to me. > > Pardon me please for being naive, but will the fonts, colours, and layouts be > ported to the Django app itself? > > That is, will the new layout and colour scheme be available to my Django 1.7 > app if I were to do t

Re: Model form with optional fields issue

2014-12-19 Thread Carl Meyer
Hi Marcin, On 12/19/2014 11:44 AM, marcin.j.no...@gmail.com wrote: > Hello! > > I have model form defined with all optional fields (required=False). > I want use this form to update only provided fields leaving others > unchanged. > But Django replaces optional fields to empty values and removes

Re: Django formset security and injecting PKs in formset hidden id fields

2016-05-06 Thread Carl Meyer
Hi Rob, On 05/03/2016 12:23 PM, Rob Ladd wrote: > I've noticed something troubling in Django formsets: > > Each formset.form has a hidden field with the id of the model being edited. > > All one would need to do is change this id and submit, and the default > formset |clean()| or |save()| metho

Re: Django formset hidden id field

2016-05-06 Thread Carl Meyer
Hi Rob, On 05/03/2016 12:13 PM, Rob Ladd wrote: > Carl Meyer said: > > "Whatever queryset you pass to the model formset limits the > available rows for editing. The end user can edit the PK to refer to any > item in that queryset, but not any item in the table. " >

Re: Possible bug with transaction.on_commit

2016-05-16 Thread Carl Meyer
Hi Bart, On 05/16/2016 02:10 PM, barthel...@infobart.com wrote: > I believe that I encountered a bug or at least a serious limitation with > transaction.on_commit in Django 1.9.x. Essentially, the on_commit hooks > seem to be tied to the database connection instead of the transaction. > This means

Re: Is a good practice to put app inside another?

2016-06-03 Thread Carl Meyer
On 06/03/2016 01:37 PM, Neto wrote: > My project has several apps, some of them depend on others, it is ok to > add for example 3 apps within another app? Yep, there's nothing wrong with this. An "app" is just a Python package; nesting Python packages to achieve a logical grouping/hierarchy is a p

Re: Extracting the username:password from the host

2016-09-12 Thread Carl Meyer
Hi Christophe, On 09/12/2016 03:35 PM, Christophe Pettus wrote: > I've encountered a service that does postbacks as part of its API. > The only authentication mechanism is putting the username and > password in the POST URL in the form: > > https://user:p...@example.com/api/endpoint > > Is there

Re: An almost reusable app, how to make it reusable?

2016-10-03 Thread Carl Meyer
Hi Victor, On 10/03/2016 01:06 PM, Victor Porton wrote: > I've created an app which is "almost" reusable: it depends on a variable > in /setting.py of our project . > > from .settings import TRANSACTION_ATTEMPT_COUNT > > Can it be made into an reusable app? Certainly. Change the import to `from

Re: Testing a reusable app which uses a database

2016-10-03 Thread Carl Meyer
On 10/03/2016 01:41 PM, Victor Porton wrote: > I try to make a reusable app which uses transaction.atomic(). > > When I run my test.py (below) for my reusable app, I get the below errors. > > Is it possible to test this reusable app outside of a Django project? It is not possible to test it with

Re: New-style middleware

2016-11-22 Thread Carl Meyer
Hi Torsten, I worked on the design and implementation of new-style middleware. On 11/22/2016 01:30 PM, Torsten Bronger wrote: > Hallöchen! > > Considering the following old-style middleware class: > > class ExceptionsMiddleware: > def process_exception(self, request, exception): >

Re: Different auth user models withoout doing multi-table inheritance

2015-08-10 Thread Carl Meyer
Hello Ankit, On 08/10/2015 09:38 AM, Ankit Agrawal wrote: > I am working on a project which has two different sets of users - > |Customer| and |Merchant|. Both of these users should be able to > register and login to their respective profiles. The most obvious choice > to implement this that came

Re: Question about squashing django migrations

2015-08-10 Thread Carl Meyer
Hi Richard, On 08/01/2015 06:27 PM, Richard Brockie wrote: > Can someone please explain the implications of this note about squashing > migrations in the documentation? > > From: https://docs.djangoproject.com/en/1.7/topics/migrations/ > > "Once you’ve squashed a migration, you should not th

Re: How to use Django 1.8.2 with Python 2.7?

2015-08-11 Thread Carl Meyer
Hi, On 08/11/2015 11:56 AM, jsa...@nvidia.com wrote: > I'm studying the Django Project tutorial > using Python > 2.7 (because that's my department's current standard) and Django 1.8.2 > (because that's the current stable version). > > The

Re: Architectural suggestions for (Django + API)

2015-08-16 Thread Carl Meyer
Hi Julio, On 08/16/2015 04:59 PM, julio.lace...@m2agro.com.br wrote: > I created a project using Django (let's call this Project A) and now I > decided to start a new one but this time it is an API using Django REST. > So, for now I have to refactor Project A to consume data from API, but > in ord

Re: Turn off migrations completely in Django 1.7

2015-08-25 Thread Carl Meyer
On 08/25/2015 08:42 AM, Marcin Nowak wrote: > > On 25 August 2015 at 16:21, Tim Graham > wrote: > > What does "turning off migrations" mean in practice? Is it not > enough to avoid the makemigrations and migrate management commands? > > > > Currently I'm r

Re: Turn off migrations completely in Django 1.7

2015-08-25 Thread Carl Meyer
On 08/25/2015 09:02 AM, Marcin Nowak wrote: > > On 25 August 2015 at 16:53, Carl Meyer <mailto:c...@oddbird.net>> wrote: > > I thought we already covered this topic, and `managed=False` should work > for your use case. That's the exact meaning of this flag:

Re: Turn off migrations completely in Django 1.7

2015-08-25 Thread Carl Meyer
On 08/25/2015 09:23 AM, Marcin Nowak wrote: > On 25 August 2015 at 17:04, Carl Meyer <mailto:c...@oddbird.net>> wrote: > > Hmm, yes, third-party apps are an issue. > > My recollection from the last time you brought this up is that we > decided an AppCon

Re: Migrating old users into custom user model

2015-08-25 Thread Carl Meyer
Hi Ben, On 08/25/2015 03:33 PM, Ben Wattie wrote: > I have an existing project with migrations, datamigrations and I need a > custom user model now, not just 1-1 profile so I created one. Unfortunately, while this is technically possible (I haven't done it myself, but I know at least one person w

<    1   2   3   >