Data dodania Pytanie
2017-10-15 16:10 django admin edit model select/prefetch_related? »
I have a Django website, with model Event, lets say: class Event(models.Model): home = models.ForeignKey('Team', related_name='%(class)s_home')...
(2) odpowiedzi
2017-10-15 08:10 Python/Django: Selecting max value of one-to-many relation and displaying it in HTML/View »
Good Day SO, I am a beginner in Django and python, just started learning two days ago. This qn is related to this question: Python/Django: How to sh...
(2) odpowiedzi
2017-10-15 00:10 django rest 400 responce when putting date field »
I am putting a datetime value to my drf backend. This is my code: models.py class MyModel(models.Model): .... date = models.DateField(blan...
(2) odpowiedzi
2017-10-14 15:10 Django queryset - Filtering related table objects before aggregation »
Consider this model in Django documentation: Aggregation and Avg There is a queryset like this: Author.objects.annotate(average_rating=Avg('book__ra...
(1) odpowiedzi
2017-10-14 07:10 Variable not found. Declare it as envvar or define a default value »
I am very new to Django and trying to configure python-decouple to use .env variables. I am getting DB_PASSWORD not found. Declare it as envvar or def...
(1) odpowiedzi
2017-10-14 01:10 Django: Search Function If No Initial Data »
def search(request): query = request.GET.get('q') .... .... return render(request, 'search.html', {'list': list}) form looks like th...
(1) odpowiedzi
2017-10-13 18:10 Django query filter using large array of ids in Postgres DB »
I want to pass a query in Django to my PostgreSQL database. When I filter my query using a large array of ids, the query is very slow and goes up to 7...
(2) odpowiedzi
2017-10-13 14:10 Changes to django's urls.py not reflected online »
I'm running a Django application using NGINX and UWSGI. My URLpatterns used to be this: urlpatterns = [ url(r'^$', views.index), url(r'^bi...
(1) odpowiedzi
2017-10-13 14:10 Django ORM: Calculation of average result in conditional expression methods »
I'd like to annotate a field by using conditional expressions. However, Django ORM doesn't allow to compare Avg('rating') and 5. I could calculate ave...
(2) odpowiedzi
2017-10-12 19:10 Django ORM filter by Max column value of two related models »
I have 3 related models: Program(Model): ... # which aggregates ProgramVersions ProgramVersion(Model): program = ForeignKey(Program) in...
(1) odpowiedzi
2017-10-12 17:10 is there an equivalent of rails try in django? »
In Rails, you can call try when you're not sure if the object will exist or not. def method(foo) foo.try(:bar) end if foo exists, it will call fo...
(2) odpowiedzi
2017-10-12 06:10 How to do database migration using python script? »
is it possible to do migration from python script? I am trying to use django on Heliohost where there is no shell but I can use python script. somet...
(2) odpowiedzi
2017-10-11 14:10 Django, having Q object filter by function in model »
Inside my Profile model I have the following function: It serves to return the fullname of the user (or a alternative if some data is missing). ...
(1) odpowiedzi
2017-10-11 12:10 Group by in django create wrong query »
we have write down this query in django ManageInterview.objects.filter (post_id=request.data['job_id']) .order_by('-id') .annotate(total=Count('pitch...
(2) odpowiedzi
2017-10-11 09:10 Django return blob form azure-storage as downloadable file »
I am new to azure-storage and django My dev environment software configuration is as- django 1.10 , python 2.7.6, azure-storage-blob 0.37. I am using...
(1) odpowiedzi
2017-10-10 18:10 how to get specific list with all data from a queryset django? »
on server sends this data: Object { categoryes: Array[2], brands: Array[2], discount_list: "all", category_slug: "accessories", category_of_relations...
(2) odpowiedzi
2017-10-10 09:10 Missing table name in IntegrityError (Django ORM) »
I am missing the table name in IntegrityError of Django: Traceback (most recent call last): ... return self.cursor.execute(sql, params) File "....
(3) odpowiedzi
2017-10-10 04:10 Python Django equals in function arguments. Setting the variable dynamically »
I think this is called "Positional arguments" or the opposite or keyword arguments. I have written a script in Python Django and rest framework that h...
(2) odpowiedzi
2017-10-09 20:10 Django - How to get the top 10 highest scores, but limiting it to a single score per user? »
I have a simple model to keep scores for any number of score based games: class Score(models.Model): game = models.ForeignKey(Game, related_name=...
(1) odpowiedzi
2017-10-09 19:10 Deploy to my server with Git »
I have a development of a django project on my day-to-day laptop. Now I have put together a server with Ubuntu, nginx, gunicorn with postgreSQL. I ha...
(1) odpowiedzi
2017-10-09 13:10 Send CSRF Token in dropzone »
I have tried to send csrf token in my AngularJS/Django app using the following code. The $rootScope.CSRFToken contains token value that is received fr...
(0) odpowiedzi
2017-10-09 13:10 Where are Django User model fields saved? »
Sorry, if this is a very basic question, but I was wondering where Django User model field values like is_active are saved as I don't see them in the ...
(1) odpowiedzi
2017-10-08 22:10 Python convert python-amazon-simple-product-api results to json using Django »
I am writing an API in Python Django and rest framework. I am using a python packaged called python-amazon-simple-product-api to access amazon adverti...
(2) odpowiedzi
2017-10-08 14:10 Django migration with python3.6 ERROR:root:code for hash sha3_224 was not found »
Hello I read Django tutorials and I have an error related to specific sha3_224 hash function during the migration process. How to solve this problem? ...
(2) odpowiedzi
2017-10-08 09:10 django: blog() missing 1 required positional argument: 'blog_id' »
I am attempting to add a blog to an existing test website, but I am receiving the following error message: blog() missing 1 required positional argum...
(1) odpowiedzi
2017-10-07 23:10 Calculate Django Data query according to date »
This is my models.py file. class CustomerInfo(models.Model): customer_name=models.CharField('Customer Name', max_length=50) customer_mobile_n...
(1) odpowiedzi
2017-10-07 22:10 How to solve django social auth error on Facebook? »
I installed social-auth-app-django and followed the guide here to integrate Facebook login to django 1.8.18. The problem is when I go to "http://local...
(1) odpowiedzi
2017-10-07 16:10 How to implement the Django's server to listen to POST requests from Webhook? I am using NGROK to expose my localhost to the Internet »
I have already created a Webhook in my Github repository. I have set my payload URL to: localhost:4567/payload As I am using my localhost, I need to ...
(1) odpowiedzi
2017-10-07 11:10 Django & Socket Server: Can I add socket server instance to "memory"? »
I'm working with: Django 1.11 Python Sockets I have a Socket server like this: class SocketServer(threading.Thread): def __init__(self, ip="...
(0) odpowiedzi
2017-10-06 21:10 Django enforcing unique constraint on set of members in ManyToManyField »
I am working in Django and I'm having some trouble enforcing a particular constraint on my data models. I have a model that consists of a group of mem...
(1) odpowiedzi
2017-10-06 15:10 ~./zshrc : command not found: $ »
I'm currently going through Django tutorials on ProjectDjango.com. However I'm stuck on the very first bit! I'm told to enter the following into the...
(3) odpowiedzi
2017-10-06 09:10 Django Calling Class Based Mixin from Another Class Based Mixin »
My code is having two mixins, BasicAuthMixin and JWTAuthMixin as mentioned below. Just assume that self.authenticate method returns True and doesn't r...
(1) odpowiedzi
2017-10-05 15:10 How to toggle src attribute of script when user click element? »
I use bootstrap 3.3.7 in my Django project. I have modal with <textarea>. Inside that textarea in the corner I put an icon. Below is a picture o...
(1) odpowiedzi
2017-10-05 13:10 How to make an Django Ajax Request with jQuery? »
I am new to Ajax and want to make an Ajax Request to a view function in Django with jQuery, but I am stuck. I started with a simple example to check ...
(2) odpowiedzi
2017-10-05 00:10 django delete object with html button »
I have a simple site project in Django and I have movies lists in man page and movies details in the second page. I want to add a delete button on mo...
(1) odpowiedzi