Commit Graph

66 Commits

Author SHA1 Message Date
Aymeric Augustin ca07fda2ef [py3] Switched to Python 3-compatible imports.
xrange/range will be dealt with in a separate commit due to the huge
number of changes.
2012-07-22 09:29:56 +02:00
Aymeric Augustin 0d914d08a0 [py3] Updated urllib/urllib2/urlparse imports.
Lots of functions were moved. Use explicit imports in all cases
to keey it easy to identify where the functions come from.
2012-07-22 09:29:55 +02:00
Claude Paroz 91727c76cd Cleaned up WSGIRequestHandler get_environ to be Python 3 compatible
headers.type/typeheader attributes are gone in Python 3. Thanks
Vinay Sajip for the inspiration of his Python 3 branch.
2012-05-18 19:40:41 +02:00
Claude Paroz 865cd35c9b Made more extensive usage of context managers with open. 2012-05-05 14:06:36 +02:00
Claude Paroz 596cb9c7e2 Replaced print statement by print function (forward compatibility syntax). 2012-04-30 20:45:03 +02:00
Claude Paroz 3904b74a3f Fixed #18013 -- Use the new 'as' syntax for exceptions.
Thanks Clueless for the initial patch.
Note that unittest has been purposely left out (external package only used by Python 2.6).
2012-04-29 20:57:15 +02:00
Claude Paroz 5c53e30607 Fixed #18035 -- Removed deprecated AdminMediaHandler, as per official deprecation timeline. Thanks Jannis Leidel and Ramiro Morales for the review.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17879 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-04-08 21:13:32 +00:00
Julien Phalip ef5c873dba Fixed #6163 -- Made "manage.py help runfcgi" display proper default values for the runfcgi options. Thanks to ash and Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17330 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-01-02 19:20:47 +00:00
Carl Meyer 145a77edc9 Fixed #16360 -- Added WSGI entrypoint to startproject layout, and enabled internal servers (runserver and runfcgi) to use an externally-defined WSGI application. Thanks to Armin Ronacher, Jannis Leidel, Alex Gaynor, ptone, and Jacob Kaplan-Moss.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17022 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-22 04:30:10 +00:00
Jannis Leidel 24f4764a48 Fixed #16225 -- Removed unused imports. Many thanks to Aymeric Augustin for the work on the patch and Alex for reviewing.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-13 09:35:51 +00:00
Jannis Leidel 38a2444277 Fixed #16050 -- BACKWARDS-INCOMPATIBLE CHANGE: Moved static files of the admin to conventional file system location.
This also removes the need for ADMIN_MEDIA_PREFIX and replaces it with the convention to find admin's static files at STATIC_URL + 'admin/'.

Thanks to Jacob for the review and general help.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16487 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-30 09:06:19 +00:00
Jannis Leidel ce165f7bbf Fixed #16099 -- Enabled threading for the runserver management command and added a --nothreading option to disable it if needed. This should help Google Chrome users because it opens more than one connection speculatively.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16427 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-17 13:08:36 +00:00
Jannis Leidel 8f4d394c74 Fixed #14903 -- Removed much of the code in django.core.servers.basehttp that was previously copy-pasted from the wsgiref module which was added to Python 2.5. Many thanks to maxbublis and aaugustin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16288 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-28 21:28:52 +00:00
Jannis Leidel 6b95aa6fb5 Fixed #15531 -- Partially reverted [15701] due to compatibility issues with middlewares that modify content of responses. Thanks for the report, schinckel. Refs #15281.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15703 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-02 10:40:48 +00:00
Jannis Leidel be4a2e3f3e Fixed #15281 -- Made the static view use an iterator when serving a file, effectively making this less of a memory hog. Also use the appropriate attributes of the stat object instead of indexes. Thanks for the initial patch, FunkyBob and aaugustin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15701 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-01 22:49:10 +00:00
Jannis Leidel a26034ffbf Fixes #15270 -- Moved back the serve view to django.views.static due to dependency conflicts with the contrib app staticfiles (reverts parts of r14293). Added a helper function that generates URL patterns for serving static and media files during development. Thanks to Carl for reviewing the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15530 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-14 01:42:26 +00:00
Jannis Leidel 6a32e253f6 Fixed #7735 -- Added support for IPv6 adresses to runserver and testserver management command. Thanks to Jason Alonso and Łukasz Rekucki for the report and initial patches.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14711 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-26 13:33:53 +00:00
Jannis Leidel 96af304747 Fixed #10636 -- Added check to make sure the ADMIN_MEDIA_PREFIX setting is properly set before serving files with the AdminMediaHandler.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14593 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-17 15:36:42 +00:00
Jannis Leidel 33d8fcde8a Fixed #14693, #14709 -- Backwards incompatible change to rectify the confusion around the STATICFILES_URL and STATICFILES_ROOT settings.
* Two new global settings that will be used by -- **but are not limited to** -- the staticfiles app: STATIC_ROOT and STATIC_URL.

  * Moving the 'django.contrib.staticfiles.templatetags.staticfiles' template tag to the core ('django.templatetags.static') and renaming it to 'get_static_prefix'.

  * Moving the context processor 'django.contrib.staticfiles.context_processors.staticfiles' to the core ('django.core.context_processors.static') and renaming it to 'static'.

  * Paths in media definitions will use STATIC_URL as the prefix if the value is not None, and falls back to the previously used MEDIA_URL.

