how to make request.get_full_path() to work for uploading files in django 1.8 - python-3.x

This is related issue, (nothingisnecessary) suggested that request.get_full_path should work for my project, i have tried everything so far and still cannot get it working. Maybe there is someone who would be willing to help
Django 1.8 uploading files for a specific location
I just need to be able to upload files to the location which automatically would be created depending on the template.html that would be used at a time.
Desperate at this point ....
thank you

Related

Joomla 3 problems using Akeeba Release system with zip

I'm trying to use the Joomla ARS. I've set it up and it seems to work for everything except the download of zip files.
I've set it up so that you can see the file in the front end but when you click on it a:
The requested document was not found on this server
error is thrown.
I've tried directly linking the file and it downloads fine. I've also set up an article to check that it'll download and again it works fine. So I don't think there are any permission issues since the zip file can be downloaded just not by using ARS.
Finally I've also tried different file types in ARS and if I swap the zip file for an xml file or a pdf file they both download fine.
Any ideas about how to debug?
I figured it out :)
The site had add a suffix to url switched on which was stopping it getting the correct route. Changed that and it worked as expected.

Delete Asset In .exe File

I finished making a game, so I started testing it, and me, being the person I am, have deleted my project file and assets, so all I have is my .exe file. Now, when I run my .exe file, I find that there's an image that I don't need and I want to delete it. I've tried using Resource Hacker and XM Resource Editor, but I wasn't able to find the file I wanted. I used Unity to make the project if that helps. I've tried doing open recent, and that hasn't worked either. Help would be greatly appreciated!
P.S. This question is not on restoring my file, but removing the asset.
You need to delete an asset from game that you are running on a device? You can not remove it. That asset is now part of the binary that is your game.

why download apk file is buffered and gives user old version

We hold our landing page on Azure and it is for users to download an Android apk file. This landing page is a html file. Here is the markup for users to download:
download here
It all works fine until now. Users start to complain that the app they downloaded cannot work properly. But when we tested, it works fine.
Finally we find out that, although the link is
http://www.[mysite].com/android/[MyAndroidApp].apk
but sometimes when user click it, it goes to
http://101.44.1.131/cloud/223.210.55.28/files/9216...636//www.[mysite].com/android/[MyAndroidApp].apk
This is a buffer and holds an old version of our app!
Can anyone tell me why this happen and how can I prevent it buffer our old version?
How often do you update this apk file?
May be a caching issue, but not sure exactly.
Have you tried using Azure storage? Upload the file on there, and then link directly to it.
Should cost you less in the long run and not cause any buffering/cache issues
I would suggest you try to put version numbers after your filename. This is also a good practice for .js files. A problem is very often that it's cached and the cache not updated correctly. It's a general problem in the web.
So. Try to put version numbers after the file name, and let us know if this works.
Thank you all for your suggestions.
We have found the reason. Looking at the redirect url, it is actually some ISPs cached our apk files. They are doing this so that they can save themselves money and bandwidth. This is a common practice in some countries and is well documented.
How evil it is.
Our solution is thus change the file name very time we deploy a new version.

Azure does not update files on a web server (Pyramid wsgi-app)

I have a project Pyramid Application. I store it on git and pull the branch to the server when I need update. Until now I was working on Koding but lately decided to check out azure and it's developer's benefits.
After I've created ubuntu server virtual machine (which actually is what runs under Koding) I've downloaded my project using git pull, but forgot to change the branch to the one I'm working on atm. So I did, but server still shows me the old page (like I didn't checkout the other branch). So I checked sftp and files show me they have been updated.
Why am I still seeing the old page?
Now I know the reason why! (at least I think, but please. correct me if I'm wrong)
I noticed that there was .pyc file for every .py file, and those are "compiled" (bit of simplification?) python files as I understood it. And it seemed to me that they were not "compiled" on app launch. But they compiled with setup.py... edit dates suggest that.
So the reason why I didn't see the changes I did in code was that... http.server was using old "compiled" files instead of the source files! But is that normal/expected behaviour? Dunno. There are many other quetions now, but main question was answered so I mark this as answer until someone gives better answer.

Weird deployment issue

We're using CruiseControl.Net to do our continuous integration of our web applications.
we build the project, zip it up, copy it to the integration server. A littel bit later,
the wbe.config is cached away, the folder delted, the zip file unzipped recreating the folders, etc, then the web.config is copied back.
the issue is that somwhere in the process, one of the folders (not always the same one)
will have it's permissions totally hosed.
even the owner can't open teh folder to look at the contents.
We reboot, and everything is golden, we can delete the folder and redeploy and everythign works.
My question is, other than if anyone has expereinced anything like this, is
what tools do you suggest to try to figure out what exactly has the permissions messed up
that is nolonger doign so after rebooting.
I figure if I can get a clue about what, I can figure out why.
Thanks,
E-
You could try finding a way to run cruisecontrol.net as a limited user, that way it can't set permissions as something higher.
I'm afraid I don't remember the details But it was an obscure security setting on the Network our IT guys tweaked and it works now. I'm sorry I can't remember any more info, but I figured even this will be of some help incase someone else runs into the issue.

Resources