django urlpattern wrong? need to accept 2 different parameters
<p>I'm working on building a django app for a small little game I'm building to integrate it. Instead of re-writing my app to use django's membership system I've added my small little game login system to the django site. My issue is with my ChangePassword url pattern.</p>

<pre><code>url(r'^ChangePassword/(?P&lt;userID&gt;[0-9]+)/(?P&lt;token&gt;/?$)', changepassword, name='Change Password'),
</code></pre>

<p>I get the following error in the terminal while trying to go to the page.</p>

<blockquote>
  <p>Not Found: /members/ChangePassword/11/aw7MdMn4DaFoPp6W4P+c4IZWXRAF9g==
  [14/Oct/2016 16:53:53] "GET /members/ChangePassword/11/aw7MdMn4DaFoPp6W4P+c4IZWXRAF9g== HTTP/1.1" 404 3294</p>
</blockquote>

<p>Am I missing a regex or do I have the pattern wrong? I've been going through user docs and question on here and found a solution yet. It needs to accept the userID and a special token so we know that we can reset/change the password.</p>

<p>Your regex pattern for the token:</p>

<pre><code>(?P&lt;token&gt;/?$)
</code></pre>

<p>Will match an optional forward slash <code>/</code> that <em>ends</em> the url. In other words it will match <code>/members/ChangePassword/11/</code> or <code>/members/ChangePassword/11//</code>.</p>

<p>You will need to modify so that it captures the characters in your token. Since it looks like <code>base64</code> encoding, which includes <code>[A-Z][a-z][0-9][+/=]</code>, you should be able to edit as follows:</p>

<pre><code>(?P&lt;token&gt;[A-Za-z0-9+/=]+$)
</code></pre>

python django python-2.7