Considerations for mixed Django & Celery versions

2019-04-16 Thread 'Mike Lissner' via Django users
We've currently running django 1.8.x and Celery 3.1.19 in production and our code base is getting a little too big. To fix this, our plan is to pull out Celery tasks into a separate repo and docker image. As we do this, it'd be nice if we could upgrade both Django and Celery to their latest ver

Re: Specifying model relationship as string vs concrete model?

2019-04-06 Thread Mike Dewhirst
Using the class means you have to import it first. I have stuck to the string version since encountering circular import errors some time ago. Django is smart enough to get it right so I don't even think about it. YMMV Mike Connected by Motorola Mohit Solanki wrote: >Since Django

Re: Models

2019-04-04 Thread Mike Dewhirst
or 'third normal form' which is relational-speak for designing databases to match the real world. The best advice I can offer is to adopt 3rd normal form and don't compromise. A good book if a little deep for beginners is Domain Driven Design by Eric Evans. Welcome and all th

Re: Hosting recommendations please

2019-04-03 Thread Mike Dewhirst
On 3/04/2019 8:27 pm, Saurabh Jaiswal wrote: Hey Mike, Launch a digital ocean droplet with plesk 17.08 with decent specs and you can run all your three websites with ease on it on a single droplet. You would have to setup apache mod_wsgi on it and you will be good to go. If you need help do

Re: Hosting recommendations please

2019-04-02 Thread Mike Dewhirst
Thank you everyone for your recommendations. I have decided to see what DigitalOcean feels like. Cheers Mike On 2/04/2019 6:08 pm, Mike Dewhirst wrote: I have to move three Django websites away from my current VM service provider by the end of April because he is going out of the VM business

Hosting recommendations please

2019-04-02 Thread Mike Dewhirst
comments about providers please send them off-list. Many thanks Mike -- 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...@goog

Re: Urgently need help with deploying django on plesk.

2019-03-31 Thread Mike Dewhirst
On 1/04/2019 1:47 pm, Saurabh Jaiswal wrote: Hey Mike, I have access to the pesk server as root user. I have been facing issue with the mod_wsgi setup process. Have you seen ... https://modwsgi.readthedocs.io/en/develop/ On Mon, Apr 1, 2019 at 6:03 AM Mike Dewhirst <mailto

Re: Urgently need help with deploying django on plesk.

2019-03-31 Thread Mike Dewhirst
ht be able to use .htaccess files to tweak Apache to suit your needs I would be looking to find a VM and do it myself with root access or find a Django-friendly hosting provider. My preference is the former. Good luck. Mike -- You received this message because you are subscribed to the G

Re: Help Needed For .Error Solving

2019-03-25 Thread Mike Dewhirst
On 26/03/2019 4:35 am, Kumar Ashirwad Mishra wrote: I am trying to send a request to paytm gateway checkout api for online transaction so I have created a form that has hidden values for request. So how to solve the csrf_token problem .. Thankyou You need to include the CSRF token immediately

Re: How to filter 'Invalid HTTP_HOST header ...' errors

2019-03-24 Thread Mike Dewhirst
o directly. Jani Could you please explain what is happening in more detail? Django is definitely generating these errors because it is saying 'You may need to add u'123.456.789.012' to ALLOWED_HOSTS.' Where the IP address is the IP address of the Apache server. Thanks Mi

How to filter 'Invalid HTTP_HOST header ...' errors

2019-03-23 Thread Mike Dewhirst
asonably certain the answer to the problem sits somewhere in the logging configuration but that's not trivial - for me anyway. I'm having trouble deciphering https://docs.djangoproject.com/en/1.11/topics/logging/#examples Can anyone please point me to a worked example which addresse

Re: Thank you for the HINT

2019-03-15 Thread Mike Dewhirst
+ 100 Django is marvellous! :) On 16/03/2019 9:00 am, Matthew Pava wrote: I am working on some migration code, and I did not enter the _id suffix to my field name in the RunSQL code. Django was very kind to give me the clue to reference the column with the _id suffix. That is an amazing hi

error information in Django forms template

2019-03-14 Thread Mike Rankin
I'm new to Django and I'm trying an experiment using material.io. The problem I'm having is that the formfield injects the error messages and the label directly into the page instead of sending it to the widget template. Because of the way material.io builds controls, it would be nice to have t

