I've started learning django. Through the django docs, I am using vscode for the project. The matter is that I've started a new project named "mysite" in the project folder named "web-project" by using the following commands as mentioned in the screenshot
But if you noticed an error in the last of the screenshot. It pops every time I tried to run the server
Related
There's this problem am having right now where there's no error in my code and yet the code won't run. Am still a newbie trying out something
I developed a little django project and pushed to github, went to my pythonanywhere console and cloned it. Now I went back to console and created a new app ( startapp command) added to INSTALLED_APPS and added some lines of code in the new app.
Problem is that the URLs in the new are not going through and even the ls command is not listing the app
Is this a git issue?
I was working on a Django project in version 2.0, but my client was unhappy about it as he wants that project to be made with Django 1.1.3. So, I switched back to old version and tried to setup the project on that version but was unable to do so.
After that, I created a new project in Django 1.1.3 and created a Django app too. I tried to run command python manage.py syncdb but I got this error message:
Error: No module named messages
What's the issue? I am not able to find Django 1.1.3 documentation on this.
The module django.contrib.messages is available only for Django versions >= 1.2, unfortunately.
You could maybe convince your client to switch to 1.2.X, or write your own messages as part of your server's responses, and create your own client-side message renderer.
I am trying to run a Django CMS project that i created recently. The project uses PostgreSQL for its database, and works great with the runserver command.
But i started having intermittent Bad Gateway(Nginx) issues when i deployed the project using NGINX and WSGI. This error was sometimes happening on the whole site or sometimes in the sidebar where the pages, administration, etc would show up or sometimes in the page or advanced page settings.
The error i was getting was as follows:
django.db.utils.OperationalError: SSL error: decryption failed or bad record mac
So i decided to get into the details of the error and found out that this error occurs only when i am using AppHooks in the project and that too only with PostgreSql. The project worked well when i deployed it using Sqlite database.
I further tried to resolve the issue by setting ssl = false in the config. file of PostgreSql to see if that would change anything. It changed the error i was getting earlier as follows:
django.db.utils.InterfaceError: connection already closed
So i was wondering the reason behind this issue? Let me remind you that this error is happening only when the project is deployed and not when runserver is being used.
UPDATE:
I tried using the Django-debug-toolbar to check what sql queries are being executed during these errors and it turns out the app is working fine. Somehow the debug toolbar is slowing down the applications which is not breaking the app any more. What might be the reason for the app to not work? How can i get around this issue
In eclipse,when i create new project, i got an error like,
Error creating Django project
settings.py file not created
Stdout:
Stderr:
If i synchronize present project and runserver, iam getting Error: No module named filterspecs.But i haven't used filterspecs in my project. Already filterspecs.py installed in usr/local/lib/python2.7/dist-packages/django/contrib/admin.
Kindly advise to rectify the error.
You may be using django.contrib.admin.filterspecs to create custom filters for your admin pages, such as outlined here:
Custom Filter in Django Admin on Django 1.3 or below
Unfortunatelly, you will have to rewrite these using the new list_filter module functionality.
See the manual here:
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter
This happened to me as well, even though my code wasn't directly using any filterspecs.
Run python manage.py runserver --traceback to see exactly where the error is coming from.
This module was removed in Django 1.4, but other external modules you have listed in your settings.py might still be using it, so make sure you upgrade everything in your INSTALLED_APPS list. In my case, I was using an outdated version of FeinCMS, but after I upgraded it, the error went away.
Obviously, your system is lacking filterspecs module which is required by the project. Install it by typing sudo pip install filterspecs in the console (if you are on linux)
I am trying to create my 1st project in django using jython. I am following this tutorial - http://docs.djangoproject.com/en/dev/intro/tutorial01/.
As mentioned in tutorial, I navigate to the directory where i intend to create a django project and run 'jython C:\jython2.5.1\Lib\site-packages\django\bin\django-admin.py'. On pressing enter, it says- Type 'django-admin.py help' for usage.
It is not creating a new project. I am using windows and have installed jython 2.5.1 and django 1.1.1.
I tried searching on google but no luck. This is the very first step and i am not getting how to do it. please help.
You need to type django_admin.py startproject your_project, where your_project is whatever you want to call your project.