Thanks again to the community for constructive criticism and Carl and Russ for sanity-inducing discussions on IRC.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14592 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-17 15:36:26 +00:00
Jannis Leidel 8e96584f63 Fixed #14524, #14582, #14617, #14665 and #14667 -- Tweaked staticfiles app.
* Updated StaticFilesHandler and AdminMediaHandler
  to make use of the 404 handler if needed.

* Updated runserver management command to serve static files
  only in DEBUG mode (or if specified the --insecure option)
  and if the staticfiles app is in INSTALLED_APPS. Also added
  an option to disable serving completely (--nostatic).

* Added check in debug mode if STATICFILES_* settings are
  different to MEDIA_* settings.

* Removed a faulty PendingDeprecationWarning in AdminMediaHandler
  that is triggered every time runserver is used.

* Fixed an issue with the modification time checks when
  running collectstatic.

* Extended and refined documentation.

Thanks to everyone for input, especially to Carl Meyer, Ted Kaemming and
Adam Vandenberg for patches.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14533 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-11 21:43:49 +00:00
Ramiro Morales 0b39bf02b9 Fixed #14398 -- Changed runfcgi command to interpret the umask option argument as an octal value.
Thanks petteyg for report and aptiko for help with the fix.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14360 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-27 15:12:13 +00:00
Jannis Leidel cfc19f84de Fixed #12323 and #11582 -- Extended the ability to handle static files. Thanks to all for helping with the original app, the patch, documentation and general support.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14293 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-20 01:33:24 +00:00
Russell Keith-Magee a904e55859 Fixed #11509 -- Modified usage of "Web" to match our style guide in various documentation, comments and code. Thanks to timo and Simon Meers for the work on the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14069 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-09 08:12:50 +00:00
Russell Keith-Magee e71b10efb7 Added color configuration for HTTP 304, since it doesn't require as much attention as other 3XX codes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12281 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-23 17:26:56 +00:00
Adrian Holovaty 5ceed0a053 Changed a whole bunch of places to raise exception instances instead of old-style raising exception classes plus a comma. Good for the future Python 3 conversion
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12180 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-10 18:36:20 +00:00
Russell Keith-Magee 77e27e7de7 Fixed #7679 -- Added (configurable) highlighting colors to the development server. Thanks to Rob Hudson, hunteke, and Bastian Kleineidam for the various patches that contributed to the final result.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12085 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-04 12:16:09 +00:00
Russell Keith-Magee 8bee4604a1 SECURITY ALERT: Corrected a problem with the Admin media handler that could lead to the exposure of system files. Thanks to Gary Wilson for the patch.
This is a security-related update. A full announcement, as well as backports for 1.0.X and 0.96.X will be forthcoming.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11351 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-07-29 02:40:14 +00:00
Jacob Kaplan-Moss bfdb7d26aa Fixed #9659: fixed `wsgi.file_wrapper` in the builtin server. Thanks, mitsuhiko.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10690 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-07 15:39:06 +00:00
Jacob Kaplan-Moss c860758a57 Fixed #8895: expose the debug setting to fastcgi. Thanks, paulegan.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10345 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-01 21:37:34 +00:00
Malcolm Tredinnick 85733c5d51 Fixed #10556 -- Fixed a problem in the fastcgi server after r10088.
Thanks, Boo.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10101 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-20 01:43:35 +00:00
Jacob Kaplan-Moss c485e236bd Fixed #8193: all dynamic imports in Django are now done correctly. I know this because Brett Cannon borrowed the time machine and brought Python 2.7's '`importlib` back for inclusion in Django. Thanks for the patch-from-the-future, Brett!
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10088 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-18 16:55:59 +00:00
Adrian Holovaty cc7b0f986a Fixed #8409 -- The runserver now uses conditional GET for admin media files, instead of reloading the files off disk for every request. Thanks for reporting, andylowry
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9055 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-17 05:42:12 +00:00
Malcolm Tredinnick 5f7bb13f27 Fixed #6647 -- Add some more robustness to the development web server.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7801 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-30 11:32:50 +00:00
Malcolm Tredinnick ca5918e8ff Fixed #6994 -- For fastcgi, set a more sensible default umask.
Also allow the umask value to be customised. Thanks, Antonis Christofides.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7800 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-30 11:22:41 +00:00
Adrian Holovaty 8089eec6cf Fixed #7527 -- Removed an unused value from __all__ in django.core.servers.basehttp. It had languished there erroneously since the original checkin in Django changeset [174]. Thanks, trevor
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 04:03:44 +00:00
Jacob Kaplan-Moss a752a3d419 Fixed #6687: added outlog/errlog options to runfcgi. Thanks, tamas.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7297 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-18 15:53:46 +00:00
Malcolm Tredinnick b279b75c87 Fixed #5596 -- Changed the static view for the development server so that Django doesn't crash if somebody tries to serve a 200MB file. Patch from eibaan.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6939 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-17 11:46:48 +00:00
Malcolm Tredinnick 4262765649 Fixed some type checks in the development server. Fixed #6063.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6780 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-30 18:28:19 +00:00
Gary Wilson Jr 8c442f21dc Fixed #5816 -- Fixed a regression from [6333] that generates incorrect cookie "expires" dates when using a locale other than English. Introduced `http_date` and `cookie_date` utility functions. Thanks for the report Michael Lemaire. Thanks for the patch Karen Tracey and `SmileyChris`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6634 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-31 03:59:40 +00:00
Adrian Holovaty 71504127fd Fixed #5369 -- Refactored the django-admin.py help system, allowing each subcommand to register its own options. Thanks for the patch, Todd O'Bryan
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6075 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-09 21:57:59 +00:00
Malcolm Tredinnick c92ce31d60 Fixed #4898 -- Fixed a precendence problem when constructing HTTP Date header.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5721 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-17 04:22:11 +00:00
Malcolm Tredinnick 5dd9a2ab38 Fixed #4199 -- Changed date formatting in HTTP expires header to be spec
compliant. Thanks, Chris Bennett.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5712 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-16 03:50:22 +00:00
Malcolm Tredinnick 880e3cfaa6 Backed out the changes in [5482] for a bit whilst some more investigation into
side-effects is done. Refs #4565.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5511 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-22 07:15:04 +00:00
Adrian Holovaty 761c0a49e4 Fixed #4549 -- WSGI server now sets mime type correctly for admin media content. Thanks, Stefane Fermgier
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5502 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-20 06:16:56 +00:00
Malcolm Tredinnick bccb8897e6 Fixed #4565 -- Changed template rendering to use iterators, rather than
creating large strings, as much as possible. This is all backwards compatible.
Thanks, Brian Harring.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5482 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-17 07:11:37 +00:00
Malcolm Tredinnick 439cb4047f Fixed #4040 -- Changed uses of has_key() to "in". Slight performance
improvement and forward-compatible with future Python releases. Patch from Gary
Wilson.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-26 13:30:48 +00:00
Malcolm Tredinnick 70c4a88e82 Added support for SCGI and AJP. This is a piece that was missed in [4897]. Refs
#3047.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@4902 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-01 07:30:27 +00:00
Adrian Holovaty b6a7afd4bd Changed Flup (FastCGI) backend to set debug=False, to turn off tracebacks in case of error. Thanks, Jared Kuolt
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4170 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-07 03:04:22 +00:00
Jacob Kaplan-Moss 0fd9f6ec6b Fixed $2973: added minspare/maxspare/maxchildren options to runfcgi. Thanks, James Crasta.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4033 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-11-07 02:01:16 +00:00
Russell Keith-Magee 7bff9cc368 Fixes #2969 -- Added maxRequests option for FCGI servers. Thanks, Michael Radziej.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3954 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-10-31 12:27:55 +00:00