Re: Zero Downtime Field Type Changes

2019-03-12 Thread Mike Dewhirst
he data again to pick up those few records which might have been exposed during the time before the webserver was reloaded. That's what I would do. Mike If it helps, the manual process I'm thinking about kind of goes as follows: # existing model: class Model: field = OldField() #

Static files in production [Was: How does WSGI work?]

2019-03-07 Thread Mike Dewhirst
y STATIC_URL in your production environment. Alternatively, manage.py collectstatic will do that for you. On Fri, 8 Mar, 2019, 5:29 AM Mike Dewhirst, <mailto:mi...@dewhirst.com.au>> wrote: On 8/03/2019 10:11 am, Tal wrote: > The word "simple" appears 13 times i

Re: How does WSGI work?

2019-03-07 Thread Mike Dewhirst
e Django list any more. On Tuesday, February 26, 2019 at 3:13:00 PM UTC-7, Tal wrote: Is it right though? On Tuesday, February 26, 2019 at 2:49:03 PM UTC-7, mike wrote: Great write up! On Tue, Feb 26, 2019 at 2:39 PM Tal wrote: Did I get something wrong?

Re: migrating from 2.7 to 3.x on Ubuntu

2019-03-07 Thread Mike Dewhirst
rather than later. :) Mike On March 4, 2019 10:40:21 PM CST, Mike Dewhirst wrote: On the same host, is it viable to switch my Django projects away from vhosts under Apache2/mod_wsgi/py2.7 to Gunicorn and Nginx running with Python 3.x ... AND SIMULTANEOUSLY ... leave

migrating from 2.7 to 3.x on Ubuntu

2019-03-04 Thread Mike Dewhirst
On the same host, is it viable to switch my Django projects away from vhosts under Apache2/mod_wsgi/py2.7 to Gunicorn and Nginx running with Python 3.x ... AND SIMULTANEOUSLY ... leave Trac running on Apache2 mod_wsgi/py2.7? Trac is not yet released for Python 3.x. There is also a Subversion

Re: How to override the ModelAdmin "change" form ?

2019-03-01 Thread Mike Dewhirst
On 2/03/2019 2:08 am, karim.at...@gmail.com wrote: Hi Mike, I tried what you wrote by overriding the *self.change_form_template* but the form does not appear. Would you please provide me the content of your model admin *billing_payment_view ?* Sure. I recently asked for assistance here and

Re: How to override the ModelAdmin "change" form ?

2019-02-28 Thread Mike Dewhirst
alidationError and therefore lets me include a human readable message which appears in the Admin and *seems* to prevent saving. You would need to test this especially with m2m side-effects and atomicity consequences. I hope this helps

[Solved] Re: How can I refresh admin_urls

2019-02-25 Thread Mike Dewhirst
    #    logging.log(logging.DEBUG, '205 admin {0}'.format(extra_context))     return super(SubstanceAdmin, self).change_view(     request, object_id, form_url, extra_context     )  I reckon the Admin can do anything. It just takes some head s

[Solved] Re: How can I refresh admin_urls

2019-02-25 Thread Mike Dewhirst
a_context )  I reckon the Admin can do anything. It just takes some head scratching :) Mike On 23/02/2019 6:58 pm, Mike Dewhirst wrote: (Resend with urls which I previously omitted) In a 'Substance' app I have a Stripe payment facility working from within the Admin. The problem

test message

2019-02-25 Thread Mike Dewhirst
No need to answer this. I'm just seeing if googlegroups sends it me. Haven't much from the list since gmail got itself listed in SORBS the other day - and in particular I didn't get a message I posted in the browser. -- You received this message because you are subscribed to the Google Groups

Re: How can I refresh admin_urls

2019-02-25 Thread Mike Dewhirst
min/substance/substance/1450/change/payment (without a trailing slash). Thereafter valid admin urls fail to show any content.. If I make settings APPEND_SLASH False, it says 404. Mike -- You received this message because you are subscribed to the Google Groups "Django users" group

How can I refresh admin_urls

