WebFaction
Community site: login faq

Hi all. Don't be too hard on me for this question. I've just installed osqa and it's my first experience with python files and using Apache. I've only uploaded php scripts in the past. I've got the OSQA script installed and it works great out of the box (thanks to the one-click installer).

I found the forum/settings/sidebar.py file as having the text I wanted to test and change. I edited the file in notepad and uploaded. No change. I deleted the associated .pyc file, restarted apache and even deleted the cache. No change.

Could someone give me a quick tut on how django/python works in regards to editing? How does one update a site such as this?

asked 20 Jan '12, 23:43

andi
5335
accept rate: 0%

edited 21 Jan '12, 00:01


There may be a few things happening here, if you used notepad in windows the problem may be the text files format. If you are using windows you can try using PSPad to edit the file, that can open and save in the unix format. If you use Mac or Linux you should be OK.

Second when you say no change, do you mean the file itself has not changed or the site? If you mean the file itself have you tried editing it in SSH with an editor like vim or nano? If its the site, a code example and maybe a screenshot showing what is the problem would help.

Basically there is nothing special about editing a python file that is different than a PHP file other than you have to restart Apache, this will automatically update the .pyc files if needed. If it is not updating than something else is likely happening and isolating that relies on knowing if the file itself has changed or not and than real-time debugging.

If you would like our support team to look directly you may submit a support ticket.

permanent link

answered 21 Jan '12, 00:26

johns
5.4k312
accept rate: 23%

Thanks, johns. I'm still not sure what I'm doing wrong. It's the site that's not changing. The file is updating fine. I went ahead and downloaded pspad and made sure to save the file in unix format. I uploaded it (after updating it), restarted apache and refreshed my site but still no change.

However...

I did not realize there was an admin panel on the site itself that allowed for editing all the pages. At least that's working fine! So.. I'm able to get the site going, which I'll keep working on and then I'll come back to the problem at hand.

Thank you for your thorough answer. It was easy to understand and much appreciated! I'm sure I'll be adding some more challenges here as I find them. :)

(21 Jan '12, 01:37) andi

Glad to be of assistance. If the site is not changing it likely means the logic is on another 'layer'. Django applications work in 'layers', the template, the view and the model, among some others. The code you want to change exists as a product of all the layers together. So maybe its not in the .py file or a change in the .py file needs something else changed to take effect. If we could see the issue and the code in real time we could give more info.

(21 Jan '12, 01:58) johns

A full information about how to edit python files can be found at the Python wiki

permanent link

answered 16 Mar '13, 07:29

rajni
1
accept rate: 0%

edited 16 Mar '13, 08:05

iliasr ♦♦
2.1k14

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×337
×43
×5

question asked: 20 Jan '12, 23:43

question was seen: 14,160 times

last updated: 09 Aug '13, 01:03

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM