Lots of stuff
- Imagestore gallery - remember me fixed - youtube filter - password change option
BIN
blechreiz/media/cache/07/3b/073b4ac537d95be76268c48c03eae3db.jpg
vendored
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
blechreiz/media/cache/15/01/15012e3332dd2ec2351a4dd53f05733d.jpg
vendored
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
blechreiz/media/cache/69/4c/694c820b26e4bf3148749246ff5f3662.jpg
vendored
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
blechreiz/media/cache/8e/97/8e976f74674d5c1baa3cf2852a680977.jpg
vendored
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 88 KiB |
BIN
blechreiz/media/user_images/Bernd.png
Normal file
|
After Width: | Height: | Size: 88 KiB |
BIN
blechreiz/media/user_images/Birgit.png
Normal file
|
After Width: | Height: | Size: 102 KiB |
BIN
blechreiz/media/user_images/Christina.png
Normal file
|
After Width: | Height: | Size: 120 KiB |
BIN
blechreiz/media/user_images/Florian.png
Normal file
|
After Width: | Height: | Size: 90 KiB |
BIN
blechreiz/media/user_images/MartinB.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
blechreiz/media/user_images/MartinB_1.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
blechreiz/media/user_images/MartinB_thumb.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
blechreiz/media/user_images/Nadine.png
Normal file
|
After Width: | Height: | Size: 97 KiB |
BIN
blechreiz/media/user_images/Rebecca.png
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
blechreiz/media/user_images/Rebecca_1.png
Normal file
|
After Width: | Height: | Size: 2.8 MiB |
BIN
blechreiz/media/user_images/Rebecca_thumb.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
blechreiz/media/user_images/Stefan.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
blechreiz/media/user_images/Stephan.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
blechreiz/media/user_images/Wilhelm.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
blechreiz/media/user_images/martin.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
blechreiz/media/user_images/martin_1.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
blechreiz/media/user_images/martin_thumb.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
blechreiz/media/user_images/rebecca.png
Normal file
|
After Width: | Height: | Size: 2.8 MiB |
BIN
blechreiz/media/user_images/rebecca_1.png
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
blechreiz/media/user_images/rebecca_vildosola.png
Normal file
|
After Width: | Height: | Size: 2.8 MiB |
BIN
blechreiz/media/user_images/rebecca_vildosola_thumb.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
44
blechreiz/middleware.py
Normal file
@@ -0,0 +1,44 @@
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.conf import settings
|
||||
import re
|
||||
|
||||
class EnforceLoginMiddleware(object):
|
||||
"""
|
||||
Middlware class which requires the user to be authenticated for all urls except
|
||||
those defined in PUBLIC_URLS in settings.py. PUBLIC_URLS should be a tuple of regular
|
||||
expresssions for the urls you want anonymous users to have access to. If PUBLIC_URLS
|
||||
is not defined, it falls back to LOGIN_URL or failing that '/accounts/login/'.
|
||||
Requests for urls not matching PUBLIC_URLS get redirected to LOGIN_URL with next set
|
||||
to original path of the unauthenticted request.
|
||||
Any urls statically served by django are excluded from this check. To enforce the same
|
||||
validation on these set SERVE_STATIC_TO_PUBLIC to False.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
self.login_url = getattr(settings, 'LOGIN_URL', '/accounts/login/' )
|
||||
|
||||
if hasattr(settings,'PUBLIC_URLS'):
|
||||
public_urls = [re.compile(url) for url in settings.PUBLIC_URLS]
|
||||
else:
|
||||
public_urls = [(re.compile("^%s/?$" % ( self.login_url[1:] )))]
|
||||
if getattr(settings, 'SERVE_STATIC_TO_PUBLIC', True ):
|
||||
root_urlconf = __import__(settings.ROOT_URLCONF)
|
||||
public_urls.extend([ re.compile(url.regex)
|
||||
for url in root_urlconf.urls.urlpatterns
|
||||
if url.__dict__.get('_callback_str') == 'django.views.static.serve'
|
||||
])
|
||||
self.public_urls = tuple(public_urls)
|
||||
|
||||
def process_request(self, request):
|
||||
"""
|
||||
Redirect anonymous users to login_url from non public urls
|
||||
"""
|
||||
try:
|
||||
if request.user.is_anonymous():
|
||||
for url in self.public_urls:
|
||||
if url.match(request.path[1:]):
|
||||
return None
|
||||
return HttpResponseRedirect("%s?next=%s" % (self.login_url, request.path))
|
||||
except AttributeError:
|
||||
return HttpResponseRedirect("%s?next=%s" % (self.login_url, request.path))
|
||||
|
||||
@@ -70,6 +70,9 @@ STATIC_ROOT = '/'
|
||||
# Example: "http://example.com/static/", "http://static.example.com/"
|
||||
STATIC_URL = '/static/'
|
||||
|
||||
LOGIN_URL="/login"
|
||||
PUBLIC_URLS=( "^login/?$", "^login/usernames/?$")
|
||||
|
||||
# Additional locations of static files
|
||||
STATICFILES_DIRS = (
|
||||
PROJECT_PATH + '/static',
|
||||
@@ -84,7 +87,7 @@ STATICFILES_FINDERS = (
|
||||
'django.contrib.staticfiles.finders.FileSystemFinder',
|
||||
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
||||
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
|
||||
)
|
||||
)
|
||||
|
||||
# Make this unique, and don't share it with anybody.
|
||||
SECRET_KEY = 'x$8&9s6t%eeg=wyhar87934wh_s$dbpm(73g4ho&n)9_wogj6p'
|
||||
@@ -102,6 +105,7 @@ MIDDLEWARE_CLASSES = (
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
||||
'django.contrib.messages.middleware.MessageMiddleware',
|
||||
'blechreiz.middleware.EnforceLoginMiddleware'
|
||||
# Uncomment the next line for simple clickjacking protection:
|
||||
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
)
|
||||
@@ -146,9 +150,14 @@ INSTALLED_APPS = (
|
||||
'eventplanner', # Event Management
|
||||
'simpleforum', # Messages ( Forum )
|
||||
'location_field', # custom location field used in Event Management
|
||||
|
||||
'imagestore',
|
||||
'sorl.thumbnail',
|
||||
'tagging'
|
||||
)
|
||||
|
||||
LOGIN_URL="/login"
|
||||
IMAGESTORE_TEMPLATE = "website/base.html"
|
||||
|
||||
|
||||
|
||||
REST_FRAMEWORK = {
|
||||
|
||||
@@ -2,11 +2,12 @@ from django.conf.urls import patterns, include, url
|
||||
|
||||
from django.contrib import admin
|
||||
|
||||
import website.views
|
||||
import simpleforum.views
|
||||
|
||||
import eventplanner.urls
|
||||
import musicians.urls
|
||||
import imagestore.urls
|
||||
import website.urls
|
||||
|
||||
|
||||
import settings
|
||||
@@ -15,13 +16,11 @@ from django.conf.urls.static import static
|
||||
admin.autodiscover()
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'$^', website.views.home_view ),
|
||||
url(r'^login/$', website.views.login_view),
|
||||
url(r'^login/usernames$', website.views.userlistForAutocompletion),
|
||||
url(r'^logout/$', website.views.logout_view),
|
||||
url(r'^', include(website.urls) ),
|
||||
url(r'^events/', include( eventplanner.urls.urlpatterns) ),
|
||||
url(r'^musicians/', include( musicians.urls.urlpatterns) ),
|
||||
url(r'^messages/$', simpleforum.views.message_view ),
|
||||
url(r'^admin/', include(admin.site.urls) ),
|
||||
url(r'^location_field/', include('location_field.urls')),
|
||||
url(r'^gallery/', include(imagestore.urls, namespace='imagestore') ),
|
||||
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||