-1

I'm using django on vscode, and typed this on terminal:

(impassion) Subinui-MacBook-Pro:impassion_community subin$ python3 manage.py makemigrations

but can't use makemigrations

got this error message

ModuleNotFoundError: No module named 'impassionuser'

how can I solve this problem?

I'm using MacOSX, VSCode, django and setup virtualenv

I expected to see follow messages

Migrations for 'impassionuser':
 impassionuser/migrations/0001_initial.py
 -Create model impassionuser

In settings.py, I already added 'impassionuser'

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'impassionuser',
    'board'
]
Brett Cannon
  • 14,438
  • 3
  • 45
  • 40
Dpseh
  • 1
  • 2
  • Did you pip install it to a virtual environment? If so, you need to activate your virtual environment with source myvenv/bin/activate. If you haven't set up a virtual environment yet, you might have installed the module in the wrong directory. Make sure to install the module into the main directory of your project. – Scircia Jun 19 '19 at 11:50
  • first code I wrote on Terminal was `pip3 install virtualenv` and then `virtualenv impassion` – Dpseh Jun 19 '19 at 11:55
  • Is your app named impassionuser? If yes, make sure you have added it to the `INSTALLED_APPS` of your settings.py file. – Sanip Jun 19 '19 at 12:05
  • yes I added `impassionuser` to the ` INSTALLED_APPS` – Dpseh Jun 19 '19 at 12:20

1 Answers1

0

Did you register your model in admin.py.

 # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from .models import mymodel


admin.site.register(mymodel)

Hopefully this will help.

Also check this Django Tutorial

Talha Murtaza
  • 324
  • 1
  • 2
  • 17