How do I get my MOOC as my own repository so that I can edit the pages?


#21

No such thing as a dumb question, just dumb assumptions :smile: Terminal would be the best I think. Open up and run

ls /Users/mattmclean024/.ssh/

#22

Ok, I’ve edited the file config according to the Heroku directions by adding this:

Host heroku.com
HostName heroku.com
IdentityFile /Users/mattmclean024/.ssh/id.heroku
IdentitiesOnly yes

Not sure if that is correct but when I run

git pull origin master

or

git push heroku master

I get an error:

Not a git repository (or any of the parent directories): .git

Do I need to run something before I run this…?

Thank you!


#23

I think you just need to make sure that you are in the mooc directory when you run git push. Iow, manage.py, settings.py and a bunch of other files should be there if you run ls.


#27

SUCCESS!

I fixed all of the merge errors and now I can make the edits and push the heroku master and they changes are reflected!

One thing that I did that is still unclear is that I seem to be pulling from the github repository and from the local files on my computer. Is that possible?
Should I be doing one or the other?


#28

Glad it’s working! The local files you have on you computer is a fully fledged copy of your repository on github, but the only person with access to it is you. So in actual fact, there are three repositories that you control, the one on github, the one on your computer and the one on the heroku instance. Pushing and pulling from any one of those are possible.


#29

Thanks Dirk!

I just have one issue at the moment that I’m trying to resolve. The custom url is coming back as “Bad Request” 400 error.

I had help from my provider setting up the customer URL so that is all correct. In fact I’ve informed Herku and they think that it has something to do with a setting in the Mechanical MOOC. Did I miss a setting somewhere? Here was their last reply to my support ticket:

Hi Matt,

From what I can tell your application is configured and working as expected on Heroku. It’s reachable at http://lit-dawn-6639.herokuapp.com. Your custom domain appears to be setup properly too – requests are being routed to your application. That said, you’re still getting a 400. The only thing that makes any sense is that there’s some setting in Mechanical MOOC that requires you to specify the custom domain you’re going to use (though their docs don’t mention it).

I recommend opening an issue with the creator/maintainer of Mechanical MOOC.


#30

Hah, there is indeed a setting you need to modify!

Update the MOOC_DOMAIN variable:

heroku config:set MOOC_DOMAIN=yourdomain.org

That should fix it!


#31

Thanks Dirk.

It didn’t do it for me though. First, I typed the domain incorrectly. Then I entered it in correctly. Did I need to run any kind of removal command?

Also, the custom domain I’ve created is learn.yciw.net. Should I use

heroku config:set MOOC_DOMAIN=learn.yciw.net

or

heroku config:set MOOC_DOMAIN=yciw.net

thank you!


#32

Sorry, just noticed this change wasn’t in git :frowning: .

Add

ALLOWED_HOSTS += [MOOC_DOMAIN]

to settings.py file after the line:

MOOC_DOMAIN = os.environ.get('MOOC_DOMAIN', '')

Then add, commit and push to heroku:

git add settings.py
git commit -m 'Add custom domain to ALLOWED_HOSTS'
git push heroku master

To set the config, run:

heroku config:set MOOC_DOMAIN=learn.yciw.net

no other cleaning up needed.


#33

That did it!! Thank you!

I’ll have something to share soon…

Also:: working through all of this has really helped me to better understand how Git and GitHub work. I’m forever grateful!


#34

Glad I could be of help :slight_smile: Looking forward to see what you have to share!