Open NaomiHoniker opened 4 years ago
The reason this isn't going to work is because of two reasons. As far as I know, GitHub pages don't support react based projects (someone correct me if I'm wrong), Theoretically, we could host the backend of the project on a separate computer but then we would require that to be up and running 24/7 (since GitHub pages would be up 24/7) instead of locally.
I found this, as far as building Pages with React goes. I'll look more into it, but I'm not super knowledgeable on React stuff just yet.
I remember trying to do something similar (maybe the same) to this in the previous project and I couldn't get it working. I'm not sure if I was doing it wrong or what. I encourage anyone to give it a shot tho.
I can confirm i've deployed a react project using github pages
also i've had good experiences in the past with heroku for a free backend - https://www.heroku.com/free
@chrisbendel do you know if this is the way to go? And if not can you point us in the right way?
@TAwc any tutorial will probably get you where you need to be, i personally used this as a template a while back https://github.com/gitname/react-gh-pages
What's going on with this issue? It's been here for a while. Any progress? I've used git hub pages before with react, so I can take over if you'd like. @RichardHoniker @TAwc
I haven't tried adding it to github pages, but logicly im not sure its the way to go...
I guess. I mean it would make it easier to show people our site. I don't think that database would work though.@TAwc
agreed. we would need to modify the site for basically production level code... and I'm not sure we are at that level yet. @JakeCapra
unless..... we just create a server. I have some spare laptops lying around. If we can figure out how to do it, I would donate one of my laptops to the cause. @TAwc . Also, it doesn't need to be "production level", you know, this is just a fun school project, not like we have people relying on this site. If it breaks it breaks.
Free hosting sites are also a thing, heroku is one option that i've used in the past
I was talking more about the database unless those hosting sites also handle that. @chrisbendel
https://www.heroku.com/python looks like they support django databases. You'd need to do a little digging but im assuming that would be an option on the free tier
No, I just mean like security issues, for example, CORS. Currently, we don't have them fully working and I don't know the extent of the damage someone could do without it. @JakeCapra
You should be able to get around CORS issues with something like this on your django backend:
http://www.srikanthtechnologies.com/blog/python/enable_cors_for_django.aspx
specifically you'd whitelist certain domains such as your localhost (when developing locally) as well as your deployed frontend domain
CORS_ORIGIN_ALLOW_ALL = False
CORS_ORIGIN_WHITELIST = (
'http://localhost:4200',
)
or you can yolo and just allow_all = True
This might be either a big issue or a small one, depending on how we want to do this. I've found that Github pages works really well for easily hosting web stuff on github, and I've already checked the box in the settings that gets it ready to be opened as a Pages site. Only problem is that for Pages to work, we need to have our home page be titled "index.html" (which it is), and (I believe) for index.html to be put in the root of the repository, not inside of a folder. We can either move it to root or attempt one of the fixes in this stackoverflow thread.
If you look in the settings page, the Pages section is also showing this warning:
Anyone who set up the back-end stuff know what this could mean?