I’ve got a project that runs on Heroku from a Dockerfile and heroku.yml. The site generally works, but I am having trouble with static files. collectstatic is run when building the pack. If I set DEBUG to True, it finds the files. I’m trying to use whitenoise but not sure why it’s not working. It sounds so simple so I’m
Tag: django
Django rest framework, field that is a choice or text
Is there a way to create a field which is A text field, but, with choices. that the choices are the field existing objects? And if the word passed in is not in the existing data, add it? I’ve looked across all the internet for a field like this or example of it, either in Django or the rest framework,
TWILIO API ERROR Credentials are required to create a TwilioClient django
I am trying to include TWILIO API to my project. It should send sms. I have finished tutorial, but then i get error Credentials are required to create a TwilioClient. I have credentials in .env file and then i try to import them to settings and then get this credentials from settings to views. This is when i get error.
‘function’ object has no attribute ‘objects’ Django, help me
I’m designing a Django app and experiencing an error message: This is my views.py that generates the message: and this is my model.py Thanks for any help. Answer You wrote a view function named Post, hence Post.objects refers to the Post function, not the model. You furthermore named your model posts, instead of Post. I strongly advise to rename your
Django 3.x error: ‘mysql.connector.django’ isn’t an available database backend
Having recently upgraded a Django project from 2.x to 3.x, I noticed that the mysql.connector.django backend (from mysql-connector-python) no longer works. The last version of Django that it works with is 2.2.11. It breaks with 3.0. I am using mysql-connector-python==8.0.19. When running manage.py runserver, the following error occurs: I am aware that this is not an official Django backend but
Cannot access Django administrator site in Django-3
Successfully created an admin user using py manage.py createsuperuser. Entered username, e-mail, password but whenever I try to access this link http://127.0.0.1:8000/admin/ it says “This site can’t be reached” and “127.0.0.1 refused to connect, ” How do I fix this error and access the administrator site ? I’m using Windows 10 with the latest version of Django. before accessing admin
Django filter on OneToOne field appending “_id” and failing
In my Django application I have the following model: Note user is a OneToOneField to my CustomUser table and also the primary key of this table. In views.py, I attempt to query this table with Provider.objects.filter(user=request.user) and get django.db.utils.OperationalError: (1054, “Unknown column ‘appname_provider.user_id’ in ‘field list'”). Checking my MySql database, I see the columns are (user, company_id). So why is
Template file not found Django
I am trying to make a home page of a new website via Django. My app name is ‘blog’, home page is home.html I still receive the error template does not exist when I go to http://127.0.0.1:8000/blog/home/ I made sure I added ‘blog’ to my templates in settings.py and that I added the folder templates in the main directory as
Unable to apply Django migration in Postgres DB
In Django app, I’m using Postgres DB. I have two tables where one of them has 76 million records and the other 8.2 million. I have created a new migration file where in I’m adding a new column to a table in an app and setting default value to 0. My database is hosted on Ubuntu EC2 instance which has
RelatedObjectDoesNotExist. User has no profile
I’ve read some other answers for this (almost) question but they didn’t help. I have the following 2 files mixed for user and profile apps(?). In other answers they said this happens if you don’t use >objects.get_or_create or not making signals.py file you’ll get this error but I’ve gone through both of those ways and no results. This is the