Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Why only one database for django apps in the tutorial?
I'm in need for another application in my django website but fail to understand how to extend my knowledge from the tutorial. Following the tutorial, my project structure looks like this: - mydjango/ - db.sqlite - firstapp/ - mysite/ The tutorial states … An app can be in multiple projects. … My understanding of that quote and django, is, that concerns are separated. However the database handling in the tutorial contradicts that concept. How can an app be in another project? The project's database sits not even in the parent project's directory. Everything is just mixed up in one database. Why does each app not have it's own database? -
django cannot access from same LAN after runserver ip:port
Please help for my problem I'm new in django programming, my rpoblem is when I use localhost can direct to dashboard but when I use Local IP got error message and still in login menu,bellow is error message from console: The Cross-Origin-Opener-Policy header has been ignored, because the URL's origin was untrustworthy. It was defined either in the final response or a redirect. Please deliver the response using the HTTPS protocol. You can also use the 'localhost' Refused to execute script from 'http://192.168.0.81:8000/static/vendor/libs/%40form-validation/umd/plugin-bootstrap5/index.min.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. for setting.py ALLOWED_HOSTS = ['192.168.0.81', 'localhost', '127.0.0.1'] SESSION_COOKIE_SECURE = True CSRF_COOKIE_SECURE = True STATIC_URL = '/static/' STATIC_ROOT = BASE_DIR / 'staticfiles' MEDIA_URL = '/media/' MEDIA_ROOT = BASE_DIR / 'media' -
Most efficient way to store dynamic properties in Django
Let's imagine we have a base like this: class MyModel(models.Model): name = models.CharField(max_lenght=25) # ... some other fields dynamic_properties = models.ManyToManyField("Dynamic") class Dynamic(models.Model): key = models.CharField(max_lenght=25) value = models.CharField(max_lenght=25) MyModel would be the base of all my entries containing its base static data, but when ever I need to add a dynamic property I add it to the dynamic_properties field. While this does make sense on the paper it's kinda inneficient from what's I've been testing so far, let's say each MyModel entries have an average of 4 dynamic properties if I want to iterate over 2k MyModel objects and return all their dynamic properties it is quite slow. I tried to use prefetch_related as the docs suggest but it didn't seem to have a real impact (but that's maybe me misunderstanding how it's used). For the reference I tried it like that: {model.name: model.some_value for model in MyModel.objects.all()} # Is very slow {model.name: model.some_value for model in MyModel.objects.prefetch_related("dynamic_properties")} # Is also very slow Is there a more efficient way to have dynamic properties or is my understanding of prefetch_related wrong and this is the good way ? -
How do calls of models.Manager and custom managers work?
I extended the models.Manager class and created a custom manager. class PublishedManager(models.Manager): def get_queryset(self): return super().get_queryset()\ .filter(status=Post.Status.PUBLISHED) It's more than understandable, BUT how do calls of managers work? objects = models.Manager() # The default manager. published = PublishedManager() # Our custom manager. I don't address get_queryset method, I just call constructors. Then how does it work? -
django.core.exceptions.ImproperlyConfigured: Requested settings | os.environ.setdefault('DJANGO_SETTING_MODULE', 'online_shop.settings') not working
I've been trying to use celery and celery beat with my django project, but I always get the same error: django.core.exceptions.ImproperlyConfigured: Requested settings, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. and here is my celery configuration: from celery import Celery from datetime import timedelta import os from django.conf import settings os.environ.setdefault('DJANGO_SETTING_MODULE', 'online_shop.settings') celery_app = Celery('online_shop') celery_app.config_from_object('django.conf:settings', namespace='CELERY') celery_app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) celery_app.conf.broker_url = 'amqp://guest:guest@localhost' celery_app.conf.result_backend = 'rpc' celery_app.conf.task_serializer = 'json' celery_app.conf.result_serializer = 'pickle' celery_app.conf.accept_content = ['json', 'pickle'] celery_app.conf.result_expires = timedelta(days=1) celery_app.conf.task_always_eager = False celery_app.conf.worker_prefetch_multiplier = 2 but every time I try to run celery like this: celery -A online_shop worker -l info I get that error... I tried this line: export export DJANGO_SETTINGS_MODULE=online_shop.settings but this won't work when daemonizing the process!!! I tried writing it to the .bashrc: the same error. I tried writing it to the activate file in virtual environment, It didn't work either! I also tried to export the variable before running celery in supervisor conf: [program:exporting_to_os] user=ali command=export DJANGO_SETTING_MODULE=online_shop.settings autostart=true autorestart=true stderr_logfile=/var/log/online_shop/exporting.err.log stdout_logfile=/var/log/online_shop/exporting.out.log [program:online_shop_celery] user=ali directory=/home/.../OnlineShop/online_shop/ command=/home/.../OnlineShop/env/bin/celery -A online_shop worker -l info numprocs=1 autostart=true autorestart=true stdout_logfile=/var/log/online_shop/celery.log stderr_logfile=/var/log/online_shop/celery.err.log and still the same error... Please guide me on … -
ModuleNotFoundError: No module named 'captchamptt'
I'm try to install django-machina I read documents and when i run python manage.py migrate i get error for module captchamptt In dependencies there is a library named : 'django-mptt' but i cant find 'captchamptt' library to install Traceback : Traceback (most recent call last): File "C:\Users\Administrator\Desktop\RBtest\RondBazar\manage.py", line 24, in <module> main() File "C:\Users\Administrator\Desktop\RBtest\RondBazar\manage.py", line 20, in main execute_from_command_line(sys.argv) File "C:\Users\Administrator\Desktop\RBtest\projenv\lib\site-packages\django\core\management\__init__.py", line 442, in execute_from_command_line utility.execute() File "C:\Users\Administrator\Desktop\RBtest\projenv\lib\site-packages\django\core\management\__init__.py", line 416, in execute django.setup() File "C:\Users\Administrator\Desktop\RBtest\projenv\lib\site-packages\django\__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "C:\Users\Administrator\Desktop\RBtest\projenv\lib\site-packages\django\apps\registry.py", line 91, in populate app_config = AppConfig.create(entry) File "C:\Users\Administrator\Desktop\RBtest\projenv\lib\site-packages\django\apps\config.py", line 193, in create import_module(entry) File "C:\Program Files\Python310\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked ModuleNotFoundError: No module named 'captchamptt' different python versions different virtualenvs different pip version -
"Django: OperationalError - Could not translate host name 'postgres.railway.internal' to address"
I'm encountering an issue while trying to connect my Django application to a PostgreSQL database hosted on Railway. The error I'm getting is: "Django: OperationalError - Could not translate host name 'postgres.railway.internal' to address"` I've double-checked that the hostname and database credentials are correct. What could be causing this hostname resolution issue, and how can I resolve it? Any help would be greatly appreciated! Here is my settings.py configuration: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'railway', 'USER': 'postgres', 'PASSWORD': os.environ.get('DB_PASSWORD_YO'), 'HOST': 'postgres.railway.internal', 'PORT': '5432', } } -
Django- how to convert <class 'django.core.files.uploadedfile.InMemoryUploadedFile'> to an image?
I have a form that uploads an image to my view; the uploaded image type is: <class 'django.core.files.uploadedfile.InMemoryUploadedFile'> I want to process the image though; thus I need it in PIL or CV2 format. How can I do that ? -
Error 500 during login and register in django application hosted on heroku servers, while locally everithing work good
When I try to login or register in my django app on heroku server I have an a error 500. However, when I register or login locally I don't have any issues. Here the logs: 2024-08-02T22:17:13.267743+00:00 heroku\[web.1\]: State changed from starting to up 2024-08-03T22:34:20.389130+00:00 heroku\[router\]: at=info method=GET path="/" host=fierce-brook-34882-87d6631e0056.herokuapp.com request_id=34b832f3-b190-4bc2-88ac-576c6dd59905 fwd="80.107.58.61" dyno=web.1 connect=0ms service=137ms status=200 bytes=2493 protocol=https 2024-08-03T22:34:20.389210+00:00 app\[web.1\]: 10.1.62.231 - - \[03/Aug/2024:22:34:20 +0000\] "GET / HTTP/1.1" 200 2197 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0" 2024-08-03T22:34:20.729350+00:00 app\[web.1\]: 10.1.62.231 - - \[03/Aug/2024:22:34:20 +0000\] "GET /favicon.ico HTTP/1.1" 404 1862 "https://fierce-brook-34882-87d6631e0056.herokuapp.com/" "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0" 2024-08-03T22:34:20.729672+00:00 heroku\[router\]: at=info method=GET path="/favicon.ico" host=fierce-brook-34882-87d6631e0056.herokuapp.com request_id=ba080178-f0ef-4d0c-8745-0556273710f1 fwd="80.107.58.61" dyno=web.1 connect=0ms service=28ms status=404 bytes=2165 protocol=https 2024-08-03T22:34:26.884713+00:00 app\[web.1\]: 10.1.94.152 - - \[03/Aug/2024:22:34:26 +0000\] "GET /users/login/ HTTP/1.1" 200 2715 "https://fierce-brook-34882-87d6631e0056.herokuapp.com/" "Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0" I also try heroku run python manage.py migrate -
Django drf Serialize group by model field
Django drf Serialize group by model field I have drf endpoint i get this result, but i want to group this result by model field product_type, how i can implement this? i tryed like in this answer DRF: Serializer Group By Model Field but it didn't help me [ { "id": 1, "name": "Danwich ham and cheese", "product_type": "Snacks", "img_url": "https://media.dodostatic.net/image/r:292x292/11EE796FF0059B799A17F57A9E64C725.avif", "grams": 210, "description": "Crispy ciabatta and the familiar combination of ham, chicken, mozzarella with fresh tomatoes, ranch sauce and garlic", "extra_info": "", "price": "3.28", "extra_ingredients": [] }, { "id": 2, "name": "Danwich Chorizo BBQ", "product_type": "Snacks", "img_url": "https://media.dodostatic.net/image/r:292x292/11EE796FF041FE1F94C903576DCFD01E.avif", "grams": 210, "description": "Rich taste of spicy chorizo sausages and spicy pepperoni with burger and barbecue sauces, fresh tomatoes, pickled cucumbers, mozzarella and onions in a golden ciabatta", "extra_info": "", "price": "3.28", "extra_ingredients": [] }, { "id": 3, "name": "Chocolate milkshake", "product_type": "Cocktails", "img_url": "https://media.dodostatic.net/image/r:292x292/11EE796FA24D1E919FA050D8BA21F8E9.avif", "grams": null, "description": "Charming chocolate delicacy. Try a milkshake with cocoa and ice cream", "extra_info": "0.3 L", "price": "2.71", "extra_ingredients": [] }, { "id": 4, "name": "Strawberry milkshake", "product_type": "Cocktails", "img_url": "https://media.dodostatic.net/image/r:292x292/11EE796FB231A5BF82B0A99A1B12339C.avif", "grams": null, "description": "No matter what time of year it is, this cocktail with strawberry concentrate will take you back to summer in one … -
Got KeyError when attempting to get a value for field `date` on serializer
Im trying to do a queryset to show date__month and total of all sale_prices class RevenueChartListView(ListAPIView): queryset = Transactions.objects.annotate(month=ExtractMonth('date')).values('month').annotate(revenue=Sum('sale_price')).order_by('month') serializer_class = RevenueSerializer class RevenueSerializer(serializers.ModelSerializer): class Meta: model = Transactions fields = ['date', 'sale_price'] However I get an error of "Got KeyError when attempting to get a value for field `date` on serializer `RevenueSerializer`.\nThe serializer field might be named incorrectly and not match any attribute or key on the `dict` instance.\nOriginal exception text was: 'date'." -
Django - Create excel file from response with openpyxl and convert it to pdf in the same function
In Django app (ubuntu server online) I know how to create an xlsx file from HttpResponse with openpyxl using this piece of code : views.py def export_to_excel(request): movie_queryset = models_bdc.objects.all() response = HttpResponse( content_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', ) response['Content-Disposition'] = 'attachment; filename={date}-movies.xlsx'.format( date=datetime.now().strftime('%Y-%m-%d'), ) workbook = Workbook() # Get active worksheet/tab worksheet = workbook.active worksheet.title = 'Movies' # Define the titles for columns columns = [ 'ID', 'Title', 'Description', 'Length', 'Rating', 'Price', ] row_num = 1 # Assign the titles for each cell of the header for col_num, column_title in enumerate(columns, 1): cell = worksheet.cell(row=row_num, column=col_num) cell.value = column_title # Iterate through all movies #try to sort by index here and ignore empty rows # apply a save to DB before export to excel to get the latest changes for movie in movie_queryset: row_num += 1 # Define the data for each cell in the row row = [ movie.bdc_description_1, movie.bdc_description_2, movie.bdc_description_3, movie.bdc_description_4, movie.bdc_description_5, movie.bdc_description_1, ] # Assign the data for each cell of the row for col_num, cell_value in enumerate(row, 1): cell = worksheet.cell(row=row_num, column=col_num) cell.value = cell_value workbook.save(response) return response But I would also like to convert the generated .xlsx as a .pdf file. I don't know what approach is the … -
Django Custom Dynamic urlpatterns
I'm working on a django project and in this project I have two subprojects. So in this case what I want to do is store domains and assign services (my subprojects) to these domains. For example, let's say I have service1 and service2. And in my domains table I store: service1.domain.com -> service1 domainforservice1.com -> service1 service2.domain.com -> service2 domainforservice2.com -> service2 something like this. So in this case I'm struggling with some issues, because I want to control the domain that request made and according to that domain I can find which service I should load on the main path. So basically we want to make this control: if domain.service = service1: urlpatterns += path('', service1.urls) if domain.service = service2: urlpatterns += path('', service2.urls) But the problem is as we can't take the domain in this area from request we can't make this control. I have tried to write middleware for this and I get the domain address in request.domain but again we have the problem because middleware is executed before this urls.py file. So in this case I'm stuck and can't find a solution to resolve this problem. -
How can I make a web GUI that lets me draw digits freehand?
I've created a neural network that recognises digits trained on the mnist dataset. I have been trying to make a drawing canvas, which I so desperately wanted to integrate into an app built with streamlit(a python framework for web). I made something like that in html and javascript and then tried to integrate, but it doesn't work since there's sudden refreshes by the framework. Anyways I give up. I will recreate the program in something else - maybe Flask or Django. I am wondering how do I recreate the drawing canvas to look like the mnist digits. For reference: You can notice not all pixels are fully white or black. I am trying to recreate this video: https://youtu.be/hfMk-kjRv4c?si=GCUYEDbj3MGWnUq8 in which the guy managed to do that: [] But his source code - https://github.com/SebLague/Neural-Network-Experiments/tree/main/Assets/Scripts/Drawing is in unity and I can't understand it. Someone have any idea how to replicate it using python and with which framework - there will be many UI elements before the drawing so I am wondering do I use Flask or Django or something like that. if I have to use pygame I'll have to choose a service in which it is possible to embed it -
Pycharm start project is not creating venv
When I start a project with Pycharm and try to start a project, my virtual environment directory is not being created. Here is what it looks like on my computer: My start project picture where the location line of the virtual environment does not include the venv directory Now I can manually create a venv by using python -m venv venv then use .\env\scripts\activate but doing so is messing up my template folder location and static location. When I start a project I also used to create an app. I kept my static and templates folder inside the app. But when I go to settings.py in the project I can not find my static and templates folder in suggestion. Even if I manually include them, when running the project I see this warning prompt: Cannot resolve file 'icon.jpg' %} But when I run the project the js files and all the static files are included properly. I thought it could be due to the previous browser cache. So I cleaned the whole browser and ran the project, but it runs absolutely fine. My problem there is that my static files don't show up in suggestions then. I am not new … -
install django in colab
I try to execute django server in colab but don't work I write in colab: !pip install django !django-admin startproject portfolio %cd portfolio/ modify setting.py ALLOWED_HOSTS = ['colab.research.google.com'] from google.colab.output import eval_js print(eval_js("google.colab.kernel.proxyPort(8000)")) !python manage.py runserver 8000 then I open chrome with print(eval_js("google.colab.kernel.proxyPort(8000)")) string the browser show: error 403 That’s an error. That’s all we know. -
No module named 'django' when debugging inside vscode even though django is installed
I am trying to debug my django app inside docker container. I have specified following in my requirements file: Django==3.2.5 psycopg2-binary==2.9.1 djangorestframework==3.12.4 django-rest-swagger==2.2.0 I am installing these dependencies inside my Dockerfile: RUN pip install -r requirements.txt Also when I checked by attacking vscode to docker container and running pip, it shows that the django is indeed installed: # pip list | grep Django Django 3.2.5 However, still I get the error: ModuleNotFoundError: No module named 'django' Here is the screenshot of error showing exception raised in debug mode, launch.json and output of pip list | grep Django: PS: I am using docker compose to start the containers. -
How to make password hashing in django project, i am using custom autentication for login?
I want to make password hashing possible for a django project. views.py for login. def asset_login(request): if request.method == 'POST': username = request.POST.get('user_id') password = request.POST.get('password') try: user = UserTable.objects.get(username=username, password=password) if user: if user.status == 'inactive': messages.error(request, 'Your account is inactive.') return redirect('asset_login') request.session['name'] = user.name request.session['role'] =user.role if user.role == 'admin': return redirect('admin_dashboard') elif user.role == 'ciso': return redirect('ciso_dashboard') elif user.role == 'fnhead': return redirect('fnhead_dashboard') elif user.role == 'systemadmin': return redirect('systemadmin_dashboard') elif user.role == 'assetowner': return redirect('assetowner_dashboard') else: messages.error(request, 'Unknown user position') return redirect('asset_login') # Redirect to clear form and message except UserTable.DoesNotExist: messages.error(request, 'Invalid username or password') return redirect('asset_login') # Redirect to clear form and message return render(request, 'asset.html') models.py for username and password class UserTable(models.Model): sl_num = models.CharField(max_length=100) name = models.CharField(max_length=100) phone_no = models.CharField(max_length=100) email = models.EmailField(blank=False, null=False) location = models.CharField(max_length=100) department = models.CharField(max_length=100) status = models.CharField(max_length=100) role=models.CharField(max_length=100) username=models.CharField(max_length=100) password=models.CharField(max_length=100) def __str__(self): return self.name I want to make paasword hasing possible on django project , i am using custom authentication instead of django build in autentication. -
I have created a django app and I want to run a function and a view both asynchronous
this is the django view file code. i have a function which has no parameters and no return since im using global variables in the code. I am currently using threads and there is an issue. when the startfunc() is running and executing some code, and the data is received at the same time in the view, it just distrupts the startfunc() and the whole process is incomplete which is a big issue for me and the for the app. That's why im trying to use async. if it can be done both of them together( thread + async) i think it would be even more better. let me know if im wrong i tried async but got this error RuntimeWarning: coroutine 'startfunc' was never awaited and also showing some errors because of csrf so i added csrf_exempt but still doesnt work import func # (its a file in the directory of the django app) global func_running # this is the function import func # (its a file in the directory of the django app) global func_running def startFunc(): while func_running: # run a piece of code time.sleep(1) @csrf_exempt @sync_to_async def restview(request): try: raw_data = request.body.decode('utf-8').strip('"') data = json.loads(raw_data) if … -
Django is not sending the response with status code 302
Why is Django not sending the response to status code 302? I see two different codes, 302 and 200. With response ok and redirected: true instead of 302. I am trying to do a hard redirect to the home page with 302 code. @csrf_protect def new_form(request): if not request.user.is_authenticated: response = HttpResponse(status=302) response['Location'] = 'http://192.168.1.200:9000/' return response -
How to use Tiptap to achieve multi person collaborative editing?
I used Vue 3 as the front-end and Django as the back-end to develop the Tiptap editor. Now I want to create a collaborative editing feature for multiple users. I have already registered different users and created multiple files for one user (each file has its own ID, and the file content is stored in the back-end). Now, how can I make a document editable by multiple users at the same time? Is there any faster development solution. -
ImportError: cannot import name 'PlaceholderRelationField' from 'cms.models.fields'
I created new Django CMS project and tried to install also plugin Djangocms-blog after installation server is not running with this error Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent call last): File "C:\Users\ASUS\AppData\Local\Programs\Python\Python39\lib\threading.py", line 954, in _bootstrap_inner self.run() File "C:\Users\ASUS\AppData\Local\Programs\Python\Python39\lib\threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "C:\Users\ASUS\PycharmProjects\newvis\venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "C:\Users\ASUS\PycharmProjects\newvis\venv\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run autoreload.raise_last_exception() File "C:\Users\ASUS\PycharmProjects\newvis\venv\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception raise _exception[1] File "C:\Users\ASUS\PycharmProjects\newvis\venv\lib\site-packages\django\core\management\__init__.py", line 394, in execute autoreload.check_errors(django.setup)() File "C:\Users\ASUS\PycharmProjects\newvis\venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "C:\Users\ASUS\PycharmProjects\newvis\venv\lib\site-packages\django\__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "C:\Users\ASUS\PycharmProjects\newvis\venv\lib\site-packages\django\apps\registry.py", line 116, in populate app_config.import_models() File "C:\Users\ASUS\PycharmProjects\newvis\venv\lib\site-packages\django\apps\config.py", line 269, in import_models self.models_module = import_module(models_module_name) File "C:\Users\ASUS\AppData\Local\Programs\Python\Python39\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 680, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 855, in exec_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "C:\Users\ASUS\PycharmProjects\newvis\venv\lib\site-packages\djangocms_alias\models.py", line 6, in <module> from cms.models.fields import PlaceholderRelationField ImportError: cannot import name 'PlaceholderRelationField' from 'cms.models.fields' (C:\Users\ASUS\PycharmProjects\newvis\venv\lib\site-packages\cms\models\fields.py) I tried different version of django-cms and djangocms-blog but still getting this error. How I can solve … -
How to deploy django application only offline (client's computer)?
I have created an application of sales management with python django, mysql with restAPI. Now I want to deploy this application to the client computer. My client want to get the application offline [without hosting on internet], only his personal computer. So What the best standard process of deploying the application on Windows 11. -
why i am not receiving the google gemini response in formated paragraphs in html page
I Am using a google gemini api in my django, everything is going fine, response generated my gemini in terminal is perfect with space between two paragraph and all, but when i am passing this response to html page, all the formatting is gone, there is no line of space between two paragraph, and i dont nkow why it is producing unnecessary stars ** in the response, please tell me how i fix it. this is the image of response generated in terminal. this is how it is looking in html page. I Am storing the response generated by gemini in database, and then fetching it on html page. Please help me and tell how i make it look more tidy in html, also tell me how i ignore those unnessary stars. this is what my models.py looks like -
Can't connect to Neo4j Desktop database using latest Neo4j version, new database, and django_neomodel (Authentication Error)
So it throws the exception: neo4j.exceptions.AuthError: {code: Neo.ClientError.Security.Unauthorized} {message: The client is unauthorized due to authentication failure.} But I went up a few levels in the exception and here: auth is set to "None" essentially. My global variables are as such: I'm guessing this is something wrong with my django_neomodel setup, but I have django_neomodel installed and added to my Django project's INSTALLED_APPS. Reason username/password is not neo4j is because neo4j:neo4j does not work (it's not possible to set password neo4j in the latest desktop app), neither does neo4j:ArrowGlue (the password I thought I set when creating the new database). So in the database tab of Neo4j Browser I played ":server user add" and added ArrowGlue:ArrowGlue as an admin level Role.