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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:35:16+00:00 2026-06-11T13:35:16+00:00

My url is like – urlpatterns = patterns(‘network.network_api.views’, (r’^network/license/(?P<flag>\w{4,12})/?$’, ‘Check_License’), ) here i want

  • 0

My url is like –

urlpatterns = patterns('network.network_api.views',

(r'^network/license/(?P<flag>\w{4,12})/?$',             'Check_License'),

)

here i want to allow only flag (ACTIVATE or DEACTIVATE), Kindly help me that what are the changes i should make in my url.

  • 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-11T13:35:17+00:00Added an answer on June 11, 2026 at 1:35 pm

    Even though it seems like a nice solution to have hard-coded flag within the url, I think its better to leave such a logic to the view, and if the flag in neither of the supported flags, raise an error. That in my opinion is more flexible in case you need to add flags in the future.

    The following is if you still want a flag in the url. It makes sure the group which you use to add condition is not picked up by regex:

    url(r'^network/license/(?P<flag>(?:ACTIVATE)|(?:DEACTIVATE))/$', 'Check_License'),
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an url like this: http://www.w3schools.com/PHP/func_string_str_split.asp I want to split that url to
I have a URL like /admin/editblogentry?page=3&color=blue I want to alter the 'page' in the
I have a url like this: http://mywebsite.com/my-very-long-product-title/my_sku,default,pd.html I want to replace this string with
I have a URL like this: http://192.168.0.1:8080/servlet/rece I want to parse the URL to
Say currently I have url like : http://mydomain.com/showpost.php?p=123 Now I want to make it
I have a url like http://localhost:8020/stream.flv On request to my php sctipt I want
Currently I have a url like this http://<client_name>.website.com/index.php?function_name&cat=32 I want to set things up
I want to generate URL like.. It should include two IDs with employer and
I have a picture url like this http://www.address.com/image.jpg I want do dynamically save this
I have a URL like this http://subdomain.domain.com/xyz-200_some_information I want to convert this URL to

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.