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 7756635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:52:27+00:00 2026-06-01T12:52:27+00:00

I have a place in my Django app where I need to construct a

  • 0

I have a place in my Django app where I need to construct a callback to my domain after a third-party auth, but I’m stuck on how to do this since that view in question doesn’t really map to one model (or rather, the view code references multiple models), and the docs for get_absolute_url() construction and permalinks all reference models.

For instance, in my template I currently have something like:

<a class="btn btn-danger large" href="http://to/third/party?api_key=noneyobiz&cb=http://localhost:8000/signup">Join via Somethingorother</a>

the line for this view in urls.py is:

    url(r'^signup/$', 'signup', name="signup"),

I want the hardcoded ‘http://localhost:8000/signup&#8217; to be dynamic. I’m hoping this functionality doesn’t depend on my using generic views. Actually I don’t understand why generating a permalink is even tied to models at all, it seems like it should only depend on the urlconf. What am I missing here?

  • 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-06-01T12:52:28+00:00Added an answer on June 1, 2026 at 12:52 pm

    permalink is a thin wrapper of django.core.urlresolvers.reverse. Its belongs to django.db.models to be a shortcut because we usually write reverse inside get_absolute_url of models. So use reverse here

    from django.core.urlresolvers import reverse
    path = reverse('signup')
    

    Update

    To use absolute URI, you could

    • hardcode in settings or use something like Site.objects.get_current() w/ the path you get from reverse or url to get the absolute URI, as Daniel suggested.
    • If your callback URI is in the same domain w/ the view rendering the template, you could rely on request to get actual absolute URI:

      request.build_absolute_uri(reverse('signup'))

    Furthermore, you may want to escape the URI in template, like {{ absolute_uri|urlencode }}. or in view through urllib.quote or urllib.urlencode

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

Sidebar

Related Questions

I have a form in my Django app (not in admin) that allows staff
I'm looking to deploy a django app on AWS (since I have some credit
Using Google App Engine and Django. Whenever I have a db.ReferenceProperty() inside a model
Suppose I have a Django app named blog. There's a model called Post and
I have some Django websites and I want to place them on the webserver
I'm using django/apache/sqlite3 and I have a django model that looks like this: class
I have a Django model that looks something like this: class Person(models.Model): name =
I have a Django template that I want to extend in multiple places. In
We have place a button on a view. When we press it, nothing happens.
In my string I have place holders like: ##NEWSLETTER## , ##FOOTER# ##GOOGLEANALYTICS## etc. Each

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.