diff --git a/INSTALL b/INSTALL index 273df7922..7319d08c2 100644 --- a/INSTALL +++ b/INSTALL @@ -1144,14 +1144,13 @@ First, adapt the following parameters to your environnement:: RRD_ROOTDIR = "/tmp/modoboa" # Path to directory where png files are stored - IMG_ROOTDIR = "/static/graphs" + IMG_ROOTDIR = "/media/stats" -Make sure the directories that will contain those files exist. If not, -create them before going further. For example (according to the previous +Make sure the directory that will contain those files exist. If not, +create it before going further. For example (according to the previous parameters):: $ mkdir /tmp/modoboa - $ mkdir /static/graphs To finish, you need to collect information periodically in order to feed the rrd files. To do so, just add the following line into root's diff --git a/extensions/stats/scripts/logparser.py b/extensions/stats/scripts/logparser.py index 8ec49213e..0d9a9adc4 100755 --- a/extensions/stats/scripts/logparser.py +++ b/extensions/stats/scripts/logparser.py @@ -66,7 +66,7 @@ class LogParser(object): self.workdict = {} self.lupdates = {} - self.line_expr = re.compile("(\w+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+(\w+)\s+(\w+)/?\w*[[](\d+)[]]:\s+(.*)") + self.line_expr = re.compile("(\w+)\s+(\d+)\s+(\d+):(\d+):(\d+)\s+([-\w]+)\s+(\w+)/?\w*[[](\d+)[]]:\s+(.*)") def init_rrd(self, fname, m): """init_rrd diff --git a/urls.py b/urls.py index 6ac80bdae..691119871 100644 --- a/urls.py +++ b/urls.py @@ -23,10 +23,12 @@ urlpatterns = patterns('', ) if settings.DEBUG: - urlpatterns += patterns( - url(r'^media/(?P.*)$', 'django.views.static.serve', - {'document_root': settings.MEDIA_ROOT, 'show_indexes' : True}), - url(r'', include('django.contrib.staticfiles.urls')), - ) - - + from django.contrib.staticfiles.urls import staticfiles_urlpatterns + from django.conf.urls.static import static + urlpatterns += staticfiles_urlpatterns() + urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) +# urlpatterns += patterns( +# url(r'^media/(?P.*)$', 'django.views.static.serve', +# {'document_root': settings.MEDIA_ROOT, 'show_indexes' : True}), +# url(r'', include('django.contrib.staticfiles.urls')), +# )