Remove sqlite3 table from django project - python

when I try to make migrations I am getting the following error:
django.db.utils.OperationalError: table "main_todolist" already exists
This tablet is throwing an error and I dont want to use the table anyways, I am trying to get delete it or at least stop the error. Any suggestions? The more simple the solution the better, I am new to this.
Ive seen that I may need to access the dbshell however I also get the error " You appear not to have the 'sqlite3' program installed or on your path". Ive tried appending \sqlite3 to the end of my path but to be honest I am not really sure how to append the path.
Any help would be great, thank you.

Ive seen that I may need to access the dbshell however I also get the error " You appear not to have the 'sqlite3' program installed or on your path". Ive tried appending \sqlite3 to the end of my path but to be honest I am not really sure how to append the path.
This is because you did not install sqlite3 on your machine, you have to install it from sqlite website, then save it to a directory, and lastly put it in your machine environment path. That way your app can execute it.
django.db.utils.OperationalError: table "main_todolist" already exists.
This tablet is throwing an error and I dont want to use the table anyways, I am trying to get delete it or at least stop the error. Any suggestions? The more simple the solution the better, I am new to this.
For this one if you are just starting the project and has almost no data, I recommend resetting the database following the instruction of this answer https://stackoverflow.com/a/42150639/12581324

Related

django.db.utils.ProgrammingError: relation "cms_cmsplugin" already exists

While upgrading an old project to django 1.8 and djangocms 3.5 I am getting an error that says:
django.db.utils.ProgrammingError: relation "cms_cmsplugin" already
exists
Does anyone understand what is wrong and can help with that?
Thanks.
I have tried some solution propositions on other titles but none worked.
did --fake-initial, tried migrating commenting out all other plugins of cms etc but none worked.
I can only give little advice on your specific error: The table cms_cmsplugin" is already existing. But I guess you can read errors...starting with a fresh db could be a solution (restarting the upgrade process, with the orignal db from before the upgrade). I can give some general advice for upgrading django/django-cms projects.
Key point for me always was: make it reproducable. So you can try things, but also start over again, without much of an effort. I for myself once made a tool for this purpose: project-updater. I normaly had scripts to automatically reset db and media files and git tag to the starting point of my upgrade, then execute steps required up to where I was currently stuck, and from there move on...wether using project updater, your own workflow, or another tool is not of that importance...

Fixing broken django module that was installed from pip, where is the code?

I have been trying to use the django-visits module, though I seem to not even get this to run cause the minute I follow the instructions for just adding it to my application here:
https://bitbucket.org/jespino/django-visits/src/c3ac83b91969?at=default
It gives me an error when I try to run server:
ERRORS:
visits.Visit.ip_address: (fields.E900) IPAddressField has been removed
except for support in historical migrations.
HINT: Use GenericIPAddressField instead.
Their hint was helpful enough, but I have no idea where pip instaleld my django-visits to where I can change the model code of this module to fix the IPAdressField
Am I approaching solving this error wrong? Should I not be looking for the original code that was installed somewhere on my machine? Do I need to somehow install this from source and not use Pip since I have to change the models.py in this module?
(I am trying to make this work on my OS X machine but ultimately will need to get this to work on CentOS box). Also the database is postgres/postgis

Cannot find PRAW config file when wrapping application with py2app

I'm trying to wrap my Python script into an application using py2app, but when I try to run the app I'm getting this PRAW related error:
Exception: Could not find config file in any of: ['/Users/username/CS/Applicationame/dist/applicationname.app/Contents/Resources/lib/python2.7/site-packages.zip/praw/praw.ini', '/Users/username/.config/praw.ini', 'praw.ini']
The strange thing is I navigated to the first path, unzipped site-packages.zip and found praw.ini inside /praw, so I'm not really sure why I'm getting this error. I've also tried using pyinstaller but I get the same error.
I came across this error today - not in the context of py2app, but after a pip upgrade of praw. In case you still have this problem (unlikely :)) and/or in the interest of posterity, here's how I was able to fix it: I noticed that the error was in reading the praw.ini file, which very much exists on my system. The real problem was the owner of the file was root, and the owner only had read privileges. Changing that to have my account read/execute privileges to everything inside praw fixed the issue.

trac error : Unable to get database connection within 0 seconds

Recently I tried to install Trac on my Fedora 15, but I got trouble.
I followed steps with this link: http://www.diybl.com/course/6_system/linux/Linuxjs/20100524/204237.html
Yeah, it was wonderful and finally it worked. But after I add a [header_logo] section in trac.ini, it came out this error. And I tried to delete the [header_logo] section, but strangely it wouldn't work. And I don't know why.
I have searched the internet and got this link: http://axcoto.com/blog/article/840.
Yeah, as this link says, it is a permission error. But even after I change all things to the top level of permission, it didn't work either. I must confess that I'm bored. Can anyone help me? Thanks with all my heart.
The [header_logo] section is totally unrelated to the other issue - Trac complaining for not getting a connection to the Trac db backend.
Corresponding settings for that are in section [trac] (with default value):
database = sqlite:db/trac.db
more like user, passwd,... depending on your db type
Two more things to look at:
create a second, fresh Trac environment and compare the trac.ini in it against the one you've possibly damaged (You know the diff command, don't you?)
compare permission settings of your Trac db file /db/trac.db
I recently had this problem too when I had the migrate an old SVN/Trac system to an internally available legacy box and it turned out that SQLite wasn't installed on my system.
I'm on Ubuntu and simply had to do a:
sudo apt-get install sqlite
For me this solved the problem.

Could not find the GEOS library

i am working on a simple employee listing Django application. i wanted to include filtering in my app, so tried installing django-filter module. i think django-filter is not installed properly ( i am not going to use it anyway). But after doing this, when i try to run my application, it gives this ,
"`ViewDoesNotExist at /employeeList/` ;
Could not import task.employeeDetails.views. Error was: Could not find the GEOS library (tried "geos_c", "GEOS"). Try setting GEOS_LIBRARY_PATH in your settings "
. while i searched for the error,came to know the error is due to some wrong geoDjango installation. But i dont need geoDjango and i am wondering how its throwing this error. Before doing this, my app was working fine. Somebody please help me to solve this problem.
Things to check:
Are you using the GeoDjango database classes? If your database engine is set to something like django.contrib.gis.db.backends.postgis or django.contrib.gis.db.backends.mysql, those are the geo backends. What you want is something like django.db.backends.postgresql_psycopg2 or django.db.backends.mysql. Not the lack of the "contrib.gis" part.
The other most likely possibility is that task.employeeDetails.views is importing or running something that requires GEOS.

Categories