If I understand correctly you have this folder/file hierarchy:

arches/.../forms.py
arches_hip/.../forms.py
your_app/.../forms.py

And you said "put them into the HIP version of forms.py". 
Now the only version of the above forms.py files that is actually used by 
Django is your_app/.../forms.py, so the arches_hip/.../forms.py is never 
used. 

Let me know if this is actually the case or if I'm not understanding it 
correctly. 


As far as the indexing of Elastic Search goes, I'm afraid I have not enough 
experience with this to answer your questions (we do not have a live 
database running yet).
All I know is that you normally run this only once: python manage.py 
packages -o setup_elasticsearch
Reinstalling Elasticsearch every time sounds very unnecessary. 

Perhaps somebody else from this community can come to our aid?


Vincent



On Tuesday, 13 December 2016 04:37:59 UTC-5, Lucy FJ wrote:
>
> Hi Vincent,
> I never really solved the problem of why forms.pyc was not recreated when 
> I modified forms.py, by simply running  the website. I did notice that when 
> the server crashed and the server administrator got it started again, a 
> .pyc was created. So it seems that in our system we have to reinstall the 
> database every time?! I decided to simply use the compile python command 
> whilst in the correct directory to create the .pyc. But the the changes I 
> made to forms.py still did not work! It is weird because all I did was copy 
> over the changes for two of our input forms from a forms.py that did work 
> and put them into the HIP version of forms.py. All indentation errors and 
> syntax errors have been resolved.  I have a new developer working on this 
> now with far greater technical knowledge than I have,  so I am leaving it 
> to her to sort out!
>
> I did look through the previous discussion you indicated and that will be 
> very helpful when we start modifying the map pop-up screens. 
>
> Please could you illuminate me on when we need to reindex  and when to 
> rerun elastic search and what commands you use for both? Our server 
> administrator made a change to elastic search to keep it running all the 
> time as it frequently stopped. I am wondering if this is causing some of 
> our problems. What do you think?
>
> Thank you! 
>
>
> Lucy Fletcher-Jones 
> Egypt Database Project
> TMP Room 2181, HUSS Building AUC New Campus
> Tel: 02 2615 1760
> Mobile: 010 1633 8367
>
>
> On Mon, Dec 12, 2016 at 11:45 PM, Vincent Meijer <[email protected] 
> <javascript:>> wrote:
>
>> Hi Lucy,
>>
>> Did you manage to get this to work? 
>> Please see this discussion with the same problem: 
>> https://groups.google.com/forum/#!msg/archesproject/Khj1ddBxAYk/G4TeZj1dBAAJ
>>
>> As Adam summarizes: copy the arches_hip/models/resource.py file, paste it 
>> into the corresponding directory of your own app, and then change the 
>> RESOURCE_MODEL to something like:
>> RESOURCE_MODEL = {'default': '{}.models.resource.Resource'.
>> format(PACKAGE_NAME)}
>>
>> As to your questions:
>> - .pyc files are created when Python runs your .py file for the first 
>> time. It compiles it into bytes and saves it as .pyc. After that, the 
>> Python compiler will only recreate the .pyc if anything in your .py has 
>> changed.
>> You are correct to think the absence of a .pyc version of your customized 
>> script means it is not being used. 
>>
>> - Generally speaking, your files are owned by root if you 
>> installed/copied it while running under the root user. I install/run Arches 
>> under root as well, but I am not sure if there are better solutions (e.g. a 
>> less privileged user). Perhaps the community here can fill us in :)
>>
>>
>> Good luck, 
>> Vincent
>>
>>
>>
>> On Sunday, 6 November 2016 05:29:49 UTC-5, Lucy FJ wrote:
>>>
>>> Hi everyone,
>>>
>>> This is a basic technical question which I am asking as a not 
>>> particularly technical person. 
>>>
>>> We are customising Arches and are changing forms.py because we have 
>>> added new nodes to the Heritage Resource graph. 
>>> I have copied forms.py from the Arches HIP directory, changed it and put 
>>> it into our custom directory. I opened Arches and found that the changes 
>>> had not taken effect and noticed that a .pyc file had not been created in 
>>> the custom directory. I assume that the .pyc file in the HIP directory is 
>>> being read instead? (It is still there). I have tried stopping and 
>>> restarting our server and still the .pyc file fails to be created. The file 
>>> resource.py has been changed as suggested by the Arches documentation to 
>>> pick up the correct version of 'forms' (*from arches_hip.models import 
>>> forms *has been changed to *import forms*) and is also located in the 
>>> custom directory. What is the mechanism that causes the .pyc file to be 
>>> created? I was wondering if it was a permission/ownership problem. All our 
>>> Arches programs are owned by Root. is this normal in an Arches 
>>> installation? 
>>>
>>> Thank you very much for your help.
>>>
>>>
>>> -- 
>> -- To post, send email to [email protected] <javascript:>. To 
>> unsubscribe, send email to [email protected] <javascript:>. 
>> For more information, visit 
>> https://groups.google.com/d/forum/archesproject?hl=en
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Arches Project" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/archesproject/m5lW0RNITpI/unsubscribe.
>>
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
-- To post, send email to [email protected]. To unsubscribe, send 
email to [email protected]. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to