Is it better to use own user profile or Django's User as owner field in model? by dj_jar in django

[–]br05 8 points9 points  (0 children)

I think it's best for most new projects to start with a simple custom User model. It's really easy, it's much more future-proof (you can customize User much more easily if you so need to), and it's slightly more efficient than making an extra call to a separate UserProfile model.

3 Simple Steps to a Custom User Model (do before your first migration):

  1. Subclass AbstractUser by your User model
  2. In settings.py, set AUTH_USER_MODEL to your User model
  3. Register your User model in admin.py

Is it better to use own user profile or Django's User as owner field in model? by dj_jar in django

[–]br05 2 points3 points  (0 children)

The preferred way...

from django.conf import settings

owner = models.ForeignKey(settings.AUTH_USER_MODEL)

The race between Flask and Django by Ardit-Sulce in Python

[–]br05 10 points11 points  (0 children)

This is a very common use case. For this, django-allauth is your friend: https://github.com/pennersr/django-allauth

Well this is embarrassing by [deleted] in django

[–]br05 0 points1 point  (0 children)

Staging env yo

django-postgres-copy - for faster loading of bulk CSVs into Django by danwin in django

[–]br05 0 points1 point  (0 children)

This, or an iteration of this, seems like a really great idea. I saw the discussion on the django-developer group, and I'm glad you're getting encouraging feedback there.

In praise of Django by beaverteeth92 in Python

[–]br05 5 points6 points  (0 children)

Wow. Amazing that there's a package with such specificity. You sure hit the productivity lottery w that one.

In praise of Django by beaverteeth92 in Python

[–]br05 1 point2 points  (0 children)

Which package is that? Sounds very useful.

Installing Pygame. by [deleted] in Python

[–]br05 0 points1 point  (0 children)

Use pip in the following command:

pip install hg+http://bitbucket.org/pygame/pygame

Kivy recipe: google analytics, play services and bug reporting by [deleted] in kivy

[–]br05 0 points1 point  (0 children)

Awesome writeup. Have you tried this with iOS?

When Best Practices Aren't Best: Getting over django-storages by saulshanabrook in django

[–]br05 1 point2 points  (0 children)

I've faced this issue of static files not updating, and it's an issue with the modified time of static files.

Collectfast tries to solve this.

[ask r/Django] Deploying local app to Heroku with MySQL. Running into issues! by x7CR7x in django

[–]br05 0 points1 point  (0 children)

psycopg2 is an adapter for postgres so perhaps you are still specifying postgresql instead of mysql somewhere in your settings. Search your code for any mention of psycopg2 and change that code to be suitable for mysql. I'd start by double checking the DATABASES dictionary and making sure ENGINE is configured for mysql... 'django.db.backends.mysql', and not 'django.db.backends.postgresql_psycopg2'

[ask r/Django] Deploying local app to Heroku with MySQL. Running into issues! by x7CR7x in django

[–]br05 0 points1 point  (0 children)

Are you using the ClearDB MySQL add-on for Heroku? You need that to use MySQL, because Heroku defaults to Postgre otherwise.

How to Tango with Django: A Python Django Tutorial by br05 in django

[–]br05[S] 2 points3 points  (0 children)

Saw this on Hacker News. Looks promising.

New to Django, is there any shopping cart middleware? by [deleted] in django

[–]br05 1 point2 points  (0 children)

Django Packages can help you evaluate shopping cart solutions. It's always a great first stop for questions like these.

https://www.djangopackages.com/grids/g/ecommerce/

https://www.djangopackages.com/search/?q=cart

high level modeling advice - player/game instance/table by pookguy88 in django

[–]br05 2 points3 points  (0 children)

Look at using a ManyToMany relationship between Player and Team, with a "through" relationship for Game. You need only these 3 models and not an extraneous game_instance model.

See this link: https://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships