Django Project Server not starting when running on linux server but running on local windows desktop

254 views
Skip to first unread message

abhijithez

unread,
Jul 26, 2019, 10:34:30 AM7/26/19
to Django users
Hi All,

I have created a Django Project that is working fine on local desktop but when I am starting the same on linux server using python manage.py runserver it shows the following:

$python manage.py runserver

Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
Traceback (most recent call last):
  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/django/core/managemen                                                                                                                                                             t/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/django/core/managemen                                                                                                                                                             t/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/django/core/managemen                                                                                                                                                             t/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/django/core/managemen                                                                                                                                                             t/commands/runserver.py", line 60, in execute
    super().execute(*args, **options)
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/django/core/managemen                                                                                                                                                             t/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/django/core/managemen                                                                                                                                                             t/commands/runserver.py", line 95, in handle
    self.run(**options)
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/django/core/managemen                                                                                                                                                             t/commands/runserver.py", line 102, in run
    autoreload.run_with_reloader(self.inner_run, **options)
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/django/utils/autorelo                                                                                                                                                             ad.py", line 587, in run_with_reloader
    start_django(reloader, main_func, *args, **kwargs)
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/django/utils/autorelo                                                                                                                                                             ad.py", line 572, in start_django
    reloader.run(django_main_thread)
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/django/utils/autorelo                                                                                                                                                             ad.py", line 290, in run
    self.run_loop()
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/django/utils/autorelo                                                                                                                                                             ad.py", line 296, in run_loop
    next(ticker)
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/django/utils/autorelo                                                                                                                                                             ad.py", line 336, in tick
    for filepath, mtime in self.snapshot_files():
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/django/utils/autorelo                                                                                                                                                             ad.py", line 352, in snapshot_files
    for file in self.watched_files():
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/django/utils/autorelo                                                                                                                                                             ad.py", line 251, in watched_files
    yield from iter_all_python_module_files()
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/django/utils/autorelo                                                                                                                                                             ad.py", line 103, in iter_all_python_module_files
    return iter_modules_and_files(modules, frozenset(_error_files))
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/django/utils/autorelo                                                                                                                                                             ad.py", line 116, in iter_modules_and_files
    if module.__name__ == '__main__':
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/py/_apipkg.py", line                                                                                                                                                              171, in __getattribute__
    return getattr(getmod(), name)
  File "/home/mluser/anaconda3/lib/python3.5/site-packages/py/_error.py", line 4                                                                                                                                                             3, in __getattr__
    raise AttributeError(name)
AttributeError: __name__

What could be the issue?

Jorge Gimeno

unread,
Jul 26, 2019, 11:14:04 PM7/26/19
to django...@googlegroups.com
What version of Django are you running?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b2e867f4-3d12-4a5e-b035-cabc7419e294%40googlegroups.com.

Abhijith E

unread,
Jul 26, 2019, 11:22:41 PM7/26/19
to django...@googlegroups.com
It's the latest version.
Also I am using Anaconda Distribution with Python 3.5

Jorge Gimeno

unread,
Jul 27, 2019, 2:51:49 AM7/27/19
to django...@googlegroups.com

Top Dolla

unread,
Jul 27, 2019, 1:45:17 PM7/27/19
to Django users
Agreed. Make sure the Python and Django versions are identical.

abhijithez

unread,
Jul 29, 2019, 9:01:02 AM7/29/19
to Django users
Thank You! The issue is solved now.

I removed the Anaconda installation and installed Python 3.6.3.
Also I downgraded to Django 2.1.10.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages