2
Gahh, the answer was that I had commented out my main app’s entry from INSTALLED_APPS
. Which is silly.
4
First of all, if it worked before, I can’t explain why it no longer is.
You should inspect the sqlite file itself, and see if the table is there. (The file is usually found at the root as db.sqlite3
, and can be opened with any standard sqlite browser)
You mentioned you’ve been running migrate, but is the actual migration there already?
Run python manage.py makemigrations
first if you haven’t. If need be, verify the migration file itself.
There’s also the python manage.py inspectdb
command that could give you some insight to the models you’re using.
If still nothing, you could of course start from scratch. I’ve probably missed a shortcut somewhere, but I’d:
- Create a copy of data you do need to keep
(python manage.py dumpdata --indent=4 <appname>
) (Save this into fixtures) - delete migrations files
- delete
db.sqlite3
- run
python manage.py makemigrations
- run
python manage.py migrate
- use
python manage.py loaddata <fixture-name>
to reload old data
- [Django]-Django FileField not saving to upload_to location
- [Django]-Django get current view in template
- [Django]-How does djangoproject.com do its deploy to prod? Should I package my django project to deploy it?
- [Django]-Add django class based view to admin site
- [Django]-TemplateDoesNotExist in project folder django 1.8
3
I had the same problem but for me the solution was different. I had accidentally deleted the init.py in the migrations directory while cleaning which meant that some migrations were not running producing the same error. Replacing it solved the issue.
- [Django]-JSON Response from Django in Android
- [Django]-Wildcard searching in Django
- [Django]-Twilio – generate 6 digit random numbers
- [Django]-How to get django form value in javascript without saving it into model
1
I had the same issue. To fix it I exit out of the server by Control+C. Than migrate by running these two commands: $ python manage.py makemigrations
it tells me
Migrations for ‘profiles’:
profiles/migrations/0001_initial.py
- Create model profile
than I run $ python manage.py migrate
it tells me
Operations to perform: Apply all migrations: admin, auth,
contenttypes, profiles, sessions Running migrations:Applying profiles.0001_initial… OK
now I run the server again $ python manage.py runserver
and when I create the profile it shows
[24/Aug/2018 19:36:16] “GET /admin/profiles/profile/add/ HTTP/1.1” 200
4381[24/Aug/2018 19:36:19] “POST /admin/profiles/profile/add/ HTTP/1.1”
302 0[24/Aug/2018 19:36:19] “GET /admin/profiles/profile/ HTTP/1.1” 200
4376[24/Aug/2018 19:36:19] “GET /admin/jsi18n/ HTTP/1.1” 200 3217
[24/Aug/2018 19:36:19] “GET /static/admin/css/changelists.css
HTTP/1.1” 200 6170[24/Aug/2018 19:36:19] “GET /static/admin/img/tooltag-add.svg
HTTP/1.1” 200 331[24/Aug/2018 19:36:19] “GET /static/admin/img/icon-yes.svg HTTP/1.1”
200 436
and profile is created. Hope that help.
- [Django]-Django & South: Adding new field but DatabaseError occurs "table already exists"
- [Django]-Django unique combination of foreign keys
- [Django]-Renderer returned unicode, and did not specify a charset value
1
Okay its looks like you forget to run the migrations command; just go ahead and run the following command; in the Django shell:
$ python manage.py migrate
Then,
$ python manage.py makemigrations
- [Django]-Formatting Time Django Template
- [Django]-In stripe checkout page display Country or region fields how to remove it
- [Django]-Django: How to remove bullet point when printing form errors
- [Django]-Why Django translation does not use the base language in javascript?
- [Django]-How would you write an `is_pdf(path_to_file)` function in Python?
- [Django]-Django on IIS, process exited unexpectedly
- [Django]-Create a git repo for project skeleton