2019-02-22 Thread Mike Dewhirst
dev server reloaded itself. I probably have an incorrect diagnosis here. The problem is most likely my misunderstanding of how to use the Admin properly. Any help will be very much appreciated. Thanks Mike The process uses ModelAdmin.change_view()[1] to call my billing_payment_view()[2]

How can I refresh admin_urls

2019-02-21 Thread Mike Dewhirst
since the dev server reloaded itself. I probably have an incorrect diagnosis here. The problem is most likely my misunderstanding of how to use the Admin properly. Any help will be very much appreciated. Thanks Mike The pr

Re: passing django models data to python script

2019-02-20 Thread Mike Dewhirst
On 20/02/2019 6:39 pm, Ousmane Baricisse wrote: Hi, I would like to implement a web app using reactjs and django. I have a python script which does some sort of optimization and stores the final output in a list and returns it. Right now everything is static in the python script and I would li

Re: Admin form_url breakout problem

2019-02-15 Thread Mike Dewhirst
ways to reload the urls and persist context past the Stripe form but cannot do it apart from reloading the server. I'm thinking that maybe the Admin has a mechanism to re-init itself but I can't find it. I'm out of ideas at the moment so if anyone can help I would be very appreciative

Re: Keeping/accessing the data Django generates during a test run

2019-02-12 Thread Mike Dewhirst
mport data written to files into a database for conversion into fixtures? Mike Connected by Motorola Anton Melser wrote: >Hi, > > >I can't work out whether it is expected or whether I am missing something. I >would like to keep the DB data that I generate during a te

Re: Admin form_url breakout problem

2019-02-12 Thread Mike Dewhirst
chine which can remain with Python 2.7 so everything else can go to Py3.x A side plan is to make a Django 2.1 venv in development to see if that fixes anything. More later. Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To u

Re: Django-Photologue - error deleting a photo

2019-02-11 Thread Mike Dewhirst
On 12/02/2019 4:54 pm, Victor H. Velasquez Rizo wrote: Hi Mike. I have spend hours trying to get the code where all this crazyness is happening with no good luck. I would like to ask you if there is any posibility you can access my computer trhoug TEAMVIWER and guide me on this. I would love

Re: Django-Photologue - error deleting a photo

2019-02-11 Thread Mike Dewhirst
On 12/02/2019 2:19 pm, Victor H. Velasquez Rizo wrote: Hello mike. Thank you for all this information. I've been checking the migrations but I don't see anything with the *sort_value* In that case you have asked for gallery_photos.sort_value somewhere in your code and tha

Re: Django-Photologue - error deleting a photo

2019-02-11 Thread Mike Dewhirst
On 12/02/2019 11:47 am, Victor H. Velasquez Rizo wrote: Yes Mike. I have done both: In that case, you need to inspect the database itself using PGAdmin (or similar for other databases) and confirm that the gallery_photos table does indeed have a sort_value column. If not - as the error

Re: Django-Photologue - error deleting a photo

2019-02-11 Thread Mike Dewhirst
On 12/02/2019 10:23 am, Victor H. Velasquez Rizo wrote: Hello Mike. I have ran the migrations for PHOLOGUE: *Running migrations:* *  No migrations to apply.* Ok, have you done manage.py makemigrations followed by manage.py migrate? On Mon, Feb 11, 2019 at 4:02 PM Mike Dewhirst

Re: Django-Photologue - error deleting a photo

2019-02-11 Thread Mike Dewhirst
the table "gallery_photos". Column is database-speak for a model field. Your software thinks the column exists therefore it is a programming error. My best guess is that you need to do a migration. https://docs.djangoproject.com/en/1.11/topics/migrations/ Cheers Mike

Re: Upgrading project from Django 1.11 to 2.1

2019-02-11 Thread Mike Dewhirst
On 11/02/2019 6:00 pm, PARTH PATIL wrote: Six.text_types is used to represent unicode() in python2 and str in python3. And now you are only using python3, it would be safe to replace it with str() Thank you kind Sir! Mike -- You received this message because you are subscribed to the Google

Upgrading project from Django 1.11 to 2.1

