I'm using django with postgresql. But when I run the app, I get the following error:
relation "django_session" does not exist
LINE 1: ...ession_data", "django_session"."expire_date" FROM "django_se...
I searched for this error, but the only situation people talked about was when the name of the table had mixed case characters. But the table name in my case is all in small letters so this shouldn't happen. What is wrong here?
Thanks
p.s.
This is the project I'm working with.
https://github.com/mirumee/saleor
You should just execute the migrate command:
docker-compose exec web python manage.py migrate
Then create superuser:
docker-compose exec web python manage.py createsuperuser
And enter in the new superuser log in.
Related
I'm Sorry to ask again, but i haven't gotten any solutions. my django blog works fine locally but after deploying to heroku, i started having an error. Please what can I do to resolve this?
The error states: "ProgrammingError at / relation "posts_post" does not exist LINE 1: ...evious_post_id", "posts_post"."next_post_id" FROM "posts_pos..."
Open command line of heroku :
heroku run bash
Make migration of database :
py manage.py makemigrations
Migrate database :
py manage.py migrate
Create super user :
py manage.py createsuperuser
Login as admin at your hosted site:
https://website url/admin
This will not upload your data at local server.
You may add data by creating superuser at heroku server
I don't have much details here, but relation does not exist means the table is not created.
So I suspect when deploying to heroku you created a new database but you haven't run the migrations for it.
So try to run the python manage.py migrate command on the heroku database.
Hello I am running a django app using Django. The app is working correctly . But when I add a new field in my model.py I got this error
ProgrammingError at /admin/challenges/challenge/
column challenge.category does not exist
LINE 1: ..., "challenge"."modified_at", "challenge"."title", "challenge...
I found similar questions but they didn't solve my problem.
I tried to run "python manage.py migrate" and it doesn't solve the problem
Could any one help me please ?
I think you have not done make migration command. Perform
python manage.py makemigrations
and then use command
python manage.py migrate
Here is a link to my github repo: https://github.com/hertweckhr1/api_foodcycle
My user endpoints work great. However when I try to reach my endpoint localhost:8000/api/donation/donations, I get back the error:
ProgrammingError at api/donation/donations relation "core_donation" does not exist Line 1: ...n"."pickup_endtime", "core_donation"....:
Link to Error Message
I have tried makemigrations donation and migrate several times. It says my migrations are up to date. Other posts similar to this, I have not been able to find a solution that works for me.
Thanks in advance!
Run these commands
python manage.py makemigrations
python manage.py migrate
Try to delete all stuff in migrations folder(only keep __init__.py file) and after that do migrations again:
python manage.py makemigrations
python manage.py migrate
I had my Django app running on Heroku, but now I want to migrate it to my own web server. Everything went fine except the PostgreSQL database: I exported the database from Heroku and imported the dump file into my own PostgreSQL. When I run python manage.py syncdb i get the following error:
django.db.utils.ProgrammingError: no schema has been selected to create in
When I open any page in my browser I get this error:
relation "django_session" does not exist
LINE 1: ...ession_data", "django_session"."expire_date" FROM "django_se...
What is the best way to migrate the app (and the database)?
You probably don't have a public schema in your database. Run this in your database to create it:
CREATE SCHEMA public;
After that you don't need to run syncdb, just run:
./manage.py migrate
i purchased an outsource service to develop a web site in django to be deployed in heroku and AWS S3 (boto package).
Unfortunately the developer did not comment the code, despite it was asked, and left the project uncompleted for following up with a bigger client.
I've hired another django 'expert' to fix a part which was not developed, and he want to (over)charge for deployment testing, which i think should be a normal matter for good practices! i am working on my own budject, and need to work it out myself.
I was able to make the project run locally and make myself the frontend templates which were not fully developed, but I am having issues in deploying the code on my own staging environment.
I set up a staging environment under my credential to check if everything is ok, before pushing to production.
I think I almost get there, though:
heroku run python manage.py migrate --all --noinput --app my-app-staging
generate in the console:
Running `python manage.py migrate --all --noinput` attached to terminal... up, run.4833
DatabaseError: relation "south_migrationhistory" does not exist
LINE 1: ...gration", "south_migrationhistory"."applied" FROM "south_mig...
In the browser:
DatabaseError at /
relation "django_site" does not exist
LINE 1: ..."django_site"."domain", "django_site"."name" FROM "django_si...
^
Request Method: GET
Request URL: http://my-app-staging.herokuapp.com/
Django Version: 1.5.6
Exception Type: DatabaseError
Exception Value:
relation "django_site" does not exist
LINE 1: ..."django_site"."domain", "django_site"."name" FROM "django_si...
^
Exception Location: /app/.heroku/python/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py in execute, line 5
I checked my settings and they look ok:
i check AWS S3 bucket and it is able to write there;
settings in heroku console display that the db has been created.
I followed:
Heroku created table but when I'll migrate, he says that doesn't created
but it looks my locals.py are ok too, and in my local git branch .gitignore will exclude db.sqlite
My git and heroku ssh keys have been generated and added, so i dont' think it is an issue of authentification.
How could i check that the db is properly connected to django project and I am not invalidated?
Could you please help in debriefing to understand what this error means and how to solve it?
So much thank you.
It sounds like you might not have created the initial South migration tables on your staging server. This is actually done using syncdb:
Once South is added in, you’ll need to run ./manage.py syncdb to make the South migration-tracking tables (South doesn’t use migrations for its own models, for various reasons).
To run this on Heroku, you'll probably want to use something like
heroku run python manage.py syncdb
Once this is done, you should be able to move forward with the South commands.