Git Product home page Git Product logo

django-tools's Issues

Include migrations in dynamic_site

This module is not working because migrations are missing. Gives the error:

django.db.utils.OperationalError: no such table: dynamic_site_sitealias

logo contribution

DJTOOLS

Hello @jedie I contribute to open source softwares by designing logos. I designed a functional logo for this repo. It will look like this in the readme file :

dj2

What do you think about the logo?

Mode Version Protect: Handle if version == 0

Adding VersionProtectBaseModel to existing models will set version=0 via migrations. This version doesn't work well, because a "overwrite" with version 0 in admin will result in "version field is missing" form error:

grafik

LICENSE permissive?

I have nothing wrong with GPL, but users probably don't want to have their website or libraries pulling in django-tools becoming a derivative of it. Can you release this under a permissive license like ISC, MIT, BSD, Apache 2, etc?

add throttle feature...

In PyLucid i have a simple ban function. The Principe is simple: I add logging entries and if in a defined time too many entries, the IP address would be added to the ban model. This model would be used in the middleware to ban…

Models:

middleware:

A better idea is to use the cache, like the throttle decorator in django-piston: https://bitbucket.org/jespern/django-piston/src/7c90898072ce/piston/utils.py#cl-108

Can werkzeug.local be used instead of threading.local in ThreadLocal.py?

Is it because django does not need to test the following conditions?

This approach, however, has a few disadvantages. For example, besides threads, there are other types of concurrency in Python. A very popular one is greenlets. Also, whether every request gets its own thread is not guaranteed in WSGI. It could be that a request is reusing a thread from a previous request, and hence data is left over in the thread local object.

werkzeug.local Context Locals

Thanks! :D

Awkward Versioning on PyPi

The current version on django-tools on PyPi is 0.24.02.0710. That alone is not that odd. However once installed the version is shown as 0.24.02. This creates problem with trying to pin the version with a requirements file demonstrated below:

$ pip install django-tools
Downloading/unpacking django-tools
Downloading django-tools-0.24.2.0710.tar.gz (51Kb): 51Kb downloaded
...
Successfully installed django-tools
$ pip freeze | grep django-tools
django-tools==0.24.2

Now installing attempting to install this exact version errors:

$ pip install django-tools==0.24.2
Downloading/unpacking django-tools==0.24.2
Could not find a version that satisfies the requirement django-tools==0.24.2 (from versions: )
No distributions matching the version for django-tools==0.24.2

And trying to install the version including the date stamp works (pip install django-tools==0.24.2.0710) but fails if it is in a requirements file (That this works on the command line but not in a requirements file is noted in a pip bug: pypa/pip#145):

$ pip install -r dependencies.txt 
Downloading/unpacking django-tools==0.24.2.0710 (from -r dependencies.txt (line 20))
  Downloading django-tools-0.24.2.0710.tar.gz (51Kb): 51Kb downloaded
  Running setup.py egg_info for package django-tools
    warning: no files found matching 'README.textile'
    warning: no files found matching '*.css' under directory 'django_tools\templates'
    warning: no files found matching '*.js' under directory 'django_tools\templates'
    warning: no previously-included files matching '*.py[co]' found under directory '*'
  Source in c:\documents and settings\lavin\my documents\aptana studio workspace\origin\build\django-tools has the version 0.24.2, which does not match the
requirement django-tools==0.24.2.0710 (from -r dependencies.txt (line 20))
Source in c:\documents and settings\lavin\my documents\aptana studio workspace\origin\build\django-tools has version 0.24.2 that conflicts with django-tools==0.24.2.0710 (from -r dependencies.txt (line 20))

Removing the date stamp from the version number is probably the easiest solution but might not be desirable to you. In any case the version number should be constantly reported (always with the date or always without) to prevent this conflict error.

Adding django_tools.dynamic_site to INSTALLED_APPS fails with "Models aren't loaded yet."

I'm using Django 1.7.5 and when I tried adding django_tools.dynamic_site to the project it failed with:

$ src/landrover/manage.py runserver
Traceback (most recent call last):
  File "src/landrover/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/kitsunde/.virtualenvs/landrover/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/Users/kitsunde/.virtualenvs/landrover/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute
    django.setup()
  File "/Users/kitsunde/.virtualenvs/landrover/lib/python2.7/site-packages/django/__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/kitsunde/.virtualenvs/landrover/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/Users/kitsunde/.virtualenvs/landrover/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models
    self.models_module = import_module(models_module_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/kitsunde/.virtualenvs/landrover/lib/python2.7/site-packages/django_tools/dynamic_site/models.py", line 31, in <module>
    from django_tools.models import UpdateInfoBaseModel
  File "/Users/kitsunde/.virtualenvs/landrover/lib/python2.7/site-packages/django_tools/models.py", line 26, in <module>
    User = auth.get_user_model()
  File "/Users/kitsunde/.virtualenvs/landrover/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 137, in get_user_model
    return django_apps.get_model(settings.AUTH_USER_MODEL)
  File "/Users/kitsunde/.virtualenvs/landrover/lib/python2.7/site-packages/django/apps/registry.py", line 199, in get_model
    self.check_models_ready()
  File "/Users/kitsunde/.virtualenvs/landrover/lib/python2.7/site-packages/django/apps/registry.py", line 131, in check_models_ready
    raise AppRegistryNotReady("Models aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.

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.