Django template tag to display Django version

What is the simplest way to create a Django template tag which displays the Django version on a template? I want to put the following in a Django template and have it output the Django version (in...

Django - Media upload [Errno 13] Permission denied

I'm having some trouble getting django to play nice with image uploads. My script will create directories based on the date like so: file = models.FileField(upload_to='uploads/%m-%Y/') Now, if I...

Python counting significant digits

I tagged this question as javascript because even though I currently wrote this in Python, if it would be easier to implement in Javascript, I could easily implement it in Javascript. My...

Mac OS X 10.6, Mysql, Mysql-Python, Django

UPDATE: I came across this post: https://stackoverflow.com/questions/5072066/python-mysqldb-on-mac-osx-10-6-not-working saw two options: Add MySQL client libraries to the...

From virtualenv, pip freeze > requirements.txt give TONES of garbage! How to trim it out?

I'm following this tutorial: http://devcenter.heroku.com/articles/django At some point I'm suposed to do: pip freeze > requirements.txt (Ofc. from virtualenv created instance of python) And I...

Setting DEBUG = False causes 500 Error

Once I change the DEBUG = False, my site will generate 500 (using wsgi & manage.py runserver), and there is no error info in Apache error log and it will run normally when I change debug to True...

Integrate SASS/SCSS with Django

I want to use SASS/SCSS with Django application. I followed the link https://bitbucket.org/synic/django-sass. I installed SASS using sudo pip install sass. When i run Python manage.py...

ImportError: No module named sekizai

I have installed all three dependencies according to the document (Python 2.6, 2.7, 3.2 or higher. Django 1.2.7 or higher. django-classy-tags 0.3.1 or higher) But when I add ‘sekizai’ into my...

Calling django template tags from a normal function

How to call django template tags from a normal function? For instance: Django template tag: @register.filter(name='CallingTemplateTagFunction') def CallingTemplateTagFunction(price): return...

Single Dropdown with search box in it

I want to add search box to a single select drop down option. Code: <select id="widget_for" name="{{widget_for}}"> <option value="">select</option> {% for key, value in dr.items %} <input...

Python/Django date field in html input tag

I'm trying to display a date in an input field as so: <tr><td>Date of Birth</td><td><input type="date" name="DOB" value="{{m.dob|date:"d/m/Y"}}" required=True></td></tr> where m.dob is defined...

How to embed matplotlib graph in Django webpage?

So, bear with me as I'm VERY new to Django, Python, and web-development in general. What I want to do is display a graph that I've made using matplotlib. I had it working to where the home page...

Template solutions similar to thymeleaf "natural templates" for jinja2/python/django?

I use [tag:jinja2] with [tag:google-app-engine] and I'm happy with it, it's just that I would like to collaborate with a front-end programmer who does CSS and HTML without forcing him to run the...

Append file md5 hash to url in PHP

I want to append md5 hash to css and js files to able to long-term cache them in browser. In Python Django there is a very easy way to do this, static template tag...

sqlite3.OperationalError: no such table: django_content_type

I am trying to run app not written by me app. When I write python manage.py makemigrations I got: Traceback (most recent call last): File...

Prevent autoescaping custom template tags in django

I'm upgrading my old project to latest versions of python/django and am having trouble with custom template tags. Template tag definition: from django import template register =...

Moving from Django 1.3 to Django 1.11 object_list

I'm trying to update some python files from Django 1.3 to Django 1.11. In the views.py file I have a method with the following line return object_list(request, queryset=results['flips'],...

Django: how to fully decouple apps when it seems they are coupled?

Note: I am not a proper python programmer... but I use python extensively. I do things like write classes with inheritance, use iterators and comprehension, etc. My point is that I do not have a...

SendGrid Django Template tags returning HTTP Error 400: Bad Request

Having an annoying issue. I am using Django to send data to sendGrid templates. But when I add substitutions I get a HTTP Error 400: Bad Request. If I dont add anything in the dictionary it works...

pass two value to a template tag

im new in django and python . in my template i need to pass two value to a template tag . this two value come from view.py .i read ...

TypeError: 'datetime.date' object is not subscriptable

I'm trying to create a custom template tag which takes 3 arguments. I'm trying to calculate the number of days between two dates, while excluding the weekends days from that count. And depending...

Custom tags (templatetags) not loading

I'm trying to create a template tag so I can find out which group the current user belongs to. I have the same set up in another project but that one is working, but this one does not. This is...

How to upload an image to a folder and pass its path to a view function in django?

I want to upload an image file using an input file tag from a django template. Then i want to do 2 things: First i want to store the uploaded image in a directory in my project. I want to upload...

Django inline formset will always create new object instead of update them

I've 2 model First and Second with a FK from Second to First. I created a form for the 2 class and a inline formset for Second. On template I manually designed my form and with jQuery I'm able to...

send metatags through Google Cloud Signed URL with Django

I'm using signed url to get or post/put video fileq on my google storage. My modules refers on signed_url V4 and it's working quite well. I wanted to add some metadata tags to my requests in order...

Why do we need Django REST framework since Django templates are available?

I have a question about the REST API and would be thankful if you could help me with it. As we know, Django provides a template engine along with template tags to include python data types inside...

Why getting a 403 error on plesk trying to run Django

Been following a tutorial on udemy for python, and atm im suppose to get a django app deployed. Since I already had a vps, I didnt go with the solution on the tutorial using google cloud, so tried...

How to use template tags in javascript? Django

I am using python(Django), I created a template tag which returns an array of dictionary, now I want to use it in my javascript. It works fine when I call it from views by dumping in JSON format...

Why does this gRPC call from the Google Secret Manager API hang when run by Apache?

In short: I have a Django application being served up by Apache on a Google Compute Engine VM. I want to access a secret from Google Secret Manager in my Python code (when the Django app is...

reference a HTML tag with javascript that was generated from django json schema

I am trying to reference a HTML tag that is generated by a django's django_jsonforms link JSON Schema link via javascript to dynamically update the form. For example 2 dropdowns in a form, if you...