Skip to content
Advertisement

Tag: django

Django: create endpoint for a file

I have a mesh.obj file and I would like to create an endpoint for it. For example, the endpoint could be of the form ‘path/to/mesh’. How would I do this? Answer In your urls.py: In your views.py:

Django Exception KeyError ‘data’ – Only runs once

I am trying to make a web app using Django that accepts 2 inputs from the user: Mathematical Operator: 1 for addition, 2 for multiplication, etc. Number of Pages Based on this, a math worksheet is generated and downloaded. All of this works out fine, but only once. When I try to regenerate a second PDF, I get an exception:

Django filter on combination using F

I wrote the following query using the Django ORM: With this I’m trying to filter out each fixture where the prediction__value for the home is greater than 0.0 and the prediction__value of the away is greater than 0.0. Sadly my query is returning 0 records upon using .count() whereas it should return almost every record. When I only use one

Add a date picker to an already existing html form with Django

I have this template that i use for my Django app : I want to add a date picker (actually two of them) in the specified location in the code, the dates would then be sent as a variable when user click on submit form. I tried following the walkthrough tutorial for django-bootstrap-datepicker-plus but it just doesn’t fit right for

Django urls.py issue, not sure what to put in ‘urlpatterns’

I’ve been following this tutorial (Django Tutorial Part 3) and I’ve stumbled across what I’m assuming is a syntax issue between the time this tutorial was written and the new Django releases. My admin page loads just fine. Code Block in Question So in the picture linked, that is the area that I am having trouble with from the tutorial.

Why do I get an 404 Error in part 4 of the Django tutorial “Writing you first Django app”

I am trying to complete the Django tutorial: Writing your first Django app. I am currently stuck on part 4. After updating my template polls/templates/polls/detail.html, rewriting my polls/views.py and creating a results.html located at polls/templates/polls/results.html, I ran the server and tried to go to http://127.0.0.1:8000/polls/1/, but I get this Error: I see that the error is raised by the html-file

Advertisement