Django.fun

Questions & Answers about Django

07.12.2021
0
answers

mac 12.0.1 django symbol not found in flat namespace '_mysql_affected_rows'

Traceback (most recent call last): File "/Users/xxx/Library/Python/3.6/lib/python/site-packages/MySQLdb/init.py", line 18, in from . import _mysql ImportError: dlopen(/Users/xxx/Library/Python/3.6/lib/python/site-packages/MySQLdb/_mysql.cpython-36m-darwin.so, 0x0002): symbol not found in flat namespace '_mysql_affected_rows' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "", …

07.12.2021
0
answers

Why is my admin not showing up in Django but my site still shows and works?

I am working with Django and as I try to pull up my admin page typing in http://127.0.0.1:8000/admin, I get this DoesNotExist at /admin/login error. But the funny thing is my actual site that I am building …

07.12.2021
0
answers

pymongo.errors.ServerSelectionTimeoutError while running a docker image of django app

I am trying to run a docker image of my Django app. I am running a mongo image separately from another container. Need help to solve following error: pymongo.errors.ServerSelectionTimeoutError: xxx.xxx.xxx.xxx:27017: timed out, Timeout: 30s, Topology Description: <TopologyDescription id: 61aee0f6695286eb954e68ea, topology_type: …

07.12.2021
1
answers

Django Summernote Settings

I've installed django-summernote and most of it works fine except for the dropdown buttons for Style, Font Size, Color and Table. The example has them setup as follows: ... 'toolbar': [ ... ['style', ['style'], ['fontsize', ['fontsize']], ['color', ['color']], ['table', ['table']], …

07.12.2021
0
answers

How to solve gateway time-out while connecting to google calendar api?

I am trying to connect to google calendar Api using Documentation . This works on local host and I am able to retrieve events from the user's google calendar. After hosting the website using apache, I can …

07.12.2021
0
answers

Do I need to use "Marking extra actions for routing" in this REST Django API?

I'm currently having this issue. I have to set up an URL like this: .../users/<user_id>/user_action/ There are many users and when I pick one user (with user_id), I will be able to see the user's information. Then, go to …

07.12.2021
1
answers

How to override the max_length error message for an ImageField?

I am using Django 2.2. I have an ImageField. I need to override its default max length of 100 and override the error message it generates. Is it me or error messages for anything that inherits from FileField cannot be …

07.12.2021
0
answers

Calling Django REST API from a python function?

Is there any way I can call a DRF API from a python function. There is no URL allowed to this API, my requirement API should not be accessible from the front end. Thanks in Advance

07.12.2021
0
answers

Django resubmits blank form after successful form

I'm new to Django and I'm trying to make a site where after a user inputs a start and end date, some data processing is done and then a result is displayed. I have this working, but after the form …

07.12.2021
0
answers

How to compare two queryset to find same and different values ​and add to calendar

I'm using the HTMLCalendar module provided by Django. In addition to the event, I want to pull the date value from another class to default and display it in the calendar. First, when the assignment(person) visits the hospital, he enters …

07.12.2021
0
answers

Switching from SQLite to Mysql in production causes error

I am using a digital ocean server. After switching to mysql database from sqlite, I got 502 Bad Gateway nginx/1.18.0 (Ubuntu) This is running fine when I run the project from the terminal using python manage.py runserver ip:8000 …

07.12.2021
0
answers

PyCharm (pro) - Django console: ModuleNotFoundError: No module named

I can't use the Django console because I keep having the following error and can't figure it out what to do.. I've tried extensively to search for a solution online but none it seems to work for me.. probably cause …

07.12.2021
0
answers

Chart.js Setup Using Ajax & Variables

I cannot get my Chart.js to show up on my webpage. I am utilizing two arrays for data/labels and am creating the chart in an onload js function. Tried several different methods from tutorials and other Stack posts. HTML is …

07.12.2021
0
answers

الجمال واللياقة البدنية [closed]

الجمال واللياقة البدنية يقدم موقعنا اسرار الجمال واللياقة البدنية والرشاقة والعناية بصحتك للبنات والرجال حصريا تمارين - كمال اجسام - العناية بالوجه - العناية بالجسم - العناية بالبشرة - العناية بالشعر يقدم موقعنا اسرار الجمال واللياقة البدنية …

07.12.2021
0
answers

How do i connect EC2 instance for elastic search in Django?

I'm just trying to add dynamic search as a feature to my application, i used Django Elasticsearch DSL to achieve this https://django-elasticsearch-dsl.readthedocs.io/en/latest/quickstart.html, but i'm not able to connect the running postgres EC2 instance. Any leads would be …

07.12.2021
1
answers

I am creating a Web project, Frontend on Reactjs backend on Python Django and use Firebase realtime data base for store data

I Know first create restful api to get data from client side but, dont know the flow of project to make connections for CRUD operations in my project

07.12.2021
0
answers

Link automatically OneToOneField when creating an objects

Considering this two models in my project: MODEL class Movie(models.Model): user = models.ForeignKey(UserInformation, on_delete=models.CASCADE) title = models.CharField(max_length=250) year = models.DateField(default=auto_now_add=True) def __str__(self): return self.title class List(models.Model): user = models.ForeignKey(UserInformation, on_delete=models.CASCADE) movie = models.OneToOneField(Movie, on_delete=models.CASCADE) [...] I'd like to link …

07.12.2021
0
answers

How can i generate backup codes for two factor authentication

I am try to generate backup codes for the users of my system after they enable two factor authenciation

07.12.2021
1
answers

Django Find difference in the same model instance

I've been searching around and I don't think I've found my answer quite yet. But I'm looking to be able to find differences in data and have a list of column names that show that. Take for instance I have …

07.12.2021
0
answers

Protected member accessed from outside the class, Django

I'm trying to condition if a value exist as a property in a model or not. I'm trying to do this Mode()._meta.get_field("id") But I got the following error from pylint Protected member accessed from outside the class Can …

1 2 3 653 654