--- /dev/null
+# Generated by Django 4.2.6 on 2023-10-25 09:33
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('blog', '0002_auto_20190723_1612'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='blogentry',
+ name='id',
+ field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
+ ),
+ migrations.AlterField(
+ model_name='blogsection',
+ name='id',
+ field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
+ ),
+ ]
{% else %}
|
{% endif %}
- {% ifequal paginator_page page %}
+ {% if paginator_page == page %}
{{ page }}
{% else %}
<a href="?page={{ paginator_page }}">{{ paginator_page }}</a>
- {% endifequal %}
+ {% endif %}
{% endfor %}
{% if has_next %}
| <a href="?page={{ next }}">Next</a>
-from django.conf.urls import url
+from django.urls import re_path
import blog.views
from settings import MEDIA_ROOT, MEDIA_URL
urlpatterns = [
- url(r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<day>[0-9]{2})/(?P<slug>[^/]+)(/|)$', blog.views.blog_view),
- url(r'^(?P<year>[0-9]{4})(?P<month>[0-9]{2})(?P<day>[0-9]{2})-(?P<slug>[^/]+)\.html$', blog.views.blog_view),
- url(r'^(?P<year>[0-9]{4})(?P<month>[0-9]{2})(?P<day>[0-9]{2})(?P<hour>[0-9]{2})(?P<minutes>[0-9]{2})-(?P<slug>[^/]+)\.html$', blog.views.blog_view),
- url(r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<day>[0-9]{2})/$', blog.views.blog_view),
- url(r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/$', blog.views.blog_view),
- url(r'^(?P<year>[0-9]{4})/$', blog.views.blog_view),
- url(r'^section/(?P<section>[^/]*)/$', blog.views.blog_index),
- url(r'^$', blog.views.blog_index),
+ re_path(r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<day>[0-9]{2})/(?P<slug>[^/]+)(/|)$', blog.views.blog_view),
+ re_path(r'^(?P<year>[0-9]{4})(?P<month>[0-9]{2})(?P<day>[0-9]{2})-(?P<slug>[^/]+)\.html$', blog.views.blog_view),
+ re_path(r'^(?P<year>[0-9]{4})(?P<month>[0-9]{2})(?P<day>[0-9]{2})(?P<hour>[0-9]{2})(?P<minutes>[0-9]{2})-(?P<slug>[^/]+)\.html$', blog.views.blog_view),
+ re_path(r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<day>[0-9]{2})/$', blog.views.blog_view),
+ re_path(r'^(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/$', blog.views.blog_view),
+ re_path(r'^(?P<year>[0-9]{4})/$', blog.views.blog_view),
+ re_path(r'^section/(?P<section>[^/]*)/$', blog.views.blog_index),
+ re_path(r'^$', blog.views.blog_index),
]
# find where we are in the tree first
folderpath = request.path
folderpath = re.sub(u'^%s' %(settings.BPCMS_ROOT), '', folderpath)
+
# right - that should be any prefix got rid of, now traverse the tree till
# we've got something
- menu_items = cache.get('bpcms_contentmenu_%s' %(folderpath))
+ try:
+ menu_items = cache.get('bpcms_contentmenu_%s' %(folderpath))
+ except:
+ # fail on cache engine or bad key, ignore
+ return {
+ 'content_submenu': {},
+ }
if not menu_items:
folder = None
--- /dev/null
+# Generated by Django 4.2.6 on 2023-10-25 09:33
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('bpcms', '0002_auto_20190723_1612'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='cssdocument',
+ name='id',
+ field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
+ ),
+ migrations.AlterField(
+ model_name='document',
+ name='folder',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='bpcms.folder'),
+ ),
+ migrations.AlterField(
+ model_name='document',
+ name='id',
+ field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
+ ),
+ migrations.AlterField(
+ model_name='folder',
+ name='id',
+ field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
+ ),
+ migrations.AlterField(
+ model_name='folder',
+ name='parent',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='bpcms.folder'),
+ ),
+ ]
-from django.conf.urls import url
+from django.urls import re_path
import bpcms.views
urlpatterns = [
- url(r'^$', bpcms.views.document_view, {'slug': 'index'}, name='bpcms-document-view'),
- url(r'^css-docs/(?P<slug>[^/]+)$', bpcms.views.css_view),
- url(r'^(?P<slug>[^/]+)/$', bpcms.views.document_view, name='bpcms-document-view'),
- url(r'^(?P<folders>.*)/(?P<slug>[^/]+)/$', bpcms.views.document_view, name='bpcms-document-view'),
+ re_path(r'^$', bpcms.views.document_view, {'slug': 'index'}, name='bpcms-document-view'),
+ re_path(r'^css-docs/(?P<slug>[^/]+)$', bpcms.views.css_view),
+ re_path(r'^(?P<slug>[^/]+)/$', bpcms.views.document_view, name='bpcms-document-view'),
+ re_path(r'^(?P<folders>.*)/(?P<slug>[^/]+)/$', bpcms.views.document_view, name='bpcms-document-view'),
]
from django import template
from django.conf import settings
-from django.utils.encoding import smart_bytes, force_text
+from django.utils.encoding import smart_bytes, force_str
from django.utils.safestring import mark_safe
from generic import docutils_xhtml11
except ImportError:
if settings.DEBUG:
raise template.TemplateSyntaxError("Error in {% restructuredtext %} filter: The Python docutils library isn't installed.")
- return force_text(value)
+ return force_str(value)
else:
docutils_settings = getattr(settings, "RESTRUCTUREDTEXT_FILTER_SETTINGS", {})
parts = publish_parts(source=smart_bytes(value), writer=docutils_xhtml11.Writer(), settings_overrides=docutils_settings)
- return mark_safe(force_text(parts["fragment"]))
+ return mark_safe(force_str(parts["fragment"]))
restructuredtext.is_safe = True
register.filter(restructuredtext)
--- /dev/null
+# Generated by Django 4.2.6 on 2023-10-25 09:33
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('photo', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='album',
+ name='id',
+ field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
+ ),
+ migrations.AlterField(
+ model_name='photo',
+ name='id',
+ field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
+ ),
+ ]
{% else %}
|
{% endif %}
- {% ifequal paginator_page page_obj.number %}
+ {% if paginator_page == page_obj.number %}
{{ paginator_page }}
{% else %}
<a href="?page={{ paginator_page }}">{{ paginator_page }}</a>
- {% endifequal %}
+ {% endif %}
{% endfor %}
{% if page_obj.has_next %}
| <a href="?page={{ page_obj.next_page_number }}">Next</a>
{% else %}
|
{% endif %}
- {% ifequal paginator_page page_obj.number %}
+ {% if paginator_page == page_obj.number %}
{{ paginator_page }}
{% else %}
<a href="?page={{ paginator_page }}">{{ paginator_page }}</a>
- {% endifequal %}
+ {% endif %}
{% endfor %}
{% if page_obj.has_next %}
| <a href="?page={{ page_obj.next_page_number }}">Next</a>
-from django.conf.urls import url
+from django.urls import re_path
from photo.models import Album
from photo.views import AlbumListView, PhotoListView, PhotoView
urlpatterns = [
- url(r'^$', AlbumListView.as_view()),
- url(r'^(?P<slug>[^/]*)/$', PhotoListView.as_view()),
- url(r'^(?P<slug>[^/]*)/(?P<id>[0-9]+)/$', PhotoView.as_view()),
+ re_path(r'^$', AlbumListView.as_view()),
+ re_path(r'^(?P<slug>[^/]*)/$', PhotoListView.as_view()),
+ re_path(r'^(?P<slug>[^/]*)/(?P<id>[0-9]+)/$', PhotoView.as_view()),
]
"www.sommitrealweird.co.uk",
"www.sommitrealweird.co.uk.",
"10.0.3.191",
+ "127.0.0.1",
+ "localhost",
]
MANAGERS = ADMINS
}
}
+DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
+
+DEBUG = True
+
+
TIME_ZONE = 'Europe/London'
LANGUAGE_CODE = 'en-gb'
MEDIA_ROOT = os.path.join(topdir, 'media') + os.sep
MEDIA_URL = '/media/'
-STATIC_ROOT = '/usr/lib/python3/dist-packages/django/contrib/admin/static/'
+STATIC_ROOT = '/home/brettp/python-envs/django/lib/python3.11/site-packages/django/contrib/admin/static/'
STATIC_URL = '/static/'
import random
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
- 'django.contrib.admindocs.middleware.XViewMiddleware',
)
ROOT_URLCONF = 'urls'
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
+ 'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'django.template.context_processors.debug',
-from django.conf.urls import include, url
+from django.urls import include, re_path
from django.conf.urls.static import static
import bpcms.views
import django.views.static
# (r'^sommitrealweird/', include('sommitrealweird.foo.urls')),
# Uncomment this for admin:
- url(r'^$', bpcms.views.document_view, {'slug': 'index'}),
- url(r'^media/(?P<path>.*)$', django.views.static.serve, {'document_root': MEDIA_ROOT, 'show_indexes': True}),
- url(r'^static/(?P<path>.*)$', django.views.static.serve, {'document_root': STATIC_ROOT, 'show_indexes': True}),
- url(r'^admin/', admin.site.urls),
- url(r'^blog/', include('blog.urls')),
- url(r'^photo/', include('photo.urls')),
+ re_path(r'^$', bpcms.views.document_view, {'slug': 'index'}),
+ re_path(r'^media/(?P<path>.*)$', django.views.static.serve, {'document_root': MEDIA_ROOT, 'show_indexes': True}),
+ re_path(r'^static/(?P<path>.*)$', django.views.static.serve, {'document_root': STATIC_ROOT, 'show_indexes': True}),
+ re_path(r'^admin/', admin.site.urls),
+ re_path(r'^blog/', include('blog.urls')),
+ re_path(r'^photo/', include('photo.urls')),
#url(r'^photos/', include('photo.urls')),
- url(r'^css-doc/(?P<slug>.*)$', bpcms.views.css_view),
- url(r'^feeds/rss/blog/', LatestBlogEntriesRss()),
- url(r'^feeds/blog/', LatestBlogEntries()),
- url(r'^', include('bpcms.urls'))
+ re_path(r'^css-doc/(?P<slug>.*)$', bpcms.views.css_view),
+ re_path(r'^feeds/rss/blog/', LatestBlogEntriesRss()),
+ re_path(r'^feeds/blog/', LatestBlogEntries()),
+ re_path(r'^', include('bpcms.urls'))
]