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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:08:17+00:00 2026-06-09T00:08:17+00:00

I am working on a Django project on Google App Engine. I have a

  • 0

I am working on a Django project on Google App Engine. I have a URL like:

http://localhost:8080/[company]/projects/project

Note that [company] is a URL parameter defined in my urls.py like:

(r'(^[a-zA-Z0-9-_.]*)/projects/project/(\d*)', 'projects.views.project_form'),

I want to get the value of [company] from a middleware where I will set the GAE datastore namespace to the [company] value.

Is it possible to get the [company] parameter from the request object passed in the process_request method of middleware class?

  • 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-09T00:08:18+00:00Added an answer on June 9, 2026 at 12:08 am

    If you are using the process_view middleware, you will have access to the views arguments and therefore the company value. Have a look at the function’s definition:

    def process_view(self, request, view_func, view_args, view_kwargs)
        ...
    

    view_args is a list of positional arguments that will be passed to the view, and view_kwargs is a dictionary of keyword arguments that will be passed to the view.

    so you should just be able to grab it from there, something like:

    def process_view(self, request, view_func, view_args, view_kwargs):
        company = view_kwargs.get('company', None)
    

    Here’s some more info from the django book on how the named and unnamed groups in your urls translate to args and kwargs in your view:

    http://www.djangobook.com/en/1.0/chapter08/#cn38

    particularly

    This [named url groups] accomplishes exactly the same thing as the previous example, with one subtle difference: the captured values are passed to view functions as keyword arguments rather than positional arguments.

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

Sidebar

Related Questions

I am working on a django- Google app engine project. A user inserts some
I'm working on a Google App Engine project using Django. I noticed that for
I am working on a Django application on Google app engine (using app engine
I'm new to python, django and google app engine. All great tools and have
I have a django project running on my localhost and it is working very
I'm working on a django-nonrel project running on Google's AppEngine. I want to create
I have a django project that I have been working on as a solo
I have a django project, but for some reason basic jquery isn't working. <html>
I have a project that I am working on in django. There are a
I'm working on an intranet django project (not using GAE) for a company that

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.