__init__.py Won't Upload To Github Respository

223 views
Skip to first unread message

Sandy Leon

unread,
Sep 1, 2018, 11:18:02 AM9/1/18
to Django users
Hello everyone,
I am trying to upload my Django site files to github to then deploy with Heroku.
I have had no major problems except in trying to upload the folder that contains my Django site, github gets stuck on trying to upload '/mysite/polls/__pycache__/__init__.cpython-36.pyc'
Just to be clear, my project is called 'mysite' and the app that I made following the Django tutorial is called polls.
Thanks you in advance to anyone who can help.

Kasper Laudrup

unread,
Sep 1, 2018, 11:52:49 AM9/1/18
to django...@googlegroups.com
Hi Sandy,
I have no idea why you are not able to upload these files, but you
shouldn't be uploading cache files or compiled python modules to you git
repository anyway.

If you have any of these files in your local git repository, remove them
using "git rm".

Something like:

# find -name __pycache__ -exec git rm -r {} \;

And:

# find -name *.pyc -exec git rm {} \;

Ought to do it.

Then commit these changes with something like:

# git commit -m "Remove cache and object files from repository"

Finally add cache and compiled object files to you .gitignore. Something
like:

*.pyc
__pycache__

And try to push your changes again.

Be aware that I have not actually tested any of these commands, so
please be careful before blindly executing them.

Hope that helps a bit.

Kind regards,

Kasper Laudrup

Sandy Leon

unread,
Sep 1, 2018, 12:40:11 PM9/1/18
to Django users
I am removing the files as you suggested. I am having a bit of trouble with 'git commit' at the moment as it keeps crashing haha. I should be able to resolve it on my own, thanks again for your help.

Stephen J. Butler

unread,
Sep 1, 2018, 2:59:37 PM9/1/18
to django...@googlegroups.com
GitHub has an excellent set of gitignore files. My first commit to a project is always one of these:




--
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 post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/12e119ed-9ffe-d30a-2f88-71f8c70c37dd%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.

victor jack

unread,
Sep 2, 2018, 2:33:45 PM9/2/18
to django...@googlegroups.com
Thanks for the link stephen , really much appreciated.

Reply all
Reply to author
Forward
0 new messages