mirror of
https://github.com/evennia/evennia.git
synced 2026-03-28 02:36:32 +01:00
WINDOWS USERS: (This applies to UNIX/Linux as well, but is probably more interesting to Windows users). You may now open up your settings.py file and add SERVE_MEDIA=True to serve media directly from Django. This is useful when you're running Django's built-in development server and want to be able to get to your CSS/Images, or if you have an apache server and don't want to configure a media location. Note that this is NOT something you want in a production environment, as it's slow, and may pose security risks. However, this will get you up and running very quickly for web work. The new setting, SERVE_MEDIA, is defaulted to False and is in the latest settings.py.dist file.
This commit is contained in:
parent
a1f46603d0
commit
dfc358ada8
2 changed files with 22 additions and 4 deletions
|
|
@ -45,6 +45,13 @@ SITE_ID = 1
|
|||
# to load the internationalization machinery.
|
||||
USE_I18N = False
|
||||
|
||||
# If you'd like to serve media files via Django (strongly not recommended!),
|
||||
# set SERVE_MEDIA to True. This is appropriate on a developing site, or if
|
||||
# you're running Django's built-in test server. Normally you want a webserver
|
||||
# that is optimized for serving static content to handle media files (apache,
|
||||
# lighttpd).
|
||||
SERVE_MEDIA = False
|
||||
|
||||
# Absolute path to the directory that holds media.
|
||||
# Example: "/home/media/media.lawrence.com/"
|
||||
MEDIA_ROOT = '%s/media' % (BASE_PATH)
|
||||
|
|
|
|||
19
urls.py
19
urls.py
|
|
@ -7,11 +7,22 @@
|
|||
#
|
||||
|
||||
from django.conf.urls.defaults import *
|
||||
import settings
|
||||
|
||||
urlpatterns = patterns('',
|
||||
# Admin interface
|
||||
(r'^admin/', include('django.contrib.admin.urls')),
|
||||
# Admin interface
|
||||
(r'^admin/', include('django.contrib.admin.urls')),
|
||||
|
||||
# Front page
|
||||
(r'^', include('apps.website.urls')),
|
||||
# Front page
|
||||
(r'^', include('apps.website.urls')),
|
||||
)
|
||||
|
||||
# If you'd like to serve media files via Django (strongly not recommended!),
|
||||
# open up your settings.py file and set SERVE_MEDIA to True. This is
|
||||
# appropriate on a developing site, or if you're running Django's built-in
|
||||
# test server. Normally you want a webserver that is optimized for serving
|
||||
# static content to handle media files (apache, lighttpd).
|
||||
if settings.SERVE_MEDIA:
|
||||
urlpatterns += patterns('',
|
||||
(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue