Re: How to best secure environment variables (secret key, passwords etc.) stored in .yml files?

2020-01-31 Thread Bill Torcaso
; instead, select a hash method from a list like [ "SHA-1, SHA-256, "MD5", ] by taking the size of urls.py modulo the length of that list. I look forward to hearing comments about this approach. Bill Torcaso -- You received this message because you are subscribed to the G

Re: Virtual Groups for learning Django

2018-11-05 Thread bill . torcaso . oxfam
I hear good things about Django Girls (https://djangogirls.org/). On Sunday, November 4, 2018 at 8:52:38 AM UTC-5, Expo Tor wrote: > > Anyone can recommend any online virtual groups for Django? I mean it > should be sth more than online tutorials - where users can come in > real-time with

Re: Where to create a Django project

2018-11-02 Thread bill . torcaso . oxfam
Hope this helps When working on an AWS Elastic Beanstalk instance, you can log into the system using Secure Shell (SSH), with a key pair. For EBeanstalk, that key pair was either created or selected from existing keys at the time that you created the server. >From there you have a

Re: Running a custom code after the server is up

2018-11-02 Thread bill . torcaso . oxfam
If I understand your situation, you want to run a management command fairly promptly after Django-server reboot, and not again for the duration of the server's uptime. Cron is useful and convenient for repeated tasks. And it can be made to handle once-and-done tasks, if you keep a bit of

Re: Creating seperate unique ids within the same table

2018-10-22 Thread bill . torcaso . oxfam
Joel said this was a requirement: One of the important criteria I had was that these IDs should be easily memorable. Unfortunately UUIDs are not memorable, being too long to remember. A primary key that appears in a URL is just an implementation detail - the implementation could change, and

Re: Creating seperate unique ids within the same table

2018-10-22 Thread bill . torcaso . oxfam
Joel, I completely agree that UUIDs are not memorable. I still think you would be well-served to make a UUID the basis for uniquely defining a person. If you want to further add a short name, you could make an object class that has a UUID and, say, an 8-digit number. If you assert that the

Re: Creating seperate unique ids within the same table

2018-10-22 Thread bill . torcaso . oxfam
Hello all, The previous discussion shows a method that will work. but I think it has disadvantages, and I want to suggest another approach. The disadvantage of using a primary key from a table, any table, is that you are committing to that table and that primary key for all eternity. this

Re: Update django 1.8 project to 2.0 lts

2018-09-24 Thread Bill-Torcaso-Oxfam
I strongly recommend this approach: My experience is that the best thing to do is to do minor upgrades - 1.8 -> 1.9.x -> 1.10.x -> 1.11.x (where x is the last patched version of each minor version). Further, at the completion of one Django version, I recommend saving a snapshot of your

Re: Running django tests with postgres

2018-09-18 Thread Bill-Torcaso-Oxfam
I two comments, and as always Your Milage May Vary. - I wonder if you have the right indexes on your Postgres database? The previous people report much faster completion times for test that use Postgres as the database. Perhaps your domain is just hard (and you description makes

Re: Different results of running pure SQL query from Django and from PGAdmin

2018-09-11 Thread Bill-Torcaso-Oxfam
I'd be interested to see a printout of 'columns' and 'cursor.description'. One explanation would be that your for-loop is not actually accessing the data that you think it is, or that your query is not actually fetching the data that you think it is. No criticism of your query implied -

Re: [Channels] How to write tests with database access?

2018-07-30 Thread Bill Torcaso
The question is whether testing asynchronous operations and is compatible. In my understanding, Andrew's hint points you in the only good direction. You've got to turn the async initiate/complete cycle back into a synchronous flow. You can poll from another thread, or use a message queue, or

Re: App structure : "One file - One object" - Is there a better way ?

2018-07-15 Thread Bill Torcaso
I ask this out of genuine curiosity -- how do you edit source code? I'm wondering because that seems inseparable from how you structure your python code into files. I say this without any judgement. If your brain likes one method per file, then you are asking your fingers and eyes to do

Re: Django DateField

2018-07-06 Thread Bill Torcaso
I wonder if this would work: represent ASAP as a legitimate DateTime value that is, say, 100 years in the future. Then a simple reverse sort will display all of the ASAP tasks before any others. This is a hack, and nothing but a hack. But you could implement it in five minutes. On

Re: A few doubts with an implementation.

2018-07-03 Thread Bill Torcaso
I didn't deeply consider your problem, but the aspect of doing a repetitive task at unrelated time intervals reminds me of how the Unix kernel handles the alarm() system call for multiple, unrelated processes. For you, it will take at most one thread to handle any number of users. 1.

Re: better way to create a dictionary in Django model?

2018-06-27 Thread Bill Torcaso
You might find it helpful to look at the Wagtail CMS (wagtail.io). It may not solve your problem, but Wagtail stores page-layout information in JSON format in a database column. The JSON can be revised without modifying the database schema. On Wednesday, June 27, 2018 at 8:18:09 AM UTC-4,

Re: Managing multiple user types in Django

2018-05-16 Thread Bill Torcaso
I inherited a system which has one User model, and a Profile model that is 1-to-1 with User. The type-of-user information is carried in a required "role" property in the Profile. I think that is a well-established approach. I am curious to hear what people think of the tradeoffs between

Re: Decoupling Postgres database credentials in django for deployment.

2018-04-22 Thread Bill Torcaso
I waited a while to answer this, and my answer comes in three distinct parts. #- Question: what is the danger is using environment variables to hold secret info? Answer: The Django runtime will dump secret info from environment variables into an HTTP response, in some

Re: Use self-increasing arguments in numeric for-loop in Django

2018-04-20 Thread Bill Torcaso
I an new-ish to Django, and I ask this to hear from more experienced users whether this would work at all, and whether it would be considered a good or bad practice. Goal: given an object and an integer index, retrieve the sub-object at that index within the incoming object. Method: Write a

Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread Bill Torcaso
I have a concern about using environment variables to hold secret information, and an opinion about it. IF DEBUG is enabled, and there is a 500 server internal error, and the default 500 template is used to render the response, THEN *all of your secret information is shown in the

Re: When do I need a new app within the site?

2018-02-22 Thread Bill Torcaso
This is an indirect reply --- but I like the book "Two Scoops of Django". It is a strong explanation of Django best practices. (The "scoops" are scoops of ice cream in the fictional ice cream store of the examples). Hope this helps. On Thursday, February 22, 2018 at 7:22:36 AM UTC-5,

Migrating into Django 1.9; question about autoescape

2018-02-13 Thread Bill Torcaso
a bad experience. 3. Visit all of my code and all of my templates, carefully converting into the world of autoescape-on. Thanks in advance, --- Bill Torcaso -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Is Tutorial / Part 4 wrong? (or is it me?)

2012-07-16 Thread Bill Torcaso
Django is great, and the tutorial is great. I'm having a problem at the very end of tutorial-4. I try to use generic views, and I get an error when I Redirect from the POST request in vote() to the Results page. Details below. The tutorial code says to put this in my urls.py:

Re: Installing via Tutorial Part 2 / MacOSX / Can't create a superuser due to locale() problem.

2012-06-24 Thread Bill Torcaso
Model so > we can create a new user > user = User.objects.create_user(username='someusername', > password='somepassword', is_superuser=True) # Create the new User > (Remember these credentials) > user.save() # Save the User > exit() # Exit the Python Shell > > And you sho

Re: Installing via Tutorial Part 2 / MacOSX / Can't create a superuser due to locale() problem.

2012-06-24 Thread Bill Torcaso
On Friday, June 22, 2012 3:46:42 PM UTC-4, Bill Torcaso wrote: > > > Hi, > I'm working through the tutorail. Part 1 was fine, and part 2 shows me > the site with the light blue background. I proceed to make my first app, > 'djangotest'. > >1. I run django-ad

Installing via Tutorial Part 2 / MacOSX / Can't create a superuser due to locale() problem.

2012-06-22 Thread Bill Torcaso
Hi, I'm working through the tutorail. Part 1 was fine, and part 2 shows me the site with the light blue background. I proceed to make my first app, 'djangotest'. 1. I run django-admin.py and get a project 2. I edit settings.py to select sqlite3, and put in an absolute path to a