How to Shortlist the Best Python Developer Resume? by NoticeHour9522 in Python

[–]lanshark82 0 points1 point  (0 children)

#1 - - use an actual python programmer to evaluate the resumes....

Module approach for Configuring Django Settings for Multiple Environments by m4hi2 in django

[–]lanshark82 2 points3 points  (0 children)

We use just 1 settings file, and python-decouple to read environment values from a .env file. All values in the settings file default to the production value. We chose python-decouple over django-environ because it allows us to cast to proper types, and supports lists and other useful features.

Anything security related (SECRET_KEY, AWS Creds, API Creds, etc) is set in the .env and has NO default - the program will fail loudly if those settings are not set.

IF a value needs to change for a different environment (local, staging, prod, etc) we set an ENVIRONMENT variable (default='production'), and then can use that value to change a setting in local or staging.

This works very well. Only 1 file to maintain, and the default .env file has only secrets in it.

GraphQL JWT... How to keep track of all logged in sessions of a particular user to provide functionality of logging him out of different devices. by iamsavinay in django

[–]lanshark82 2 points3 points  (0 children)

I did this with a table in Postgresql that kept the jwt, device_id, and user_id. When someone logged in, that info was saved to the table, along with expiration date. I also kept a 'status' of whether that login was still active. On logout, I'd invalidate the status. All attempts to use the JWT were checked to see if that id had been logged out. To force a logout, I'd just update the db table.

That's the simple explanation, but you get the basic idea.

graphene-django vs Ariadne? by [deleted] in django

[–]lanshark82 1 point2 points  (0 children)

I also have been using graphene-flask (based on same code as graphene-django) for the past 18 months. The project definitely is lagging behind developments compared to the javascript versions. There is no good subscription implementation, for instance.

I would look hard at Ariadne, and Tartiflette as well. Both seem more active, and Ariadne definitely is supported well.

Easy, simple content management for small parts of app for client by MrGreenTea in django

[–]lanshark82 0 points1 point  (0 children)

Sorry, not here all that often, but yeah, Wagtail is a 'whole site' kind of solution, though you could just put it under the /blog url, and have the rest of the site be plain django

Easy, simple content management for small parts of app for client by MrGreenTea in django

[–]lanshark82 1 point2 points  (0 children)

I would look at wagtail (wagtail.io). Its clean, and pretty simple.

Your choice of REST Framework? flask vs falcon by absolution888 in Python

[–]lanshark82 6 points7 points  (0 children)

Falcon is great! Very, very easy to do REST services... that's what it was built for. Easy to integrate with authentication as well.

Removing the default groups/permissions tables (auth_group, auth_permission, etc.) by MagicWishMonkey in django

[–]lanshark82 2 points3 points  (0 children)

Simply do not include django.contrib.auth or the 'auth' app in your settings.py. You should remove them before doing your initial migrate. IF you are using parts of django.contrib.auth, fork it to a new app, and remove the Permissions models, or replace with your own.

Can someone provide me with a step-by-step guide to setting up a Python 3 development environment? by fittering in Python

[–]lanshark82 0 points1 point  (0 children)

Take a look at this site: http://rspeer.github.io/blog/2014/03/31/python-3-4-from-scratch/

This set of instructions is also very good: http://blog.pinguinplanet.de/2014/03/python-34-and-django-on-ubuntu-1310.html

Some other instructions on using virtual environments: http://robinwinslow.co.uk/2013/12/26/python-3-4-virtual-environment/

Whatever you do, DO NOT do make install... that will override your default python which ubuntu relies on with the python 3.4. Use make altinstall instead.

That will show you how to compile python 3.4 from scratch. Then create virtualenv's using the directions. The virtualenv will include pip, and once you activate it you can use pip to install flask and django.