I will try to explain some more. I have managed to "render" project slug and project title into html. My template is inside "/django/django_templates/portfolio/" and is called "index.html". If I try to type in "mydomain.com/portfolio" I get the nice list of project name, and inside the "a href" I get the project slug. So far so good!
For my next step I need to get the project slug inside that same "a href" so my links looks like this: "mydomain/portfolio/category_slug/project_slug" I have tried with <a href="{{ category.slug }}/{{ project.slug }}"> but I think I need to write a new function inside views.py in my "portfolio" app, that will bring out that category slug, because it's not rendring out the category slug now. That's step one, but then I'll only have the correct link the way I want. Step 2 is getting that url to work. I understand I need to make a "rule" inside urls.py, but Im not sure how I get the desired rule to work. My portfolio urls looks like this now (with corrected typos) # Portfolio: (r'^portfolio/$', 'myproject.portfolio.views.index'), (r'^portfolio/(?P<category_slug>\d+)/$', 'myproject.portfolio.views.list'), (r'^portfolio/(?P<category_slug>\d+)/(?P<project_slug>\d+)/$', 'myproject.portfolio.views.detail'), if I try to type in "mydomain/portfolio/category_slug/" (mydomain/portfolio/3d/) I only get a regular 404 Page not found error. If I try "mydomain/portfolio/1/" (1 being the id for the first category) I get a ViewDoesNotExist. That's fine, I don't want people to be able to use the id of the category anyways, I want the category slug instead. But if there is a easy way to do both it would be great. ----- I still can't get anything from the category model, but here is what I have tried to do on my own so far. : ---- This is the views.py in my portfolio app folder (if you know a better name instead of "list", let me know): ---- from django.shortcuts import render_to_response from myproject.portfolio.models import Project from myproject.portfolio.models import Category from django.http import HttpResponse # Create your views here. def index(request): latest_project_list = Project.objects.all().order_by('-created') return render_to_response('portfolio/index.html', {'latest_project_list': latest_project_list}) def list(request, category_slug): category_slug_list = Category.objects.all() return render_to_response('portfolio/index.html', {'category_slug_list': category_slug_list}) ---- And here is my portfolio/index.html (inside /django_templates/) ---- <h2>Projects</h2> {% if latest_project_list %} <ul> {% for project in latest_project_list %} <li><a href="{{ category.slug }}/{{ project.slug }}">{{ project.title }}</a></li> {% endfor %} </ul> {% else %} <p>No Projects are available.</p> {% endif %} <h2>Categories<h2> {% if category_slug_list %} <ul> {% for category in category_slug_list %} <li>{{ category.slug }}</li> {% endfor %} </ul> {% else %} <p>No Category are available.</p> {% endif %} ---- The only thing that is getting renderd is the project.slug and project.title. I have never coded in python before, and I've only done minor php coding before. Im more the design/html/css guy. I think that's the reason Im moving in such a slow pace. I hope this is a bit clearer and will make it easier to help me :) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---