Changes between Version 89 and Version 90 of IrcFAQ


Ignore:
Timestamp:
01/09/2009 09:55:08 AM (7 years ago)
Author:
pbx
Comment:

removed some not-asked-frequently-anymore questions

Legend:

Unmodified
Added
Removed
Modified
  • IrcFAQ

    v89 v90  
    4747Have you looked here? http://code.djangoproject.com/wiki/WindowsInstall
    4848
    49 == What should I use for development -- the built-in server, mod_python, FastCGI? == #WhichServer
    50 
    51 It's generally easiest to use the [http://www.djangoproject.com/documentation/django-admin/#runserver-optional-port-number-or-ipaddr-port built-in development server] for development, since it automatically reloads your Python source files when it detects changes. Apache needs to be restarted to see changes to your source files (unless you set {{{MaxRequestsPerChild 1}}}, which you should do with caution since it is not suitable for production).
    52 
    53 Some prefer to replicate the production environment as closely as possible, meaning that if their deployed project uses mod_python then their development server does as well.
    54 
    55 == What database should I use? == #WhichDB
    56 
    57 For development, most people find SQLite to be fastest and simplest to run with -- just make sure the database file and its directory are writeable by the owner of the web server process. For production, PostgreSQL and MySQL are the most thoroughly-tested of the databases Django supports, but it's best to choose based on the needs of your applications; for example, applications which do very little writing of data to the DB will enjoy the speed of SQLite, but applications which involve many complex queries or which require robust concurrent-write features like transaction isolation will probably want to look at Postgres or MySQL (and, of course, MySQL is often handy simply because many shared hosting providers have it set up by default).
    58 
    59 
    6049= Troubleshooting =
    6150
     
    7362
    7463[http://dpaste.com/ Pasting] your code is often helpful. Don't forget to set the syntax when you paste so that the proper colorizing is applied -- that makes it easier for us to read your stuff. The Django debug page has a handy button for automatically sharing traceback code.
    75 
    76 == I'm using the development version (via Subversion) and when I ran "svn up" a bunch of stuff broke! == #SvnUp
    77 
    78 If you use the development version of Django, follow the BackwardsIncompatibleChanges and the [http://code.djangoproject.com/timeline timeline], so you can see what has changed *before* you update. 
    79 
    80 That way, changes like [http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#Auto-escapingintemplates auto-escaping of HTML in templates] won't catch you by surprise.
    8164
    8265== My media/static files (CSS, images, etc.) aren't showing up. == #MediaTroubles
     
    128111Both mod_python and FastCGI are structured in such a way that there's no such thing as "application startup" or "server startup"; the best solution is to place your "startup" code somewhere that's guaranteed to be imported early on in the request/response cycle (the `__init__.py` file of your project, or of a specific application you're using, can be a good place, because Python will execute code found there the first time it has to import the module; just be aware that referencing the same module in different ways, say by doing `from myproject.myapp import foo` in one place, and `from myapp import foo` in another, will cause that code to be executed once for each different way you import it).
    129112
    130 == Do I have to hard-code my media URL in all my templates for CSS, images and Javascript? == #MediaURL
    131 
    132 No; you can use {{{{{ MEDIA_URL }}}}}. If you're using generic views, you can use {{{{{ MEDIA_URL }}}}} without changing anything.
    133 
    134 If you're using render_to_response(), you'll have to include RequestContext, as described here: http://docs.djangoproject.com/en/dev/ref/templates/api/#subclassing-context-requestcontext
    135 
    136 If you're using 0.96 or later, you can get the same functionality by creating a template context processor, as described: http://www.b-list.org/weblog/2006/jun/14/django-tips-template-context-processors/
    137 
    138 
    139113== How do I use Django in a shell script? == #Shell
    140114
    141115http://www.b-list.org/weblog/2007/sep/22/standalone-django-scripts/
    142116
    143 == Can I use the Date/Time picker !JavaScript from the Admin in my own app? == #DatePicker
    144 Short answer: No.
    145 
    146 Long answer: It is possible, but requires reusing the Admin JS and CSS, and is more trouble than it is worth. Most !JavaScript frameworks (such as [http://developer.yahoo.com/yui/ YUI], [http://dojotoolkit.org/ Dojo], [http://jquery.com/ jQuery], and [http://www.prototypejs.org/ Prototype]) provide similar functionality, either out of the box or through plugins. Additionally, there are many !JavaScript snippets available across the Web.
    147 
    148117== I want to repeat a bit of dynamic information (eg from a database) on many views. Do I have to change every view? ==
    149118
    150119No, you can use an [http://www.djangoproject.com/documentation/templates_python/#inclusion-tags inclusion tag].
    151 
    152 == If I change my model, will {{{manage.py syncdb}}} update my database table? == #ModelChanges
    153 
    154 No, you'll need to manually change your database table. If you use `manage.py sqlall` on your app to produce a SQL file before editing your models, you can run it again afterwards and use the difference between the two to see what you need to change in the database.
    155 
    156120
    157121
     
    163127
    164128You can learn more about Python's handy profiling tools in the [http://docs.python.org/lib/profile.html Python documentation].
    165 
    166 == What editor is best for Django? == #WhichEditor
    167 
    168 [wiki:UsingVimWithDjango Vim]. No, wait, [wiki:Emacs Emacs]. A lot of people seem to like TextMate, too. The best editor is the editor ''you'' prefer.
    169129
    170130== Where can I find example code and/or reusable apps? == #ShowMeTheCode
     
    188148
    189149Yes, it's very handy -- see DjangoBot for more.
     150
Back to Top