Django CMS i18n url problems - django

I'm having 404 problems using Django CMS 3.0.0.beta3, Django 1.6.1 and i18n.
When I go to my site, everything is displayed, but when I try to click in the upper bar into Administration or whatever I get a 404 saying:
http://my_server/es-es/admin/
But instead, this URL is working!!
http://my_server/es/admin/
I don't understand why this es-es string puts itself in the middle. I have tried to change the LANGUAGE_CODE to es under settings.py but still nothing.
urls.py
from django.conf.urls import include, patterns, url
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
urlpatterns = i18n_patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^', include('cms.urls')),
)
if settings.DEBUG:
urlpatterns = patterns('',
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
url(r'', include('django.contrib.staticfiles.urls')),
) + urlpatterns
Part of settings.py
SITE_ID = 1
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'cms', # django CMS itself
'mptt', # utilities for implementing a modified pre-order traversal tree
'menus', # helper for model independent hierarchical website navigation
'south', # intelligent schema and data migrations
'sekizai', # for javascript and css management
'djangocms_admin_style', # for the admin skin. You **must** add 'djangocms_admin_style' in the list before 'django.contrib.admin'.
'django.contrib.messages', # to enable messages framework (see :ref:`Enable messages <enable-messages>`)
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware',
)
LANGUAGE_CODE = 'es-es'
TIME_ZONE = 'Europe/Madrid'
USE_I18N = True
USE_L10N = True
USE_TZ = True
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.i18n',
'django.core.context_processors.request',
'django.core.context_processors.media',
'django.core.context_processors.static',
'cms.context_processors.media',
'sekizai.context_processors.sekizai',
)
TEMPLATE_DIRS = (
# The docs say it should be absolute path: PROJECT_PATH is precisely one.
# Life is wonderful!
os.path.join(PROJECT_PATH, "templates"),
)
CMS_TEMPLATES = (
('template_1.html', 'Template One'),
('template_2.html', 'Template Two'),
)
LANGUAGES = [
('en', 'English'),
('es', 'Spanish'),
]

LANGUAGE_CODE should be 'es' and be sure to kill all cookies

Related

django-allauth-2fa: Unexpected behaviour of accounts/two_factor/setup/ -> page reload after pressing 'verify'

I am trying to use django-allauth & django-allauth-2fa in my Django app.
My django-allauth app is set uo correctly - everything is working as expected.
However, when trying to set up django-allauth-2fa I ran into some issues: Configuring a two-factor authentification at accounts/two_factor/setup/ when I scan the QR code, input the token generated and press verify the page simply reloads with a new QR code instead of leading me to the next step in the Two-Factor configuration workflow. I can't figure out what my mistake may be, as I set up everything as written in the django-allauth-2fa documentation
My Pipfile:
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
[packages]
django = "==3.0.0"
pylint = "==2.4.4"
django-crispy-forms = "==1.9"
django-allauth = "==0.42.0"
django-allauth-2fa = "==0.8"
[requires]
python_version = "3.7"
my settings.py file:
...
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
# Local
'users.apps.UsersConfig',
'pages.apps.PagesConfig',
#Third-party
'allauth',
'allauth.account',
'django_otp',
'django_otp.plugins.otp_totp',
'django_otp.plugins.otp_static',
'allauth_2fa',
'crispy_forms',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django_otp.middleware.OTPMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'allauth_2fa.middleware.AllauthTwoFactorMiddleware',
]
SITE_ID = 1
ACCOUNT_ADAPTER = 'allauth_2fa.adapter.OTPAdapter'
...
my urls.py file:
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('accounts/', include('allauth_2fa.urls')),
path('accounts/', include('allauth.urls')),
path('', include('pages.urls')),
]
And I also ran python manage.py migrate
had the same problem on Ubuntu20 . Fix it with enbaling automatic sync date & times.

TemplateDoesNotExist at /join/home.html (Django)

