Forums

pa_autoconfig_django.py automatically installs django1.1

So I am getting this error :

   python from django.urls import path    
ImportError: cannot import name 'path'

which basically occurs because 'path ' only works for django2.0.2 when I type "django-admin --version" in my bash I get 2.0.2 as the output. Hence pa_autoconfigure_django.py is set in such a way that it installs django1.1 by default irrespective of django2.2 already existing and it does it everytime when I run -

pa_autoconfigure_django.py <github repo url>

I also tried -

pa_autoconfigure_django.py <github repo url> --python=3.6

Since django2.0 is supported in 3.6 only but I am sure the problem lies in the pa_autoconfigure_django.py file.

So I ran this first -

 pip3.6 install --user pythonanywhere
 pa_autoconfigure_django.py https://github.com/outcastdreamer/Django-projects.git --python=3.6 --nuke

And encountered this - (Kindly notice the part with emphasis on it)

< Running API sanity checks > \ ~<:>>>>>>>>> Cloning into '/home/outcastdreamer/outcastdreamer.pythonanywhere.com'... remote: Counting objects: 6198, done. remote: Compressing objects: 100% (3328/3328), done. remote: Total 6198 (delta 1873), reused 6198 (delta 1873), pack-reused 0 Receiving objects: 100% (6198/6198), 11.91 MiB | 5.58 MiB/s, done. Resolving deltas: 100% (1873/1873), done. Checking connectivity... done. Checking out files: 100% (4342/4342), done. < Creating virtualenv with Python3.6 > \ ~<:>>>>>>>>> Removing outcastdreamer.pythonanywhere.com... Did not find environment /home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com to remove. Running virtualenv with interpreter /usr/bin/python3.6 Using base prefix '/usr' New python executable in /home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/bin/python3.6 Also creating executable in /home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/bin/python Installing setuptools, pip, wheel...done. virtualenvwrapper.user_scripts creating /home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/bin/predeactivate virtualenvwrapper.user_scripts creating /home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/bin/postdeactivate virtualenvwrapper.user_scripts creating /home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/bin/preactivate virtualenvwrapper.user_scripts creating /home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/bin/postactivate virtualenvwrapper.user_scripts creating /home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/bin/get_env_details

< Pip installing django<2 (this may take a couple of minutes) > \ ~<:>>>>>>>>> Collecting django<2 Using cached Django-1.11.10-py2.py3-none-any.whl Collecting pytz (from django<2) Using cached pytz-2018.3-py2.py3-none-any.whl Installing collected packages: pytz, django Successfully installed django-1.11.10 pytz-2018.3

< Creating web app via API > \ ~<:>>>>>>>>>

< Adding static files mappings for /static/ and /media/ > \ ~<:>>>>>>>>>


/ Updating wsgi file at \ \ /var/www/outcastdreamer_pythonanywhere_com_wsgi.py /


\ ~<:>>>>>>>>>

< Updating settings.py > \ ~<:>>>>>>>>>

< Running collectstatic > \ ~<:>>>>>>>>> Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/inline-delete.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/icon-addlink.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/icon-changelink.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/calendar-icons.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/tooltag-add.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/icon-unknown.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/LICENSE' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/tooltag-arrowright.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/icon-yes.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/icon-deletelink.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/icon-unknown-alt.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/sorting-icons.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/search.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/selector-icons.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/icon-alert.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/README.txt' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/icon-no.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/icon-clock.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/icon-calendar.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/gis/move_vertex_off.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/img/gis/move_vertex_on.svg' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/css/forms.css' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/css/changelists.css' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/css/dashboard.css' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/css/fonts.css' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/css/login.css' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/css/widgets.css' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/css/base.css' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/css/rtl.css' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/fonts/Roboto-Light-webfont.woff' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/fonts/LICENSE.txt' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/fonts/Roboto-Bold-webfont.woff' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/fonts/README.txt' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/fonts/Roboto-Regular-webfont.woff' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/SelectBox.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/collapse.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/calendar.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/timeparse.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/jquery.init.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/urlify.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/inlines.min.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/actions.min.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/SelectFilter2.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/prepopulate.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/change_form.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/prepopulate_init.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/actions.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/collapse.min.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/prepopulate.min.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/inlines.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/cancel.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/core.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/popup_response.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/LICENSE-JQUERY.txt' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/vendor/xregexp/LICENSE-XREGEXP.txt' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/vendor/xregexp/xregexp.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/vendor/xregexp/xregexp.min.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js' Copying '/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js'

