60👍
If you look at the release notes for django 1.9
, syncdb
command is removed.
Please use migrate
instead. Moving forward, the migration commands would be as documented here
Please note that the django-1.9 release is not stable as of today.
Edit: Django 1.9 is stable now
8👍
the new django 1.9 has removed “syncdb”,
run “python manage.py migrate”,
if you are trying to create a super user, run “python manage.py createsuperuser”
- [Django]-How do I import the Django DoesNotExist exception?
- [Django]-Count() vs len() on a Django QuerySet
- [Django]-Django model object with foreign key creation
7👍
$python manage.py syncdb
is deprecated and not supported now.
So instead of this follow below instructions..
Whatever model you have created:
First run:
$python manage.py makemigrations
After running this command you model will be reflected in a migration.
Then you have to run:
$python manage.py migrate
Then run server:
$python manage.py runserver
Now, your project will run perfectly.
- [Django]-Django: Detect database backend
- [Django]-Django urls without a trailing slash do not redirect
- [Django]-Django and postgresql schemas
2👍
In Django 1.9 onwards syncdb
command is removed. So instead of use that one, you can use migrate
command,eg: python manage.py migrate
.Then you can run your server by python manage.py runserver
command.
- [Django]-Django static annotation
- [Django]-Convert an IP string to a number and vice versa
- [Django]-Get absolute file path of FileField of a model instance in Django
1👍
Django has removed python manage.py syncdb
command now you can simply use python manage.py makemigrations
followed bypython manage.py migrate
. The database will sync automatically.
- [Django]-Dynamically exclude or include a field in Django REST framework serializer
- [Django]-In Django, how do you make a model refer to itself?
- [Django]-Os.getcwd() vs os.path.abspath(os.path.dirname(__file__))
1👍
I had the same problem, the only thing worked for me was this command.
python3 manage.py migrate --run-syncdb
Running this got me this result.
Ranvijays-Mac:djangodemo rana.singh$ python3 manage.py migrate --run-syncdb
Operations to perform:
Synchronize unmigrated apps: messages, staticfiles
Apply all migrations: admin, auth, contenttypes, msg, sessions
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Running migrations:
Applying msg.0001_initial... OK
- [Django]-Is django prefetch_related supposed to work with GenericRelation
- [Django]-How can I allow django admin to set a field to NULL?
- [Django]-IntegrityError duplicate key value violates unique constraint – django/postgres
0👍
You can run the command from the project folder as: “python.exe manage.py migrate
“, from a commandline or in a batch-file.
You could also downgrade Django to an older version (before 1.9) if you really need syncdb.
For people trying to run Syncdb from Visual Studio 2015:
The option syncdb was removed from Django 1.9 (deprecated from 1.7), but this option is currently not updated in the context menu of VS2015.
Also, in case you didn’t get asked to create a superuser you should manually run this command to create one: python.exe manage.py createsuperuser
- [Django]-How to get Request.User in Django-Rest-Framework serializer?
- [Django]-Django, filter by specified month and year in date range
- [Django]-Datetime and timezone conversion with pytz – mind blowing behaviour
0👍
Run the command python manage.py makemigratons,and than python manage.py migrate to sync.
- [Django]-MySQL ERROR 2026 – SSL connection error – Ubuntu 20.04
- [Django]-Django access the length of a list within a template
- [Django]-Use Python standard logging in Celery
0👍
Alternarte Way:
- Uninstall Django Module from environment
- Edit Requirements.txt a type Django<1.9
- Run Install from Requirments option in the enviroment
- Try Syncdb again
This worked for me.
- [Django]-Django default=timezone.now + delta
- [Django]-How to reset db in Django? I get a command 'reset' not found error
- [Django]-Editing django-rest-framework serializer object before save
0👍
I also tried this command. Lastly I found the release note from django
Features removed in 1.9
The syncdb command is removed.
- [Django]-How to run Debug server for Django project in PyCharm Community Edition?
- [Django]-How can I get the object count for a model in Django's templates?
- [Django]-Django MEDIA_URL and MEDIA_ROOT