I keep getting this error every time i create a new django project using titanium (eclipse) with pydev.
Actually, it did create the file settings.py
I wonder what make this error and how to fix it?
It's really a PyDev issue with Django 1.4. A new release (2.5.0) will be done later this week properly supporting the layout changes in Django 1.4.
You can still use the project created this way, but you have to do some manual things:
Move the contents inside of the folder that was created to your module (this was the structural change done in django 1.4)
The settings.py won't have the details you entered in the wizard (i.e.: manually edit the settings.py)
In the project django's properties (right click project > properties and check the django properties page), you have to put the proper settings to the settings module and manage.py.
I updated my pydev today to the last version and now it seems to be working beautifully...
Related
I have a Django project that uses old version of django.db.models.signals - post_syncdb. I changed models and added new to the db. To make docker-compose up and launch Django with docker I need to make a migration, but when I'm doing this it shows me this error
`AttributeError: module 'django.db.models.signals' has no attribute 'post_syncdb'
I tried google the solution and noticed three ways:
Check the Django version used in the project, as the post_syncdb signal has been deprecated since Django 1.9.
Look through the project's code and identify any references to post_syncdb signal. If there are any, you may have to update the code to use a different signal.
If the error persists, it may be a bug in one of the installed packages. You can try to update the packages to the latest version or raise an issue on the package's repository.
The problem is that it's not mu project and I currently work on dev branch. How do I fix it and make a migration?
I am new to Django and was following the tutorial here (https://simpleisbetterthancomplex.com/series/2017/09/04/a-complete-beginners-guide-to-django-part-1.html#hello-world) to get my first application running. I could not reference my application so I decided to name everything exactly as is in the tutorial in another Python project. I am unable to import view from boards no matter what I do (change it to projectname.appname and a number of different variations that I found on here). I have tried this tutorial on another computer I do not have access to at the moment and can confirm that it works usually. Is this an issue with PyCharm/my Python environment?
Project Structure
Error I am receiving
Fixed
To resolve this I marked my Django Project Folder (not Python Project Folder) as root.
I have an old project running (Django 1.6.5, Python 2.7) live for several years. I have to make some changes and have set up a working development environment with all the right django and python requirements (packages, versions, etc.)
Everything is running fine, except when I am trying to make changes inside the admin panel. I can log on fine and looking at the database (sqlite3) I see my user has superuser privileges. However django says "You have no permissions to change anything" and thus not even displaying any of the models registered for the admin interface.
I am using the same database that is running on the live server. There I have no issues at all (Live server also running in development mode with DEBUG=True has no issues) -> I can only see the history (My Change Log) - Nothing else
I have also created a new superuser - but same problem here.
I'd appreciate any pointers (Maybe how to debug this?)
Finally, I found the issue:
admin.autodiscover()
was commented out in the project's urls.py for some reason. (I may have done that trying to get the project to work in a more recent version of django) - So admin.site.register was never called and the app_dict never filled. index.html template of django.contrib.admin then returns
You don't have permission to edit anything.
or it's equivalent translation (which I find confusing, given that the permissions are correct, only no models were added to the admin dictionary.
I hope this may help anyone running into a similar problem
I have an existing Django application. I want to start developing it in Pycharm, instead of sublime text and command line. I have opened my existing directory (cloned from my git repo) into Pycharm but I can not for the life of me figure out how to set it as a django project. All the examples I see are new projects from scratch or existing pycharm projects, neither of which applies to me. I'm running on a brand new mac, if that helps (I'm coming from Ubuntu)
You need to enable Django Support in the project settings under Project Settings -> Django. You also would need to set up the project root, path to settings.py and manage.py.
I´m starting to use Django with Pycharm IDE and have succesfully configured my first project.
However, I tried to add a new existing project to Pycharm and when trying to change the Run Configuration to use the manage.py of my secondProject(GuatepediaLocal), I don´t get an option to select it on the dropdown menu. When I try to run the project, it keeps running the PollSite manage.py runserver and not GuatepediaLocal´s manage.py runserver
Can anyone help me to solve this issue and configure an already existing Django Project on pycharm?
After some research I found that on the settings window of Pycharm I must add Django support to my project
That enabled the project on the dropdown menu. After that, I just added on the enviroment variables the correct path to my project´s settings.py.
Hope this helps someone someday :)
Open edit configuration wizard.
Menu > Run > Edit Configuration
Add new configuration by selecting the Django server from the left top button (button look like + sign). Look like below. Plus sign top left.
If you don't configure the Django setting. It will show you the fix button to fix the Django Setting. Django Setting looks like this. You can manually set these setting by navigating like this.
File > Settings > Language and Framework > Django
Django Setting wizard looks like this.
set the project path, manage.py file and settings.py file.