61 static files copied to '/home/outcastdreamer/outcastdreamer.pythonanywhere.com/static'.

< Running migrate database > \ ~<:>>>>>>>>> Traceback (most recent call last): File "/home/outcastdreamer/outcastdreamer.pythonanywhere.com/manage.py", line 15, in <module> execute_from_command_line(sys.argv) File "/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/core/management/init.py", line 364, in execute_from_command_line utility.execute() File "/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/core/management/init.py", line 356, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/core/management/base.py", line 283, in run_from_argv self.execute(args, cmd_options) File "/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/core/management/base.py", line 327, in execute self.check() File "/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/core/management/base.py", line 359, in check include_deployment_checks=include_deployment_checks, File "/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 62, in _run_checks issues.extend(super(Command, self)._run_checks(kwargs)) File "/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/core/management/base.py", line 346, in _run_checks return checks.run_checks(*kwargs) File "/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/core/checks/registry.py", line 81, in run_checks new_errors = check(app_configs=app_configs) File "/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/core/checks/urls.py", line 16, in check_url_config return check_resolver(resolver) File "/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/core/checks/urls.py", line 26, in check_resolver return check_method() File "/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/urls/resolvers.py", line 254, in check for pattern in self.url_patterns: File "/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/utils/functional.py", line 35, in get res = instance.dict[self.name] = self.func(instance) File "/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/urls/resolvers.py", line 405, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/utils/functional.py", line 35, in get res = instance.dict[self.name] = self.func(instance) File "/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/site-packages/django/urls/resolvers.py", line 398, in urlconf_module return import_module(self.urlconf_name) File "/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 978, in _gcd_import File "<frozen importlib._bootstrap>", line 961, in _find_and_load File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 655, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed File "/home/outcastdreamer/outcastdreamer.pythonanywhere.com/codenium/urls.py", line 17, in <module> from django.urls import path ImportError: cannot import name 'path' Traceback (most recent call last): File "/home/outcastdreamer/.local/bin/pa_autoconfigure_django.py", line 56, in <module> main(arguments['<git-repo-url>'], arguments['--domain'], arguments['--python'], nuke=arguments.get('--nuke')) File "/home/outcastdreamer/.local/bin/pa_autoconfigure_django.py", line 43, in main project.run_migrate() File "/home/outcastdreamer/.local/lib/python3.6/site-packages/pythonanywhere/django_project.py", line 96, in run_migrate 'migrate', File "/usr/lib/python3.6/subprocess.py", line 291, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '[PosixPath('/home/outcastdreamer/.virtualenvs/outcastdreamer.pythonanywhere.com/bin/python'), PosixPath('/ho me/outcastdreamer/outcastdreamer.pythonanywhere.com/manage.py'), 'migrate']' returned non-zero exit status 1.

Thanks for reporting!

I believe you mean django 1.11 is installed.

That is intentional- I believe that currently the djangogirls tutorial is setup to work with django 1.11 and does not work with django 2.x

Is there any solution using which I can remove the error mentioned at first? I want to follow the tutorial but not use django 1.11 but django 2.x Thank you for your support!

Nevermind!! I just checked and my website is up and running! Did you guys make changes in the pa_autoconfigure_django.py file ? Because I didn't do anything to remove the error xD Thanks a ton!

no- also even if we did make changes, it wouldn't have affected you- you would still have to run the changed pa_autoconfigure_django.py for any changes to take effect?