How can I get started developing with Django on Cloud9?
Asked Answered
P

3

7

So Cloud9 looks really cool, and you can create python files in it, but I can't figure out how to get it to run a Django project. I imported one from my github account into the IDE, but it says I need to install Django (a django.core import error) so I need to help getting going. Any Ideas? Any skeleton projects on the web that I missed that will do this?

Pereyra answered 29/8, 2012 at 23:57 Comment(1)
try "easy_install django" command firstBismuthous
B
20

After some research and looking for an answer on different blogs and sites I finally found a solution:

  • Create a new workspace
  • Execute easy_install django to install Django
  • Create new Django project python ./../bin/django-admin.py startproject myproject
  • Start dev server python ./myproject/manage.py runserver $IP:$PORT
  • Access http://projectname.username.c9.io
  • Voilà!!!

I hope this helps

Bismuthous answered 10/9, 2012 at 22:59 Comment(2)
Dont know if they changed it but $IP worked for me (instead of $OPENSHIFT_INTERNAL_IP). Just a heads up.Costanza
I had to use $PORT to make it runCardin
D
0

Just write commands in shell as it is: sudo pip install -r requirements.txt (you should have there django) than python manage.py runserver $IP:$PORT you will have app on https://projectname-username.c9.io

Despain answered 25/9, 2015 at 17:25 Comment(0)
L
0

You may also have to add the proper path: <workspace_name>-<username>.c9users.io to the ALLOWED_HOSTS list in django_project/settings.py file, as suggested by the error message returned by django server. Tested on Django 2.0

Largish answered 6/2, 2018 at 18:7 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.