I've went through the other answers here but can't grasp how to fix my version of this problem since this is my first project. I can get 127.0.0.1:8000/admin to show up just fine.
I'm getting this error:
TemplateDoesNotExist at /join/home.html.
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.5.1
Exception Type: TemplateDoesNotExist
Exception Value: /join/home.html.
home.html is located in /Users/user/Desktop/mvp_landing/static/templates/join
In my views.py I have this:
from django.shortcuts import render_to_response, RequestContext
from .models import Join
from .forms import JoinForm
def home(request):
form = JoinForm(request.POST or None)
if form.is_valid():
new_join = form.save(commit=False)
new_join.save()
return render_to_response('/join/home.html.', locals(), context_instance=RequestContext(request))
so I should be ok with what I have here in settings.py for TEMPLATE_DIRS, right?:
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(os.path.dirname(__file__)), "static", "templates"),
)
Here is the entire settings.py(with db info, etc removed):
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
MEDIA_ROOT = os.path.join(os.path.dirname(os.path.dirname(__file__)), "static", "media")
MEDIA_URL = '/media/'
STATIC_ROOT = os.path.join(os.path.dirname(os.path.dirname(__file__)), "static", "static-only")
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(os.path.dirname(os.path.dirname(__file__)), "static", "static"),
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
SECRET_KEY = 'xxxxxxxxxxx'
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'mvp_landing.urls'
WSGI_APPLICATION = 'mvp_landing.wsgi.application'
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(os.path.dirname(__file__)), "static", "templates"),
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
'django.contrib.admindocs',
'south',
'join',
)
and urls.py is this:
from django.conf.urls import patterns, include, url
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
(r'media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}),
url(r'^$', 'join.views.home', name='home'),
# Uncomment the admin/doc line below to enable admin documentation:
url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
)
Any help is appreciated, thanks.
You should fix the path here:
return render_to_response('join/home.html', locals(), context_instance=RequestContext(request))
Notice how I removed the / at the beginning and also the trailing .
Hope this helps
Remove the first slash in the view template string.

Django locale enabled app always returns 404 when debug is off

I've been developing an app that uses i18n/locale as url prefix in the root/landing page. I tried to deploy my application earlier for testing purposes with DEBUG=True and everything was working perfectly. If attempting to access domain.com it would redirect to domain.com/en/
Now, since I disabled DEBUG=False, it won't redirect to /en/, instead it would show 404 error.
I saw this question, which is close to my scenario
Django 1.4 LocaleMiddleware not working with Apache, but works with runserver
but, for my case, I already have the 404 page setup and its handlers and 404.html file.
Below is my code
settings.py
LANGUAGE_CODE = 'en-us'
ADMIN_LANGUAGE_CODE = LANGUAGE_CODE
gettext = lambda s: s
LANGUAGES = (
('ar', gettext('Arabic')),
('en', gettext('English')),
)
USE_I18N = True
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'apps.accounts.middleware.AccountSocialAuthExceptionMiddleware',
'apps.core.middleware.DefaultSiteMiddleware',
# 'debug_toolbar.middleware.DebugToolbarMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS = (
"django.contrib.auth.context_processors.auth",
"django.core.context_processors.debug",
"django.core.context_processors.request",
"django.core.context_processors.i18n",
"django.core.context_processors.media",
"django.core.context_processors.static",
"django.core.context_processors.tz",
"django.contrib.messages.context_processors.messages",
# custom context processors
"snowflake.apps.core.context_processors.project_name",
"snowflake.apps.core.context_processors.sites",
)
and here is my URLs
from django.conf import settings
from django.conf.urls import patterns, include, url
from django.conf.urls.i18n import i18n_patterns
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = patterns('',
url(r'^admin/', include('apps.mod.urls')),
url(r'^redirect/login/$', 'apps.core.views.redirect_to_accounts', name='login-redirect'),
)
urlpatterns += i18n_patterns('',
url(r'^$', 'apps.publication.views.index', name='home'),
url(r'^publication(s)?/', include('apps.publication.urls')),
url(r'^comment(s)?/', include('apps.comment.urls')),
url(r'^rating(s)?/', include('apps.rating.urls')),
url(r'^tag(s)?/', include('apps.taggable.urls')),
url(r'^search/', include('apps.search.urls')),
url(r'^guard(s)?/', include('apps.guard.urls')),
)
handler404 = 'apps.core.views.handler404'
P.S am using django 1.5
Your view apps.core.view.handler404 returns a HttpResponse object... but its HTTP status code is 200.
response = render_to_response("...")
response.status_code = 404
return response
should solve your problem (have had it before).

