Giter Club home page Giter Club logo

django-statictemplate's People

Contributors

asmaps avatar bdon avatar dbenamy avatar gotenxiao avatar michael-k avatar ojii avatar yakky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

django-statictemplate's Issues

Deprecation warnings on Django 1.9.1

Thanks for this great library! It looks like the recent release of 1.9 deprecates some apis:

python manage.py statictemplate --language-code en-us index.html -f public/index.html

WARNING:py.warnings:.../src/django-statictemplate/statictemplate/management/commands/statictemplate.py:114: RemovedInDjango110Warning: django.conf.urls.patterns() is deprecated and will be removed in Django 1.10. Update your urlpatterns to be a list of django.conf.urls.url() instances instead.
  url('^', include(settings.ROOT_URLCONF))

WARNING:py.warnings:.../lib/python2.7/site-packages/django/core/management/base.py:265: RemovedInDjango110Warning: OptionParser usage for Django management commands is deprecated, use ArgumentParser instead
  RemovedInDjango110Warning)

WARNING:py.warnings:.../lib/python2.7/site-packages/django/template/loader.py:97: RemovedInDjango110Warning: render() must be called with a dict, not a RequestContext.
  return template.render(context, request)

Release branch new_django as 3.0

Hi!

Would it be possible to make a new release with the branch new_django? It's currently broken for all new django versions, so installing from pypi doesn't work and we have to use the github version instead, which is not ideal.

Using i18n_patterns in an included URLconf is not allowed.

I just tried the app and for some raison I get this exception : django.core.exceptions.ImproperlyConfigured: Using i18n_patterns in an included URLconf is not allowed.
Is the code compatible with django 1.5 and i18n_pattens ?

thanks

EDIT: just readed the i18n_patterns code who says it is forbidden, nothing to do with djangostatictemplate it seems.

Support for modifying new-style middleware

the override_middleware context manager only supports the MIDDLEWARE_CLASSES setting, not the new MIDDLEWARE setting for 1.10+*

*I'm using a copy of the git repo, as there's not a release subsequent to 2.0.1 which runs under 1.10

I think this diff would fix it:

 def override_middleware():
     from ...settings import OVERRIDE_MIDDLEWARE
     if OVERRIDE_MIDDLEWARE:
-        has_old = hasattr(settings, 'MIDDLEWARE_CLASSES')
-        old = getattr(settings, 'MIDDLEWARE_CLASSES', None)
-        settings.MIDDLEWARE_CLASSES = (
+        if hasattr(settings, 'MIDDLEWARE'):
+            mw_setting = 'MIDDLEWARE'
+        else:
+            mw_setting = 'MIDDLEWARE_CLASSES'
+        has_old = hasattr(settings, mw_setting)
+        old = getattr(settings, mw_setting, None)
+        setattr(settings, mw_setting, (
             'django.contrib.sessions.middleware.SessionMiddleware',
             'django.contrib.auth.middleware.AuthenticationMiddleware',
             'django.middleware.csrf.CsrfViewMiddleware',
             'django.middleware.locale.LocaleMiddleware',
             'django.middleware.common.CommonMiddleware',
-        )
+        ))
         yield
         if has_old:
-            setattr(settings, 'MIDDLEWARE_CLASSES', old)
+            setattr(settings, mw_setting, old)
         else:  # NOQA
-            delattr(settings, 'MIDDLEWARE_CLASSES')
+            delattr(settings, mw_setting)
     else:
         yield  # pragma: no cover

Aside: Is there a reason that using the override_settings context manager wouldn't work to the same effect?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.