Skip to content

Instantly share code, notes, and snippets.

@shangxiao
Last active July 24, 2016 22:24
Show Gist options
  • Save shangxiao/fdcdf47aaaedc8e7ce0e9338df1e28c0 to your computer and use it in GitHub Desktop.
Save shangxiao/fdcdf47aaaedc8e7ce0e9338df1e28c0 to your computer and use it in GitHub Desktop.
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
@darylantony
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

@pizzathief
Copy link

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

@darylantony
Copy link

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

@darylantony
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)

@bendog
Copy link

bendog commented Jul 21, 2016

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

@shangxiao
Copy link
Author

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)

@sesh
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?

@sesh
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