2019-02-10 Thread Mike Dewhirst
Is it safe/advisable to globally replace six.text_types( with str( Thanks Mike -- 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-user

Re: Accessing child relations when overriding save()

2019-02-10 Thread Mike Dewhirst
created to establish a relationship (selectable from a choices list), both parent and child already exist which lets you delegate a fair bit of processing to the "though" model save() method which in real world timing is probably where it belongs. I prefer it because I can use queries ra

Re: Admin form_url breakout problem

2019-02-10 Thread Mike Dewhirst
e contents is empty. Refresh and shift-refresh doesn't do anything. Saving a bit of source to reload runserver fixes (works around) the problem. I'm happy to reveal as much source as necessary if you would like to see it and have the time. Thanks very much for sticking with this Mik

Re: reg: How to use Django Password validation in my existing views?

2019-02-06 Thread Mike Dewhirst
On 6/02/2019 6:32 pm, Mike Dewhirst wrote: On 6/02/2019 5:15 pm, 'Amitesh Sahay' via Django users wrote: I have an existing django views.py where I have some password, username, and email validation logic applied. However, going forward I need to apply more advanced password valid

Re: reg: How to use Django Password validation in my existing views?

2019-02-05 Thread Mike Dewhirst
#x27;: {     'error_message': 'Password too short',     'help_message': 'This password needs to be at least 23 characters',     }     },     {     'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'

Re: Admin form_url breakout problem

2019-02-02 Thread Mike Dewhirst
g this it sadly this makes no difference. Mike On 2/02/2019 6:06 pm, Mike Dewhirst wrote: I think I know. Don't waste time on this. I'll report back later. Mike On 2/02/2019 3:27 pm, Mike Dewhirst wrote: I thought it was fixed but not so. It works perfectly *only* if the dev server r

Re: Admin form_url breakout problem

2019-02-01 Thread Mike Dewhirst
I think I know. Don't waste time on this. I'll report back later. Mike On 2/02/2019 3:27 pm, Mike Dewhirst wrote: I thought it was fixed but not so. It works perfectly *only* if the dev server reloads after all the work and prior to clicking the link on the success.html template b

Re: Admin form_url breakout problem

2019-02-01 Thread Mike Dewhirst
r any non-javascript hints Mike On 30/01/2019 5:13 pm, Mike Dewhirst wrote: Matthew I looked for preventDefault and found it in lots of javascript scripts. So I decided instead to look at my python code which is slightly easier for me to understand. I sort of refactored it and cut large swags o

Has anyone connected Django with AWS cognito in multi-tenant environment?

2019-01-31 Thread mike hennessy
I'm new to Django, but not new to web development. I'm picking up Django/Python and I'm interested in setting up a SaaS multi-tenant application which leverages AWS's Cognito Identity/Infrastructure for scaling a SaaS Web application. In googling this, I found very little. There was a thread ab

Re: Admin form_url breakout problem

2019-01-29 Thread Mike Dewhirst
he super call it started working. Thank you very much for persisting with me. The Admin is fabulous! Nobel prize for something is warranted :) Much appreciated Mike On 29/01/2019 2:31 am, Matthew Pava wrote: Hi Mike, When Stripe processes the payment, you need to preventDefault on the form s

Re: Admin form_url breakout problem

2019-01-25 Thread Mike Dewhirst
the Admin. Regarding your comment on using reverse to derive the link, I agree. I was just being somewhat paranoid and skipping the reverse code which I haven't taken the time to study. I will. Thanks again Mike On 26/01/2019 1:59 am, Matthew Pava wrote: Based on the error message, it looks lik

Re: Admin form_url breakout problem

2019-01-25 Thread Mike Dewhirst
On 25/01/2019 2:40 am, Matthew Pava wrote: Hi Mike, I'm not really seeing why this is throwing errors at you. It seems like you've done everything right. Could you provide the code (or the relevant parts) for the Substance Admin for

Re: how can I reference a field from one model to another model

2019-01-24 Thread Mike Dewhirst
On 24/01/2019 5:28 pm, carlos wrote: Hello, I do not know if I'm asking the question correctly, but I need to call a field of one model in another model example: class ModelDad(models.Model):     name = blablabla class ModelChild1():    fk(ModelDad)    number = models.IntegerField() class

Re: Admin form_url breakout problem

2019-01-24 Thread Mike Wyatt
HI, I think you have the wrong Mike here. Although I use Django, None of these issues are ones that I can 1) help with or 2) am dealing with now. Mike On Thu, Jan 24, 2019 at 2:37 PM Mike Dewhirst wrote: > On 25/01/2019 2:40 am, Matthew Pava wrote: > > Hi Mike, > > I'm n

Re: Admin form_url breakout problem

2019-01-24 Thread Mike Dewhirst
On 25/01/2019 2:40 am, Matthew Pava wrote: Hi Mike, I'm not really seeing why this is throwing errors at you. It seems like you've done everything right. That's very generous of you :) I got it mostly working last night after patching some code which was throwing errors. T

Re: Charfield variable length

2019-01-23 Thread Mike Dewhirst
On 24/01/2019 9:14 am, 'Odile Lambert' via Django users wrote: Hello I have problems with the Charfield max_length. In the source code, the possibility exists to have max_length = None but it does not pass Django check when  models.py. contains a charfield = None I can understand that there

Re: Admin form_url breakout problem

2019-01-23 Thread Mike Dewhirst
lto:django-users@googlegroups.com] On Behalf Of Mike Dewhirst Sent: Wednesday, January 23, 2019 3:48 PM To: django-users@googlegroups.com Subject: Re: Admin form_url breakout problem On 24/01/2019 1:08 am, Matthew Pava wrote: It looks like your second URL is different than the first. */admin

Re: Admin form_url breakout problem

2019-01-23 Thread Mike Dewhirst
ys ago ... "Basically you can create your own view and use that to display data in a template that inherits from, for example, the Django admin form template. A bit tricky first time but then it seems straightforward." I'm finding it a bit tricky for sure! If you can see

Admin form_url breakout problem

2019-01-22 Thread Mike Dewhirst
iated. Happy to show any code you might want to see. Many thanks Mike -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Re: Admin problem launching a non-Admin page

2019-01-15 Thread Mike Dewhirst
Many thanks Derek - I have started reading ... Mike On 16/01/2019 4:39 pm, Derek wrote: Hi Mike Normally I have just used the functionality in a third-party admin "wrapper", for example, Django Suit (https://django-suit.readthedocs.io/en/develop/configuration.html#id1). I see o

Admin problem launching a non-Admin page

2019-01-15 Thread Mike Dewhirst
ew or template from the model save() method. Has anyone had a similar Admin use-case and found a good way of tackling it? Thanks for any suggestions Mike [1] https://docs.djangoproject.com/en/1.11/ref/contrib/admin/#django.contrib.admin.ModelAdmin.response_add [2] https://docs.djangoproject.c

How can I launch a page from a model method

2019-01-10 Thread Mike Dewhirst
I do that? Thanks Mike -- 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

Re: queries and date ordering

2019-01-08 Thread Mike Dewhirst
On 9/01/2019 4:29 pm, Dylan Reinhold wrote: No you can't rely on it being the same order, if the database is re-indexed or reorged that order might change. Thanks On Tue, Jan 8, 2019 at 9:18 PM Mike Dewhirst <mailto:mi...@dewhirst.com.au>> wrote: If I hav

queries and date ordering

2019-01-08 Thread Mike Dewhirst
st recent? Postgres Thanks Mike -- 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 e

Hacking attempts

2019-01-03 Thread Mike Dewhirst
ject lines like ... [Django] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: '43.211.128.177'. You may need to add u'43.211.128.177' to ALLOWED_HOSTS. ALLOWED_HOSTS is tied down to exactly the website domain. Thanks Mike -- You received this message because you are subscribe

Re: Django on IIS

2018-12-17 Thread Mike Dewhirst
On 18/12/2018 2:16 PM, Alex Heyden wrote: I have recently, and it was equal parts misery and pain. FastCGI via wfastcgi, as outlined at http://blog.mattwoodward.com/2016/07/running-django-application-on-windows.html I also had to downgrade from Python 3.7 to Python 3.6 I wouldn't really consi

Re: How to create two different login system

2018-12-13 Thread Mike Dewhirst
On 14/12/2018 5:28 PM, maunish dave wrote: My project contains two user one for managers and other for employees any suggestions? Django contrib.auth already has groups and I use them for deciding what they can see vertically. Horizontally I use the ordinary relational mewchanisms. Here is

Re: How to transfer django projects from one pc to another

2018-12-10 Thread Mike Dewhirst
On 11/12/2018 12:03 PM, Simon A wrote: On Tuesday, December 11, 2018 at 3:14:07 AM UTC+8, computer engineering Forum wrote: I want to change my pc but i fear i wont be able to access the projects I would assume my new pc is going to fail five minutes after I successfully transfer pr

Re: How I can insert data into database automaticaly

2018-12-07 Thread Mike Dewhirst
On Saturday, December 8, 2018 at 2:44:21 AM UTC+11, Informatico de Neurodesarrollo wrote: > > Thanks Mike: > > My data are in different formats, but I don't care pass it by hand once > time. > Once is enough, I agree. > > Previously, I know that I need

Re: How I can insert data into database automaticaly

2018-12-06 Thread Mike Dewhirst
ible third way might be found here ... https://djangopackages.org/grids/g/countries/ I haven't used any so I can't tell you much. Good luck Mike On 7/12/2018 5:28 AM, Informatico de Neurodesarrollo wrote: Saludos Gerson: Es real, trabajo en salud y estoy trabajando en un sistema pa

Re: How 2 access the Primary model's ID in the Foreign model??

2018-12-04 Thread Mike Dewhirst
On 5/12/2018 7:07 AM, Sourajit Mohanty wrote: I have 2 model classes Album and Songs(where Song is the Foreign key) I want to access the Albums ID in the Songs class.. How can I do that?? song = Songs.objects.get(name='Happy birthday') albumid = song.album.id Similarly ... album = song.albu

Re: Human Readable Values

2018-11-29 Thread Mike Sacauskis
On Tuesday, November 27, 2018 at 8:15:12 AM UTC-5, Nelson Varela wrote: > > show your code that renders the values > This is the class class Hardware(models.Model): hardware_id = models.AutoField(primary_key=True) compute_asset_name = models.TextField(blank=False, null=False) hardwa

Re: How to get a multiple select widget for the Admin without a queryset

2018-11-26 Thread Mike Dewhirst
is a ListField. This is for CSS and formfield_overrides. On Tue 27 Nov, 2018 8:54 am Mike Dewhirst <mailto:mi...@dewhirst.com.au> wrote: In the Admin I would like to provide the user with checkboxes against a list of options not stored in the database. Specifically, I w

How to get a multiple select widget for the Admin without a queryset

2018-11-26 Thread Mike Dewhirst
et': ProfileFilteredSelectMultiple},     }     readonly_fields = (('modified', 'modified_by',))     fieldsets = (     ('More detail for company profile', {     'classes': ('collapse', 'wider'),

Human Readable Values

2018-11-26 Thread Mike Sacauskis
hanks Mike -- 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@g

Re: Advice on choosing Django modules?

2018-11-25 Thread Mike Dewhirst
mething simple. By the time I had found the packages with the fewest models, fewest lines of code and somewhat understandable after poking around under the covers I would be somewhat better educated and therefore better placed to make strategic decisions. Good luck Mike On 24/11/2018 8:46 A

Re: Django jobs

2018-11-14 Thread Mike Dewhirst
On 15/11/2018 2:28 PM, Joel Mathew wrote: The last point is a bit of a sore for me. I'm well versed with some other languages including perl, C, and javascript. Python seems to have "pythonic" ways of doing stuff that's at loggerheads with all other languages. Is there a single resource to lear

Re: How do I store details securely with django?

2018-11-12 Thread Mike Dewhirst
logic. I have done that - without the extra credentials part - to create additional data based on converting a @domain added to a username into a company name and company profile. Mike On Monday, November 12, 2018 at 12:47:56 AM UTC+11, Lance Haig wrote: > > Hi, > > I have a project

Re: How do I store details securely with django?

2018-11-12 Thread Mike Dewhirst
On 12/11/2018 7:02 PM, Lance Haig wrote: Hi, Thanks for responding. My answers inline On 11/11/18 11:07 PM, Mike Dewhirst wrote: On 12/11/2018 12:47 AM, Lance Haig wrote: Hi, I have a project I am working on https://github.com/lhaig/usery/ and part of the roadmap of the project is to add

Re: configuration settings.py

2018-11-11 Thread Mike Dewhirst
quot;DJANGO_SETTINGS_MODULE"] = "%s.settings.%s" % (project, site) os.environ["PYTHON_EGG_CACHE"] = site_root # this is the public API - returns django.core.handlers.wsgi.WSGIHandler() application = get_wsgi_application() On Sunday, 11 November 2018 23:57:58 UTC+2, Mike

Re: How do I store details securely with django?

2018-11-11 Thread Mike Dewhirst
On 12/11/2018 12:47 AM, Lance Haig wrote: Hi, I have a project I am working on https://github.com/lhaig/usery/ and part of the roadmap of the project is to add more cloud types to the list. I wanted to allow admins for these services to login and create records for their different clouds in

Re: configuration settings.py

2018-11-11 Thread Mike Dewhirst
On 12/11/2018 3:24 AM, Gear Crew wrote: I want to understand why do that Because Django needs to know which settings module to use so it can find all your apps and models. It was designed that way so that a single installation of Django could be used for multiple projects. Screenshot fro

Re: psql user defined models cant be acessed

2018-11-10 Thread Mike Dewhirst
ickly able to view those tables in the Django Admin. Good luck Mike On 10 Nov 2018 4:17 a.m., "Mike Dewhirst" <mailto:mi...@dewhirst.com.au>> wrote: On 9/11/2018 11:04 PM, ARAVIND BALAN wrote: I linked psql with django and can access django defined tables but cant

Re: Setting up admin in visual studio

2018-11-08 Thread Mike Dewhirst
repo, use up machine resources and generally obscure my view. ymmv Mike On Nov 8, 2018, at 2:47 PM, Saeed Pooladzadeh <mailto:lingo1...@gmail.com>> wrote: Thanks for your help. But this tutorial is not for windows and visual studio. In which directory should I install python? Is

Re: Update django 1.8 project to 2.0 lts

2018-09-23 Thread Mike Dewhirst
deploying in 2.7 for quite some time. One of these days I'll switch the production server to Python3 and drop 2.7. Only with Django 1.11 and Python 3.x working properly in production will I advance to the next Django 2.x LTS version Oh, and heaps of tests :) hth Mike Thanks in ad

Re: Running django tests with postgres

2018-09-18 Thread Mike Dewhirst
Bill I'm about to disappear for a few days. Thank you very much for your suggestions - I'll tackle them when I get back. Cheers Mike On 18/09/2018 11:34 PM, Bill-Torcaso-Oxfam wrote: I two comments, and as always Your Milage May Vary. * I wonder if you have the right index

Re: Running django tests with postgres

2018-09-15 Thread Mike Dewhirst
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

Re: Running django tests with postgres

2018-09-14 Thread Mike Dewhirst
r 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

Re: What is a standard practice to drop tables of an app in Django?

2018-09-09 Thread Mike Dewhirst
On 8/09/2018 9:09 PM, Jae Pil Choi wrote: I'm asking this on the official Django community after I asked on Stackoverflow because I still don't know what is the best practice for this particular action. (Original Question on Stackoverflowhere

Re: models.py => Mandatory to create tables?

2018-09-07 Thread Mike Dewhirst
Easy Create a models directory. In there make __init__.py file and in there ... from .whatever import Whatever ... 100 classes Then in ./models create 100 files with one model class in each file Anywhere in the project you can say ... from app.models import Whatever Connected by Motorola B

Re: Subgroups Implementation (from LDAP)

2018-09-07 Thread Mike Dewhirst
calities. I hope I haven't spoiled your flow. Lots of very helpful people on this list will ignore this thread simply because there is already a conversation happening. I suggest you start a new thread with a subject line somewhat different but which really encapsulates the nub o

Re: Subgroups Implementation (from LDAP)

2018-09-06 Thread Mike Dewhirst
On 7/09/2018 12:49 AM, Benjamin SOULAS wrote: Hi Mike ! The problem is our app have to be able to retrieve a Customer LDAP server. So we won't be able to know groups will be into the LDAP server. To be concise, when we'll set up the app, we'll have to retrieve the LDAP grou

Re: Subgroups Implementation (from LDAP)

2018-09-05 Thread Mike Dewhirst
On 5/09/2018 11:25 PM, Benjamin SOULAS wrote: Hi everyone, I m not expert at all in Django so it can be a silly question but I take the risk: I'm an expert in nothing! What about simplifying things by making your groups have smaller sets of permisssions and putting users into multiple group

Re: Django

2018-08-30 Thread Mike Dewhirst
On 30/08/2018 2:57 PM, Sai Pavan Kumar wrote: Hi Friends,        This is pavan working as a python developer. Is there any tool for reports generation in django admin or in templates(dynamic filters). Try this ... https://www.google.com.au/search?q=django-report-generator I will be looking f

Re: Ldap for django

2018-08-30 Thread Mike Dewhirst
On 30/08/2018 10:28 PM, soumyajit banerjee wrote: Hi, I am new in django python. I want to set up lodap authentication for my django app. Could you please help me. I am using python 3.6 with django 2.1 Try this ... https://www.google.com/search?q=django-ldap&ie=utf-8&oe=utf-8&client=firefox-

Re: smart_urlquote fails with some URLs - is this unfixable?

2018-08-24 Thread Mike Dewhirst
On 19/08/2018 7:09 PM, Mike Dewhirst wrote: Django 1.11.15 Python 2.7/3.6 Ubuntu 16.04 (staging and production) Windows 10 development. Postgres 9.6. Haven't tried this beyond development yet. My app relies on the Admin and uses a widget which adjusts the clicked link to open in a ne

RE: template tag help please?

2018-08-23 Thread Mike Jones
u are sending the parameters and have the parameters in the function - use the parameters. In other words: avn = kwargs['avn'] avd = kwargs['avd'] name = kwargs['name'] That is unnecessary Regards, Andréas Den ons 22 aug. 2018 kl

Re: Making a django project and an API.

2018-08-22 Thread Mike Dewhirst
If you can get your hands on a copy of Two Scoops of Django 1.11, there is a whole chapter on DRF. I've just had a look through it (20+ pages) and I reckon it will answer all your questions. On 23/08/2018 5:10 AM, vineeth sagar wrote: Hi I am pretty comfortable django. Now recently started work

Re: how to import serveral csv into database by using migrations.RunPython

2018-08-22 Thread Mike Dewhirst
On 23/08/2018 1:32 AM, emmanuel wyckens wrote: Hello, The class below didn't work if you use migrations.RunPython several times. Have you got an idea to manage double csv file importation into database ? In your migration file ... from django.db import migrations, models from .utils import do

RE: template tag help please?

2018-08-22 Thread Mike Jones
Ah I was just doing that to prove it was working This is the actual tag from django import template from django.conf import settings from django.utils.html import escape from band.models import Data register = template.Library() @register.simple_tag def do_cost( name, avn, avd,

Re: Make an element on a page visible only to logged in users

2018-08-21 Thread Mike Dewhirst
est.user in the rendering context as 'user' ie., context['user'] = request.user hth mike -- 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

smart_urlquote fails with some URLs - is this unfixable?

2018-08-19 Thread Mike Dewhirst
re-smartquote https://www.echemportal.org/echemportal/substancesearch/substancesearch_execute.action?numberType=CAS&number=67-64-1&allParticipants=true Perhaps the only way I can fix this is to detect the ugly bits and replace them with nice bits? That would be seriously fragile Any ide

Re: How to delete least recently used not expired django sessions?

2018-08-18 Thread Mike Dewhirst
On 18/08/2018 6:33 PM, Web Architect wrote: Hi Mike, Thanks for your response. Ours is an ecommerce site and forcing logouts especially for our regular users, might not be desirable from business point of view . I wasn't suggesting forcing logouts on a regular basis. I was thinking

Re: How to delete least recently used not expired django sessions?

2018-08-17 Thread Mike Dewhirst
On 17/08/2018 10:44 PM, Web Architect wrote: Hi, We are using persistent django sessions for our website where in the session information is stored in MySQL. Over last couple of years, the session data has grown to a huge number and we were planning to clean it up. I know that there is a djan

<    1   2   3   4   5   6   7   8   9   10   >