Django on Heroku, the url template tag calls a ParseResult object that cannot be called

Does anyone know what Heroku will change when deployed? I have a local installation for developers with Ubuntu 11.10, and my project is installed in venv, all packages are managed through pip. The relevant .txt requirements are in my repo and sent to Heroku when clicked. Both my local machine and Heroku access one instance of RDS on AWS.

Starting the Django dev server locally (manage.py runningerver) results in a working page. Trying to start (via my Procfile) a dev server on Heroku causes an error in the template in {% url foobar%} as follows:

Caught TypeError while rendering: 'ParseResult' object is not callable 

My requirements.txt contains the following:

 Django==1.3.1 MySQL-python==1.2.3 PIL==1.1.7 amqplib==1.0.2 anyjson==0.3.1 boto==2.2.2 celery==2.5.1 distribute==0.6.24 django-celery==2.5.1 django-kombu==0.9.4 django-picklefield==0.2.0 django-piston==0.2.3 gevent==0.13.6 greenlet==0.3.4 gunicorn==0.14.2 httplib2==0.7.4 kombu==2.1.1 python-dateutil==1.5 wsgiref==0.1.2 zencoder==0.4 

Does anyone have an idea?

+4
source share
2 answers

I had a similar problem (actually in urls.py and not in rendering a template) using django-piston. I managed to fix this by changing

 from django.conf.urls.defaults import url 

to

 from django.conf.urls.defaults import url as django_url 

and then changing all url () directives in urlpatterns to django_url ().

This also fixed the pattern that I saw on the admin pages. I am not sure that this is one and the same, but it can be fruitful.

0
source

Although Iโ€™m afraid that I canโ€™t talk in detail about your problem, in connection with the question โ€œDoes anyone know what Heroku will change during deployment?โ€ And then for Django applications this is simply the following:

Heroku DB configuration configuration added to your settings.py

It simply overrides the existing DATABASES parameter by pulling DATABASE_URL in the environment and parsing it accordingly.

Basic Procfile is auto-generated if you do not already have it

Do not rely on this, since the generated Procfile simply uses the Django development server (replace it, for example, with one of the running guns) ), but all you need to start the base project.

added added shared database 5 MB

This simply ensures that your application will have access to the database.


Now I donโ€™t see how any of them will cause the problem you are having, but you seem to have sorted , which is good.

+1
source

Source: https://habr.com/ru/post/1402349/


All Articles