Re: Is it possible to save children before parents?

2017-02-13 Thread Mike Dewhirst
Derek, Antonis, Ludovic and Melvyn I've got a lot happening in the code because chemical mixtures and safety regulations are complex. I will attempt to radically simplify it in a new minimal project and prove/disprove things and report back under this thread. Many thanks for the suggestions

Re: Django Admin keeps redirecting to login page repeatedly

2017-02-13 Thread Abdul Wahid
Hey Tim, Thanks for the hint, You are right the culprit was the *"* django_zappa.middleware.ZappaMiddleware*" *Its working fine without this middleware but I require this middleware (Django Zappa) as for AWS lambda which provides me serverless hostin

Re: Setting The Admin Login.

2017-02-13 Thread Tim Graham
Use the createsuperuser command (manage.py createsuperuser) to create a user, then use that username and password to login. Maybe you want to revisit the tutorial, https://docs.djangoproject.com/en/stable/intro/tutorial02/#creating-an-admin-user. On Monday, February 13, 2017 at 8:33:17 PM UTC-5

Re: Setting The Admin Login.

2017-02-13 Thread Steve R Burrus
We;ll Tim I like any other Django newb ie just wanna be able to go into the Django admin like I clearly remember doing with past versions of Django. Is there any more advice you can give me for this problem?  On Monday, February 13, 2017 6:27 PM, Tim Graham wrote: I'm not sure what y

Re: Is it possible to save children before parents?

2017-02-13 Thread Melvyn Sopacua
P.S. I left two bugs in there, for now I'll leave them in as an exercise for the reader. -- Melvyn Sopacua -- 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 dja

Re: Is it possible to save children before parents?

2017-02-13 Thread Melvyn Sopacua
On Sunday 12 February 2017 09:55:16 Mike Dewhirst wrote: > A mixture has a number of ingredients and the proportions should > (eventually) sum to 100% > > Ingredients are substances connected to the mixture - also a substance > - via m2m relationships. Each m2m record carries an ingredient > prop

Re: Setting The Admin Login.

2017-02-13 Thread Tim Graham
I'm not sure what you're trying to do. On Monday, February 13, 2017 at 5:29:49 PM UTC-5, Steve Burrus wrote: > > I am sorry Tim but I checked oiut both "creat esuperuser" and > "changepassword" commands but it did no good! Can you please give me a > more detailed solution? > > > On Monday, Feb

Re: How see raw SQL code produced by django?

2017-02-13 Thread Thomas Nyberg
On 02/13/2017 05:24 PM, Tim Graham wrote: Here's where Django defines REGEXP: https://github.com/django/django/blob/2f10216f84b55920de25422842a66260219e393f/django/db/backends/sqlite3/base.py#L173 From http://stackoverflow.com/a/8244670: SQLite does not contain regular expression functionalit

Re: Setting The Admin Login.

2017-02-13 Thread Steve R Burrus
I am sorry Tim but I checked oiut both "creat esuperuser" and "changepassword" commands but  it did no good! Can you please give me a more detailed solution? On Monday, February 13, 2017 3:42 PM, Tim Graham wrote: I guess you're looking for the createsuperuser command: https://docs.

Re: Django Admin keeps redirecting to login page repeatedly

2017-02-13 Thread Tim Graham
Can you create a minimal project that reproduces the problem? It seems like something in the request/response cycle (middleware maybe?) is effectively logging you out on each request. On Monday, February 13, 2017 at 5:07:09 PM UTC-5, Abdul Wahid wrote: > > Hi Everyone, > > Since last two nights,

Re: How see raw SQL code produced by django?

2017-02-13 Thread Tim Graham
Here's where Django defines REGEXP: https://github.com/django/django/blob/2f10216f84b55920de25422842a66260219e393f/django/db/backends/sqlite3/base.py#L173 >From http://stackoverflow.com/a/8244670: SQLite does not contain regular expression functionality by default. It defines a REGEXP operato

How see raw SQL code produced by django?

2017-02-13 Thread Thomas Nyberg
Hello, I have a question about regexes and sqlite3. I am executing a certain line of code: >>> regex = 'NET | INCOME' >>> Table.objects.filter(name__iregex=regex). When I have it print out the SQL sent, I get the following (this is a simplified, but equivalent version): SELECT

Django Admin keeps redirecting to login page repeatedly

2017-02-13 Thread Abdul Wahid
Hi Everyone, Since last two nights, I am struggling a lot to resolve the issue as my Django admin section keeps redirecting to login page repeatedly. I had tried every corner solution to resolve the issue, but failed to resolve it. Finally I am writing here in some hope that someone who alread

Re: Django doesn't load CSS

2017-02-13 Thread djangomailtotest
Wow, mate, you're the hero! Worked like a charm! Thank you very much! -- 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.

Re: Setting The Admin Login.

2017-02-13 Thread Tim Graham
I guess you're looking for the createsuperuser command: https://docs.djangoproject.com/en/stable/ref/django-admin/#createsuperuser On Monday, February 13, 2017 at 4:28:45 PM UTC-5, Steve Burrus wrote: > > How do I > > *go about setting the username/password for the CURRENT version of the > Dja

Setting The Admin Login.

2017-02-13 Thread Steve Burrus
How do I *go about setting the username/password for the CURRENT version of the Django Server anyway? It used to be easier to do in earlier versions of Django. * -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Re: return Database.Cursor.execute(self, query, params) django.db.utils.IntegrityError: NOT NULL constraint failed: auth_user.last_login when adding a superuser

2017-02-13 Thread Tim Graham
It looks like you're missing a migration to allow null values in the last_login column. If you ran "migrate --fake", then it's possible some migrations were "fake applied" and you'll need to "fake unapply" them and actually run them. https://docs.djangoproject.com/en/stable/releases/1.8/#abstra

Re: Is it possible to save children before parents?

2017-02-13 Thread ludovic coues
You could use a method instead of a property for the proportions. https://docs.djangoproject.com/en/1.10/ref/utils/#django.utils.functional.cached_property The cached_property decorator let you use the method like a property and will cache the results so it's only computed once per objects. On 13

Re: Edx LDAP Auth setting

2017-02-13 Thread 'Faruk D.' via Django users
Hi Yip, I could fix the issues. Thank you very much for your help. Kind regard Faruk -- 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+unsubsc

Re: return Database.Cursor.execute(self, query, params) django.db.utils.IntegrityError: NOT NULL constraint failed: auth_user.last_login when adding a superuser

2017-02-13 Thread ludovic coues
Have you tried to run makemigrations before migrate ? On 12 Feb 2017 7:33 p.m., "Adam" wrote: > Hi Antonis, this is the full message including the command: > > :~/udemystuff/test_project# python manage.py createsuperuser > /root/udemystuff/test_project/trydjango19/local/lib/python2. > 7/site-pac

Re: Can't use psycopg2 2.7b1 with django

2017-02-13 Thread notsqrt
Hi Tim, Ticket created at https://code.djangoproject.com/ticket/27830, with some additional info, and other potential places needed to be fixed. Thanks, Le vendredi 10 février 2017 20:40:42 UTC+1, Tim Graham a écrit : > > I think distutils.version.LooseVersion should be safe to use (django-cms

Re: No module named client

2017-02-13 Thread ludovic coues
I would do that to get more debugging information : try: from salt import client except : import salt raise RuntimeError("[%s]" % ", ".join(dir(salt))) If it work like I hope it does, it will print all the module from salt and a bit more information. Or you can do