django-cms and cmsplugin-news

I have been wrangling with Django for some weeks now, putting it down, picking it up, and now I am convinced that it's what I want to use. I got a site up and running with django-cms, but have a small challenge with cmsplugin-news.
I can input news items, list latest news items, and all works fine. However, when I click on an individual news item to view the detail, I get a 404 page not found error.
Here is my urls.py and settings.py file, respectively.
URLS.PY
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^', include('cms.urls')),
url(r'^news/', include('cmsplugin_news.urls')),
)
if settings.DEBUG:
urlpatterns = patterns('',
(r'^' + settings.MEDIA_URL.lstrip('/'), include('appmedia.urls')),
) + urlpatterns
SETTINGS.PY
# -*- coding: utf-8 -*-
import os
gettext = lambda s: s
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email#domain.com'),
)
MANAGERS = ADMINS
LANGUAGES = [('en', 'en'),('jp','jp')]
DEFAULT_LANGUAGE = 0
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(PROJECT_DIR, 'anadacms.db'),
}
}
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media')
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = "http://portal.workpapers.pro/media/"
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/admin/media/'
# Make this unique, and don't share it with anybody.
SECRET_KEY = 'MYSECRETKEY'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.media.PlaceholderMediaMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.auth',
'django.core.context_processors.i18n',
'django.core.context_processors.request',
'django.core.context_processors.media',
'cms.context_processors.media',
)
CMS_TEMPLATES = (
('example.html', 'Basic Template'),
('template_1.html', 'Template One'),
('template_2.html', 'Template Two'),
)
ROOT_URLCONF = 'urls'
CMS_APPLICATIONS_URLS = (
('cmsplugin_news.urls', 'News'),
)
CMS_NAVIGATION_EXTENDERS = (
('cmsplugin_news.navigation.get_nodes', 'News navigation'),
)
TEMPLATE_DIRS = (
os.path.join(PROJECT_DIR, 'templates'),
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'cms',
'menus',
'mptt',
'appmedia',
'south',
'cms.plugins.text',
'cms.plugins.picture',
'cms.plugins.link',
'cms.plugins.file',
'cms.plugins.snippet',
'cms.plugins.googlemap',
'publisher',
'cms.plugins.teaser',
'cms.plugins.video',
'cms.plugins.twitter',
'cmsplugin_facebook',
'cmsplugin_news',
)
Here is a link to the urls.py file for the cmsplugin-news app:
https://bitbucket.org/MrOxiMoron/cmsplugin-news/src/03ba1b86624b/cmsplugin_news/urls.py
The problem is very simple: The cms.urls should always be last in your urlconf because it eats every request.
Changing your urls.py to this should fix it::
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^news/', include('cmsplugin_news.urls')),
# MUST BE LAST!!!
url(r'^', include('cms.urls')),
)
if settings.DEBUG:
urlpatterns = patterns('',
(r'^' + settings.MEDIA_URL.lstrip('/'), include('appmedia.urls')),
) + urlpatterns

Why is Django Caching my static with django.views.static.serve?

