I'm new to Django and have been going through the
Mozilla Tutorial
using PyCharm on a Windows machine. While doing the
Djangogirls tutorial
and couple of weeks ago, I learned about PythonAnywhere and had the Djangogirls working on PythonAnywhere. I got rid of that web app and now I've trying to deploy Mozilla the same way - it's working on my Windows machine and I want to migrate it to PythonAnywhere. I'm following a step using
pa_autoconfigure_django.py
and the command failing while running
migrate database
:
I'm having the exact same problem trying to upload new Django Project.
..."returned non-zero exit status 1."
Would appreciate a hearing how to set up the requirements.text if this is the fix. Thanks
For me, I tried to use the newest version of Django (2.0.2?) in the local version, which caused this exact error. I had to basically through through the entire tutorial again with a new folder and install the old Django they specify (1.10.1? Something like this). Rerunning this command in Pythonanywhere's bash worked for me after that!
Thanks all. I'm using Django 2.0.2
Here is the Full Error Stack Trace.
<Runningmigratedatabase>Traceback(mostrecentcalllast):File"/home/resilientstudio/resilientstudio.pythonanywhere.com/manage.py",line22,in<module>execute_from_command_line(sys.argv)File"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/site-packages/django/core/management/__init__.py",line364,inexecute_from_command_lineutility.execute()File"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/site-packages/django/core/management/__init__.py",line356,inexecuteself.fetch_command(subcommand).run_from_argv(self.argv)File"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/site-packages/django/core/management/base.py",line283,inrun_from_argvself.execute(*args,**cmd_options)File"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/site-packages/django/core/management/base.py",line327,inexecuteself.check()File"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/site-packages/django/core/management/base.py",line359,incheckinclude_deployment_checks=include_deployment_checks,File"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/site-packages/django/core/management/commands/migrate.py",line62,in_run_checksissues.extend(super(Command,self)._run_checks(**kwargs))File"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/site-packages/django/core/management/base.py",line346,in_run_checksreturnchecks.run_checks(**kwargs)File"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/site-packages/django/core/checks/registry.py",line81,inrun_checksnew_errors=check(app_configs=app_configs)File"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/site-packages/django/core/checks/urls.py",line16,incheck_url_configreturncheck_resolver(resolver)File"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/site-packages/django/core/checks/urls.py",line26,incheck_resolverreturncheck_method()File"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/site-packages/django/urls/resolvers.py",line254,incheckforpatterninself.url_patterns:File"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/site-packages/django/utils/functional.py",line35,in__get__res=instance.__dict__[self.name]=self.func(instance)File"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/site-packages/django/urls/resolvers.py",line405,inurl_patternsFile"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/site-packages/django/urls/resolvers.py",lpatterns=getattr(self.urlconf_module,"urlpatterns",self.urlconf_module)File"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/site-packages/django/utils/functional.py",line35,in__get__res=instance.__dict__[self.name]=self.func(instance)File"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/site-packages/django/urls/resolvers.py",line398,inurlconf_modulereturnimport_module(self.urlconf_name)File"/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/lib/python3.6/importlib/__init__.py",line126,inimport_modulereturn_bootstrap._gcd_import(name[level:],package,level)File"<frozen importlib._bootstrap>",line978,in_gcd_importFile"<frozen importlib._bootstrap>",line961,in_find_and_loadFile"<frozen importlib._bootstrap>",line950,in_find_and_load_unlockedFile"<frozen importlib._bootstrap>",line655,in_load_unlockedFile"<frozen importlib._bootstrap_external>",line678,inexec_moduleFile"<frozen importlib._bootstrap>",line205,in_call_with_frames_removedFile"/home/resilientstudio/resilientstudio.pythonanywhere.com/base/urls.py",line18,in<module>fromdjango.urlsimportpathImportError:cannotimportname'path'Traceback(mostrecentcalllast):File"/home/resilientstudio/.local/bin/pa_autoconfigure_django.py",line56,in<module>main(arguments['<git-repo-url>'],arguments['--domain'],arguments['--python'],nuke=arguments.get('--nuke'))File"/home/resilientstudio/.local/bin/pa_autoconfigure_django.py",line43,inmainproject.run_migrate()File"/home/resilientstudio/.local/lib/python3.6/site-packages/pythonanywhere/django_project.py",line96,inrun_migrate'migrate',File"/usr/lib/python3.6/subprocess.py",line291,incheck_callraiseCalledProcessError(retcode,cmd)subprocess.CalledProcessError:Command'[PosixPath('/home/resilientstudio/.virtualenvs/resilientstudio.pythonanywhere.com/bin/python'),PosixPath('/home/resilientstudio/resilientstudio.pythonanywhere.com/manage.py'),'migrate']' returned non-zero exit status 1.
Just confirmed this is still an issue if you're using the djangogirls tutorial and accidentally installed django 2 instead of django 1 which they're using in the tutorial (https://tutorial.djangogirls.org/en/deploy/)
Another workaround is using the django.conf.urls module instead of the django.path module (which doesn't exist in django 1.11 installed by the pa_autoconfigure_django script).
Note: this will require further deviation from the tutorial as you continue. This is a good workaround if you started the tutorial using django 2 and are trying to avoid restarting with an earlier version.
As of today I ran into the same problem - started with the Djangogirls tutorial and ran the autoconfigure script with the above mentioned issues. I do not reeeally want to install an earlier version of Django, so is there a description/documentation of how to link my git repo (I used Bitbucket instead but shouldn't matter) manually to my account? So that I go through all necessary steps without using the automated script? Can anyone please provide a link? Do I have to uninstall/delete the project completely again from your servers before I do so? Thanks a lot!
[Sorry, Google helped: I'll try these instructions ] :-)
You're getting the error, because the Django Girls code is not for Django 2. It's not a problem with the script. The git repo that Django Girls provides will not run in Django 2.
If you want to, you can start with a git repo that is a minimal Django 1 app, use the autoconfigure script, upgrade your Django in the virtualenv and then continue with development using Django 2, but that will not necessarily follow the Django Girls tutorial.
Sorry, we have had to rate-limit your feedback sending. Please try again in a few moments...
Thanks for the feedback! Our tireless devs will get back to you soon.