Confused about the urls in app-engine-patch - django

In app-engine-patch (http://code.google.com/p/app-engine-patch/) ...
How on earth does the sample application know that the /person url maps to the myapp application?
I'm trying to understand the url structure to everything and
I've looked through the urls and I can't see it anywhere...
Source can be seen on mercurial here:
http://bitbucket.org/gumptioncom/appenginepatch-sample/src/
The application is running here:
http://aep-sample.appspot.com/
If anyone could help me out on this one I'd really appreciate it, thank you.

So I figured it out for anyone that wants to know ...
The url mapping that sends /person to myapp is in the urlsauto.py file under the myapp directory.
You can see it clearly here:
http://bitbucket.org/gumptioncom/appenginepatch-sample/src/tip/myapp/urlsauto.py

Related

Django/Apache2 Context variables not availables

i'm a Django/Apache novice.
following lots of tutorial i was able to build my small app for Home Domotic.
Nevertheless i'm now experiencing a new problem.
In Django app i have some templates that i call with views passing some CONTEXT variables.
When i load the page with the internal Django Web Server (RUNWEBSERVER) the variables values are printed on the screen, but when i load the page with Apache the variables values are missing.
Can somebody help me ?
Thank you.
Ciao.
g
Solved !!!
Is seems that Apache need a restart before reading python code modify.
Thanks all. Ciao.

Django detective spots POST requests

I installed django-detective last night and today there are many weird post requests in it.
It looks like somebody is trying to post stuff like this on my website:
/wp-admin/admin-post.phpnd_stats_value_import_settings=home[nd_stats_option_value]https://dodgylookingsite.com/pret
Please do not go to this link as I think it might be hosting malware !!
What does this mean?
How can I prevent this from happening?
Thank you
Apparently this looks for known WordPress vulnerabilities (wp-admin).

how to use swagger in django

I'm a beginner of swagger, i have a website written in django(already done), and i want to use swagger to exhibit my apis. I'v read the docs in swagger.io for days, but I still need more help.
I also tried the Django REST Swagger(https://github.com/marcgibbons/django-rest-swagger). I tried the basic example (http://django-rest-swagger.readthedocs.org/en/latest/examples.html#basic-example-with-a-viewset), but it still not work.
Maybe i did something wrong, can anyone help me?
The Django Rest Swagger package is very useful for this.
Did you put 'rest_framework_swagger' into your INSTALLED_APPS setting?
If you did, just put the url(r'^docs/', include('rest_framework_swagger.urls')) in the urls.py where you are exposing your API endpoints and it should display all the other url's that you have in that file.

How to relocate the django admin site below root?

The contrib admin site of Django is a perfect starting point for simple in-house applications that lots of people use.
I've done a bit of searching and seen the discussions of media and tools for working with and merging static media for the admin site. But it is still pretty fragmented and opaque.
Assume I have a site "mysite" with an application "myapp" that is derived from the admin app.
I would really appreciate an example of relocating mysite and myapp, including the admin app, onto a web server where it is not at the root url.
I think this use case would flush out a lot of the issues and confusion that I see people have.
I think what you want to do is use the FORCE_SCRIPT_NAME = '/path/not/at/root/of/domain' option in your settings.py file. No trailing /.
http://docs.djangoproject.com/en/1.3/ref/settings/#force-script-name
I hope I'm understanding your question right and I hope this helps solve it.
Edit: oops gave link to old docs...updated with new docs version
Edit2: Here is another link describing this here at djangoproject again.

django-authopenid provider icons / buttons missing

I followed the setup instructions for django authopenid application. As far as I can tell it is working properly. However, I cannot see the provider buttons/icons for yahoo, google, etc on the sign in with openID portion. Anyone had this problem? Thanks.
If you are bothered only about getting the images and don't mind looking elsewhere, you can get the buttons from this open source project: openid-selector. See this page for a demo.
turns out my issue had to do with media settings in settings.py. I was plugging 'authopenid' into an existing project. So, I already had settings related to media. To solve it, I just the melded my media structure into the one in the 'authopenid' example that comes in the package.