New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error creating superuser #389
Comments
I had the same problem |
I had same problem too. |
sudo su - postgres psql dj_crm=# \d common_company
INSERT INTO common_company (name,sub_domain,user_limit,country) VALUES ('Ombrella Corp','IT',9999,'USA'); dj_crm=# select * from common_company;
\q exit on file: common/models.py change default of company with id of your company ( in my test id = 2)
save file and do : python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
|
python manage.py runserver 0.0.0.0:9000 I have this error on login:
Home page show:
probably is not ready to work? |
python manage.py collectstatic
but on crm/settings.py
and directory exist:
but probably STATIC_ROOT env is not present so I will add it on settings:
now collectstatic has no errors, and no files found... python manage.py collectstatic
but.... at runserver
|
Same issue facing me. @bdbais get you any solution for this? |
This is going to be SaaS. So, no need of super user. |
@ashwin31 Ok. Please let me know how can i login with subdomain? What is exact process so i can login. Please help me for this. thanks |
Add the subdomain to your host config file. /etc/hosts |
@ashwin31 Company does not exist. Please let me know how can i create new company. Please check the screenshot. I have get git repository on my local system. I have also create domain /etc/hosts (django-crm.com). I am tring to register new company but get the error. Please check the link |
Seems there has been some changes to the code but this issue still remains. The migration does not create the default Company anymore so I was able to add this into the database directly and update the user to be a part of this company. Point to note is that the Company sub_domain should be 'tenant1.localhost' and the name 'tenant1' Getting started with this project is not the easiest. |
@rjschave @liangsqrt @bdbais @shaikhmasud147 @nevros check readme.md I made it easy to setup and configure in local machines. Let me know if you find any further difficulties. |
@nevros you don't need to add company or user to database. You can register new company and user from the UI. |
How does one do that? I was following the readme and it does not provide much information on how to sign in. |
Ok, Today, I will do a video and add to readme.md |
Cloned copy of repo today (commit 4f0e1ae).
It seems the instructions may need to be updated. Instructions indicate the following:
local_settings.example doesn't exist, but _local_settings.py does. I ran the following command
I think
python manage.py makemigrations
should bepython manage.py migrate
After running
migrate
command I rancreatesuperuser
and received an error. The stack track is ~ 70 lines, but here are the relevant bits:psycopg2.errors.NotNullViolation: null value in column "company_id" violates not-null constraint
django.db.utils.IntegrityError: null value in column "company_id" violates not-null constraint
These errors occur when attempting to insert the user record into the table.
From the User model, it's clear the company field is required, but the createsuperuser does not account for this.
From common/models.py:
The text was updated successfully, but these errors were encountered: