Data dodania Pytanie
2018-01-16 18:01 form.is_valid() is returning False when using ModelForm »
I am creating a form using ModelForm to let the users upload a file along with a description . The is_valid() function isn't returning true and I am r...
(2) odpowiedzi
2018-01-16 04:01 How to deal with two websites with one backend CSRF issue in one browser? »
How to deal with the independent home website and admin website CSRF issue in one browser? We have written a home website frontend and an admin webs...
(3) odpowiedzi
2018-01-16 00:01 How can I escape underscores in Django's field lookups? »
By default, Django cannot support trailing underscores in field names because it messes up field lookups. Unfortunately, I've found myself in a situat...
(1) odpowiedzi
2018-01-15 12:01 How to change manager for custom User model »
I've defined a custom user model: class User(AbstractUser): REQUIRED_FIELDS = [] USERNAME_FIELD = 'email' email = models.EmailField( ...
(1) odpowiedzi
2018-01-15 11:01 Why is there both a create_user and a _create_user method in django.contrib.auth.models.UserManager »
In the source for django, there is a UserManager class whose job (as far as I understand) is to create users according to a number of received paramet...
(1) odpowiedzi
2018-01-15 08:01 django datetime declaration error »
I added the following code in models.py : class Conference(models.Model): conf_name = models.CharField(max_length=250) location = models.Char...
(1) odpowiedzi
2018-01-14 17:01 django website is giving 404 error for static files »
Having problem with staticfiles in Django 2. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) TEMPLATE_DIR = o...
(2) odpowiedzi
2018-01-14 16:01 Empty dictionary request.FILES when image posted from Android »
I am trying to make an Android application that would post the taken photo to django server using Retrofit framework. My android part: private void...
(0) odpowiedzi
2018-01-14 00:01 Django objects.get matching query does not exist »
I'm trying to get all attributes of a single object. I keep getting a "Devices matching query does not exist." I just cannot figure out my issue. M...
(3) odpowiedzi
2018-01-13 19:01 Django Internationalization - Gettext error »
Am building a site with Django. After downloading gettext-0.19.8.tar.gz ---> /Users/cohen/Downloads/gettext-0.19.8 and running all of the steps ./conf...
(2) odpowiedzi
2018-01-13 16:01 Django Error - TemplateSyntaxError at / Could not parse the remainder: '['userType']' from '['userType']' »
{% if 'is_logged_in' in request.session %} {% if request.session['userType'] == 0 %} {% include 'headersuccess.html' %} {% else %}dfgh {% endif %} ...
(1) odpowiedzi
2018-01-13 13:01 Loading Image in a React+Django app »
So I have a little project written in python/django for the backend and react for the frontend. I followed the tutorial from: http://geezhawk.github.i...
(1) odpowiedzi
2018-01-12 20:01 Django crudbuilder & Bootstrap datepicker »
Django==1.11.7 django-crudbuilder==0.2.5 Using Bootstrap datepicker. Now trying to use the datepicker in a crud form for a date field. In a normal ...
(1) odpowiedzi
2018-01-12 12:01 how to use signal in thread »
I want to run a function in background. so I use Threading in my code. but return error ValueError: signal only works in main thread and don't know a...
(0) odpowiedzi
2018-01-12 10:01 AttributeError: 'WSGIRequest' object has no attribute 'user' »
I'm running my Django code, but get this error AttributeError: 'WSGIRequest' object has no attribute 'user' My Django version is 1.8.2, and here is...
(1) odpowiedzi
2018-01-11 20:01 How to get objct information from Ajax response in JSON »
I'm working on a site that needs to parse an Ajax response which looks something like this: {"comments": "[{\"model\": \"modelhandler.comment\", \"p...
(1) odpowiedzi
2018-01-11 12:01 The best way to store constants in Django »
I have a Django application and use GitHub for CI. Now I run into the problem that I have a merge conflict with constants import every time I merge. ...
(2) odpowiedzi
2018-01-11 04:01 How do I retrieve lat & long coordinates from the client without them needing to POST once? »
I'd like to do some server side processing with their lat/long as soon as they agree to share them--I'd like for the results of that processing to be ...
(1) odpowiedzi
2018-01-11 03:01 CSRF token missing or incorrect from form on `/` »
I have this in urls.py: url("^$", direct_to_template, {"template": "index.html"}, name="home"), url("^searched-location", views.searched_location, na...
(1) odpowiedzi
2018-01-10 17:01 pytest.mark.parametrize with django.test.SimpleTestCase »
I am using pytest 3.2.2 and Django 1.11.5 on Python 3.6.2 on Windows. The following code import django.test import pytest class ParametrizeTest: ...
(2) odpowiedzi
2018-01-10 16:01 Django ManytoMany filter exact list with duplicate items »
This is extension for the question Django ManytoMany filter exact list Looks like accepted answer doesn't work when list contains duplicates. Is ther...
(1) odpowiedzi
2018-01-10 13:01 AuthToken in Django Rest FrameWork: non_field_errors »
I m trying to integrate token based authentication in DRF(Django version 1.10) but when I hit api-token-auth/ using {"username":"test","password":"123...
(2) odpowiedzi
2018-01-09 17:01 Difference between Django JSONField and TextField »
I have to save a JSON string to a Django model and am curious as to which field type I should use. I have seen a JSONField used before, but surely a T...
(1) odpowiedzi
2018-01-09 12:01 How to Make Iterator for do sum of a field from n number of objects »
Lets say i have a model class Testmodel(): amount = models.IntegerField(null=True) contact = models.CharField() Now I am making a query like...
(2) odpowiedzi
2018-01-09 08:01 django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. (django 2.0.1)(Python 3.6) »
It's my first time trying to deploy a Django app(django 2.0.1)(Python 3.6) to pythonanywhere, it is a simple portfolio app with no models, no bootstra...
(1) odpowiedzi
2018-01-08 16:01 Django Model check data type integrity before saving »
I have a Django project where I am forced to do a raw sql query (so not using a Model for saving this information), but I still want to check for corr...
(1) odpowiedzi
2018-01-08 12:01 Docker - Django settings - Gunicorn ok but not manage.py »
I read quite a few posts about this but still no solution... I have a docker-compose project with, among other, a django service that I build. On my...
(1) odpowiedzi
2018-01-08 07:01 Querying the Database | Django »
Here's my models, class Question(models.Model): question_text = models.CharField() class Answer(models.Model): question = models.ForeignKey(...
(0) odpowiedzi
2018-01-07 23:01 Wagtail moving sqlite to postgres database »
The issue I have an empty (migrated) postgres database to which I want to move the data from my sqlite database. What I've tried I export with ....
(0) odpowiedzi
2018-01-07 22:01 Django-bleach import and deploy to heroku error »
I am using Django 1.11. I'm using in my Django application the django-bleach that was installed with: pip install django-bleach Here the lib folde...
(1) odpowiedzi
2018-01-07 18:01 Django: How to submit a form to either create new object or get an existing one? »
Using django1.11.4. I am trying to make a page for adding an item to the database, however, to do this, I need to create/get several different object...
(1) odpowiedzi
2018-01-06 17:01 Django Database create_or_update error »
So the definition for the pcaps table is : class Pcaps(models.Model): uuid = models.CharField(max_length=50, unique=True) filename = models.C...
(1) odpowiedzi
2018-01-06 15:01 Django: Submitting same form multiple times causes 403 CSRF exception »
I have a form which creates a trip. This form is submitted via AJAX, trip created and then, the form inputs are cleared so user can create another ite...
(1) odpowiedzi
2018-01-06 11:01 Create Many to Many Create/Update in modelSerializer with through table »
Here are my models from django.db import models class Person(models.Model): name = models.CharField(max_length=128) class Group(mo...
(1) odpowiedzi
2018-01-06 06:01 NOT NULL constraint failed error when populating foreign key field »
I'm trying to run a script I wrote to move some data from json files into my database, and keep getting the same error. Traceback: Traceback (most r...
(1) odpowiedzi