I have static.serve setup on my local development server, but it seems to cache static files (in my case, css, javascript and images) until I restart the the server. I am not using apache, and I have the cache set to:
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
Removing the caches declaration all together doesn't seem to help either.
This didn't happen before I upgraded to 1.2.5 from an older 1.1 version.
It's a pain to have to restart the dev server every time (either by touching a python file or via the command line) every time I make a style update.
Edit - as suggested, I've added settings.py and url.py
Settings.py
# Django settings for zeiss_elearning project.
from django.utils.translation import ugettext_lazy as _
gettext = lambda s: s
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Jason Roy', '###'),
)
#Email settings
EMAIL_HOST = '###'
EMAIL_HOST_USER = 'info#btbcreative.com'
EMAIL_HOST_PASSWORD = '####'
DEFAULT_FROM_EMAIL = 'info#btbcreative.com'
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE' : 'django.db.backends.mysql',
'NAME' : '###',
'USER' : '###',
'PASSWORD' : '###',
'HOST' : '/Applications/MAMP/tmp/mysql/mysql.sock',
}
}
TIME_ZONE = 'America/Tijuana'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = True
USE_L10N = True
MEDIA_DEBUG_DOC_ROOT = '/Users/jason/Bird Takes Bear/Projects/Carl Zeiss/site 2.0/media'
MEDIA_ROOT = '/Users/jason/Bird Takes Bear/Projects/Carl Zeiss/site 2.0/media'
MEDIA_URL = '/static_files/'
ADMIN_MEDIA_PREFIX = '/media/admin/'
# Make this unique, and don't share it with anybody.
SECRET_KEY = '####'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.cache.UpdateCacheMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.media.PlaceholderMediaMiddleware',
#'django.middleware.cache.FetchFromCacheMiddleware',
#'debug_toolbar.middleware.DebugToolbarMiddleware',
)
ROOT_URLCONF = 'zeiss_elearning.urls'
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.auth',
'django.core.context_processors.i18n',
'django.core.context_processors.request',
'django.core.context_processors.media',
'cms.context_processors.media',
)
TEMPLATE_DIRS = (,
'/Users/jason/Bird Takes Bear/Projects/Carl Zeiss/site 2.0/templates',
'/Users/jason/Bird Takes Bear/Projects/Carl Zeiss/site 2.0/cms/templates',
)
SESSION_COOKIE_AGE = 86400
LOGIN_URL = '/membership/login/'
LOGIN_REDIRECT_URL = "/"
AUTHENTICATION_BACKENDS = (
'zeiss_elearning.shared.email_auth.EmailBackend',
'django.contrib.auth.backends.ModelBackend',
)
AUTH_PROFILE_MODULE = 'membership.UserProfile'
FORCE_SCRIPT_NAME = ''
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'cms',
'cms.plugins.text',
'cms.plugins.picture',
'cms.plugins.link',
'cms.plugins.file',
'cms.plugins.snippet',
'cms.plugins.googlemap',
'cms.plugins.zeiss_video',
'cms.plugins.html',
'cms.plugins.quiz',
'cms.plugins.popup',
'mptt',
'publisher',
'zeiss_elearning.forms',
'zeiss_elearning.membership',
'zeiss_elearning.quiz',
'menus',
'south',
)
INTERNAL_IPS = ('127.0.0.1',)
#CMS Settings
CMS_REDIRECTS = True
CMS_MENU_TITLE_OVERWRITE = True
CMS_DBGETTEXT = False
CMS_DEFAULT_TEMPLATE = 'base.html'
CMS_ALLOW_HTML_TITLES = False
CMS_TEMPLATES = (
('base.html', _('Default')),
('cirrus.html', _('Cirrus')),
('atlas.html', _('Atlas')),
)
# Site title for your template
CMS_SITE_TITLE = 'Zeiss Cirrus'
CMS_LANGUAGE_REDIRECT = False
CMS_LANGUAGES = (
('en', gettext('English')),
)
LANGUAGES = (
('en', gettext('English')),
)
CMS_APPLICATIONS_URLS = (
('zeiss_elearning.quiz.urls', 'Quiz')
)
urls.py
from django.conf.urls.defaults import *
from django.contrib import admin
from django.conf import settings
admin.autodiscover()
urlpatterns = patterns('',
(r'^membership/', include('zeiss_elearning.membership.urls')),
(r'^admin/', include(admin.site.urls)),
)
urlpatterns += patterns('',
url(r'^', include('cms.urls')),
)
if settings.DEBUG:
urlpatterns += patterns('',
(r'^static_files/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_DEBUG_DOC_ROOT}),)
The bottom line here, based on the data provided, seems to be that your browser is caching the media files. The recommended method to resolve this is super refreshing the pages in your browser. See ALL the comments on your post.
However, If you really do not want the media files to be cached you can simply set them constantly unique names. Like so.
<link rel="stylesheet" type="text/css" href="/site_media/css/style.css?{% now "U" %}" />
Now every time the page is reloaded the filename will be a little bit different based on the unix timestamp, forcing the browser to reload it all the time.