views:

184

answers:

2

I followed the Djangoappengine instructions. I used their django-testapp and copied the following folders in the django-testapp folder according to what I understood the instructions to say:

  • django
  • djangoappengine
  • djangotoolbox

I then started the dev server by running:

manage.py runserver

Then navigated to

http://localhost:8000/

and got the "It worked!" page, which is great, but it says the following at the bottom:

You're seeing this message because you have DEBUG = True in your Django settings file and you haven't configured any URLs. Get to work!

I am an absolute beginner with Django and App Engine and Djangoappengine and Django-nonrel, so I am pretty lost. How do I configure URLs? Or a link to the how to will help.

I took a look at the Django tutorial, but am unsure how much of it is relevant to Djangoappengine and Django-nonrel as a lot of the starting steps have to do with SQL databases.

Basically some direction on how to get my app running will be great.

Thanx much.

+5  A: 

Mostly I think you should be able to follow the django tutorials as normal. You can create your models just like normal, create your views and urls etc. Just skip all the bits about setting up the database - that's already been done for you if djangoappengine is working properly.

You don't need to syncdb to get the database tables built - app engine will do that for you automatically.

You're probably better to use the App Engine admin system to start with which will probably be at http://localhost:8080/_ah/admin/ (or :8000 if that's where you've got it running) rather than the django admin system.

You don't even need to start with the database if you don't want. You should be able to run django-admin.py startapp myapp just fine to get yourself started.

Then:

  1. edit the views.py for that app and create a simple view function
  2. add the app to INSTALLED_APPS in your settings.py file
  3. create a url which points to your app's view in urls.py
  4. visit that url and see what happens

Ok, so that's mostly covered from page 3 of the tutorial onwards - most of 1& 2 can probably be skipped over in this instance.

The Django documentation is excellent tho, and most of it will be applicable even using Django-Nonrel on app engine.

pycruft
Thanx for that. That makes me feel a lot better. :) I'll try it out tomorrow night probably and will report back.
Jacques Bosch
@pycruft: Thanx a stack for your help! I got my app running and created 2 test views following the tutorial part 3. Awesome! Feels like I'm on track now. You saved me a lot of pain and time! Just another question about my folder structure, should my app necessarily be in a sub folder, or can it be in the root along with files such as manage.py and settings.py? What is best practice / reasons? Thanx much!
Jacques Bosch
I can't really answer as to what's best practice, but no your App doesn't have to be a subdir of your Project and as it happens I tend not to put mine there usually - I tend to view the App as a module providing some functionality and the Project as a single instance (site) making use of multiple modules. By way of example, django.contrib.auth and django.contrib.admin are just apps which you load from elsewhere. It just has to be on the sys path so it can be found.
pycruft
+1  A: 

Take a look at http://www.djangobook.com/. It's a free online book on Django. I've learned almost everything from this and the online Django documentation.

Justin