Skip to content

Instantly share code, notes, and snippets.

Last active July 24, 2016 22:24
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
django faq

Frequently asked questions:

  • Why shouldn't i use mysql? / mongo?
  • Should I use jinja, I read it's faster?
  • Should I use sqlalchemy, I read it's superior?
  • How do i make this thing happen in parallel/not wait for xxx to finish?
  • Why does django ask for a default? (But my table has no data in it wtf django!?!)
    • FunkyBob | I think, perhaps, it's time I wrote a blog post on "why does a migration adding a field need a default?"
  • Why do I need to commit my migrations? Why can't I just run makemigrations on the server?
  • migrations are source, makemigrations is a helper which takes you part way
  • i've seen people accidentally lose their migrations on production…  oops now what?
  • Why can't I just use locals() for template contexts?

Frequently encountered issues:

  • lack of trailing slash: redirect causing issues with comparisons & tests; POSTs…
  • staticfiles_dirs contains static_root
Copy link

If you want to know why, has comprehensive analysis of the issues with MongoDB and MySQL (look at the MariaDB analysis).

Copy link

darylantony commented Jul 21, 2016

What's the best way to add data to a new non-null field to an existing table? the migration 3 step

Copy link

Oracle's version of "go fuck yourself" is the ORA-00500 error.

Copy link

How do I reset migrations when switching branches? (Not really answerable yet? Docker?)

Copy link

How to tell if verbose_name has been customised?

Avoid regeneration of migrations for inconsequential model fields?

What's the recommended way to create migrations for 3rd party apps? (specify a dependency)

Copy link

bendog commented Jul 21, 2016

Why the duck don't migrations use transactions? : they do, use Postgres

Copy link

shangxiao commented Jul 21, 2016

Some extra FAQ's that I see regularly on irc for a future MelbDjango: (ideally I'd like to survey people in the room to provide more meaningful answers to people who ask these questions)

  • Which editor/development environment should I use?
  • How do I debug my django project anyway? (logging, debuggers, DjDT)

Copy link

sesh commented Jul 24, 2016

What's the deal with static files anyway? Should I have a static directory in my PROJ_ROOT, or should I put them in my apps?

Copy link

sesh commented Jul 24, 2016

Where should I put my project-wide base.html?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment