Category "django"

Amazon Elastic Beanstalk not serving django static files

I am trying to put up a simple django app on elastic beanstalk. I thought I had the static parts of the app figured out as it works with heroku and on a server

Generating a Random Hex Color in Python

For a Django App, each "member" is assigned a color to help identify them. Their color is stored in the database and then printed/copied into the HTML when it i

Django: ImportError, No module named urls

I have the following urls.py file in my project directory: from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodisco

Django: serving static file on debug=false

I know this question was asked many times, but none of the answers i found and tried helped me. Those are my static files settings: STATIC_ROOT = os.path.absp

gunicorn shows connection error [Errno 111]

Hi im building a Django app with docker, gunicorn and nginx and having serious issues calling a post request from the django view. my login function - with sch

Conditional unique_together in Django

I have following unique constraint in my model. class Meta: unique_together = (('crop', 'order', 'sku'),) But sku may be null in some cases and in th

How to get Request.User in Django-Rest-Framework serializer?

I've tried something like this, it does not work. class PostSerializer(serializers.ModelSerializer): class Meta: model = Post def save(self)

If "null=True", which is stored in DB "NULL" or "empty values"?

I created the django model "User" with "null=True" as shown below: # "myapp/models.py" from django.db import models class User(models.Model):

Django Import Error: No module named apps

I just checked out a project with git. The project structure is project apps myapp settings __init__.py __init__.py manage.py

Django: Search form in Class Based ListView

I am trying to realize a Class Based ListView which displays a selection of a table set. If the site is requested the first time, the dataset should be displaye

Override existing Django Template Tags

Is it possible to override an existing Django Template Tag or is it necessary to customize the template file and create a new Template Tag?

AuthAlreadyAssociated Exception in Django Social Auth

After I create a user using say Facebook(let's say fbuser) or Google(googleuser). If I create another user through the normal django admin(normaluser), and try

HttpResponseRedirect Reverse not working Django

I am trying to redirect my page after submitting a like button to the same page but I keep getting a NoReverseMatch at /score/like/2 Here is the urls urlpa

Django - run a function every x seconds

I'm working on a Django app. I have an API endpoint, which if requested, must carry out a function that must be repeated a few times (until a certain condition

Django static Files not loaded on Docker?

I am using Django 3.0.6 and want to dockerize my project. everything is worked fine except static files. Static files are loaded completely when I run my projec

What does blue-colored text mean in the terminal output from the Django development server?

Sometimes the lines after each normal terminal-green colored line like '[24/Sep/2012 00:42:30] "GET / HTTP/1.1" 200 1904' are my normal terminal-green color, an

How to assign custom color to progress bar bootsrap 4

Guys i have progressbar: <div class="progress"><div class="progress-bar" style="width:{{a.49}}%">{{a.49}} %</div> </div> How can i as

Import error: No module named 'secrets' - python manage.py not working after pull to Digital Ocean

I'm following along a course - Django development to deployment. After pulling it to Digital Ocean everything else ran smoothly. Until I tried running python m

Django retrieve checkbox values sent by Ajax POST request

I am trying to send form data to Django server via Javascript Ajax request specifically checkbox values, but at the server I read None values. here's the server

What's the right procfile / requirements for heroku with django channels?

tl;dr - django channels app runs local with manage.py runserver but not on heroku. I'm new to django channels - trying to deploy a very basic django app using