Code Monkey home page Code Monkey logo

Comments (6)

nitely avatar nitely commented on July 29, 2024

I've seen it before, It happens when the apps.ready() is not called. I remember restarting the server refreshing the browser and the error was gone... I was not able to reproduce it again.

Can you reproduce it? what python and django versions are you running?

from spirit.

ADcorpo avatar ADcorpo commented on July 29, 2024

I am running Django 1.7.7 and python 3.4 (in a virtualenv).

I am trying to reproduce it but il looks like it doesn't happen when using the development server. I was using nginx+gunicorn when the TypeError showed up.

EDIT: My bad, I was using the pip version on my local server. Will retry with the git version.

from spirit.

nitely avatar nitely commented on July 29, 2024

If you are able to reproduce it, let me know.

I'm almost sure what the problem is... it's a race condition in the djconfig library. It can only happen in the first request (second actually) after you start the server, while the first request is populating the config cache, the second request will try to use it and it'll return None (when accessing the config.topics_per_page in this case).

from spirit.

ADcorpo avatar ADcorpo commented on July 29, 2024

I was able to reproduce it:

Create a fresh virtualenv (python 3), git clone the latest master branch of spirit, install all the requirements via pip install -r, follow the installation instructions described in the README.md

manage.py migrate
manage.py createcachetable spirit_cache
manage.py collectstatic

launch a gunicorn server

gunicorn project.wsgi

Using an administrator account, navigate through the admin panel and create some categories. The TypeError sometimes happen when returning to the forum index. Restarting gunicorn is indeed a temporary solution.

(Sorry if that is not clear enough, this is my first real bug report)

from spirit.

nitely avatar nitely commented on July 29, 2024

It has to be that race condition... I can't seem to reproduce this 😅

Can you run pip install django-djconfig --upgrade and let me know if it keeps happening?
You may have to run python manage.py migrate djconfig --fake-initial afterwards or just remove your database and migrate everything again.

If this happens again it should throw an AttributeError this time.

from spirit.

nitely avatar nitely commented on July 29, 2024

I found what's causing this: https://docs.djangoproject.com/en/1.7/ref/settings/#timeout

The cache keys will expire after five minutes! 😂

Thank you! I will release a fix ASAP.

from spirit.

Related Issues (20)

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.