class SingleEnd(models.Model):

file = models.FileField(upload_to='documents/')
email = models.CharField(max_length=100)

def __str__(self):


    from app.models import SingleEnd
class SingleEndForm(forms.ModelForm):
    class Meta:
        #shows which model to use from           
        model = SingleEnd
        #fields = '__all__'
        fields = ['file', 'email']

        labels = {
            'file': 'input your fasta/fastq file (min 3 sequences)',
            'email':'input your email to get a notification for your results in a timely manner',
        widgets = {


    #defines a view function    
def snippet_detail(request):
    #path to save inputs
    media_path = "/home/project/media/documents/"
    #path to save outputs
    result_path = '/home/project/media/results'
    max_timeout = 1*24*60*60 #days*hours*mins*secs

    #dictionary-like object that uses form data
    if request.method == 'POST':
        #use the form to upload form info (post) and files
        form = SingleEndForm(request.POST, request.FILES)
        if form.is_valid():
            #saves full form 
            form = SingleEndForm(file=request.FILES['file'])

            #changes file name if the name is the same
            file_name_final =[10:]
            #final path
            file_path = media_path + file_name_final
        else :
            raise Http404("Form not entered correctly")
    #form used 
    form = Kraken2Form()
    #returns a web response (Html, image etc)
    return render(request, 'page.html', {'form': form})


    Traceback (most recent call last):
  File "/usr/lib/python3.8/", line 932, in _bootstrap_inner
  File "/usr/lib/python3.8/", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/.local/lib/python3.8/site-packages/django/utils/", line 64, in wrapper
    fn(*args, **kwargs)
  File "/home/.local/lib/python3.8/site-packages/django/core/management/commands/", line 125, in inner_run
  File "/home/.local/lib/python3.8/site-packages/django/utils/", line 87, in raise_last_exception
    raise _exception[1]
  File "/home/.local/lib/python3.8/site-packages/django/core/management/", line 398, in execute
  File "/home/.local/lib/python3.8/site-packages/django/utils/", line 64, in wrapper
    fn(*args, **kwargs)
  File "/home/.local/lib/python3.8/site-packages/django/", line 24, in setup
  File "/home/.local/lib/python3.8/site-packages/django/apps/", line 116, in populate
  File "/home/.local/lib/python3.8/site-packages/django/apps/", line 304, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/lib/python3.8/importlib/", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/project/app/", line 29, in <module>
    from app.views import workflow
  File "/home/project/app/", line 21, in <module>
    from .forms import SingleEndForm
  File "/home/project/app/", line 22, in <module>
    from app.models import SingleEnd
ImportError: cannot import name 'SingleEnd' from partially initialized module 'app.models' (most likely due to a circular import) (/home/project/app/

enter image description here

stack overflow ImportError: cannot import name '..' from partially initialized module '..' (most likely due to a circular import)