Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6749401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:41:09+00:00 2026-05-26T12:41:09+00:00

I have a project which has just assimilated several apps from other projects of

  • 0

I have a project which has just assimilated several apps from other projects of mine to one main project. The structure is one main app that lies at the root url and other apps with specific urls. I have set up my urls.py:

url(r'^$', include('main_app.urls')),
url(r'^app1/', include('app1.urls')),
url(r'^app2/', include('app2.urls')),
url(r'^app3/', include('app3.urls')),

I have a model in my main_app models.py which describes my other apps along the lines of:

class App(models.Model):
    title = models.CharField()
    image = models.ImageField("App Image", upload_to="images/apps/", blank=True, null=True)
    description = models.TextField()

And in my main_app views:

def index(request):
    app_list = App.objects.all()
    return render_to_response('index.html',
            locals(), context_instance=RequestContext(request)) 

So, in my root index template (main_app) I want to cycle through all apps and print a link:

{% for app in app_list %}
    {{ some_app_variables }}
    <a href="???">Link to app</a>
{% endfor %}

My question is how should I define this link. Should I have a get_absolute_url for the app model?

Any help much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:41:10+00:00Added an answer on May 26, 2026 at 12:41 pm

    An app doesn’t inherently have some URL associated with it. URLs are tied to views, and those views could reference any model from any app or no models or apps at all for that matter. What’s you’re doing doesn’t make sense.

    UPDATE: I’m still unsure about what you’re linking to. An “app” is an abstract concept. I understand having a list of “Apps”, but what kind of view would you get for an individual app? Still, yes, you should have a get_absolute_url method on your Apps model. Then, your best bet would be to name whatever view in each app is going to be the “index” view something along the lines of “app_(title)”. Then you can construct the right reverse with something along the lines of:

    @models.permalink
    def get_absolute_url(self):
        return ('app_%s' % self.title, (), {})
    

    Of course, you should probably modify that with something akin to a slug to accommodate titles that might have multiple words, e.g. “Cool App” would need to be replaced with something like “cool_app”.

    Like I said, though, what you’re trying to accomplish still doesn’t make much sense from where I’m sitting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project which has shared functionality between three other projects and have
I have a project which has a calling structure similar to this: main project/application
I have one project which has RIAService with entity framework that is referenced to
I have a website project which includes several assemblies which are built separately. One
I have Django project on Dreamhost server which has several views that returns Json
I have two projects, the DLL project which has all my logic and data
I have a Flex3 project with 2 HorizontalList controls; one of which has drag
I have recently being trying to create a project which has several levels of
I have opened a project from Github, which has blue folders in its file
I have a project which has several components loaded by a single preloader swf.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.