Quantcast

Not able to include html files and static content of django project to installer

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Not able to include html files and static content of django project to installer

ragini dahihande
I have created installer of django project using pyinstaller
The exe which had created using pyinstaller is running fine.
But I am not able to include html files and static files from jango project
How can we include these files ?

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Not able to include html files and static content of django project to installer

Hartmut Goebel
Am 30.12.2016 um 08:03 schrieb ragini dahihande:
How can we include these files ?

This is written in the FAQ .

--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: http://www.goebel-consult.de/blog/das-fass-ist-voll-grunde-linux-201asystemd2018-zu-meiden
Kolumne: http://www.cissp-gefluester.de/2012-04-compliance-bringt-keine-sicherheit

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Not able to include html files and static content of django project to installer

ragini dahihande
Hi Hartmut,

I am not  able to find any question for this in FAQ.
Can you please help me ?

Thanks,
Ragini

On Fri, Dec 30, 2016 at 3:36 PM, Hartmut Goebel <[hidden email]> wrote:
Am 30.12.2016 um 08:03 schrieb ragini dahihande:
How can we include these files ?

This is written in the FAQ .

--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: http://www.goebel-consult.de/blog/das-fass-ist-voll-grunde-linux-201asystemd2018-zu-meiden
Kolumne: http://www.cissp-gefluester.de/2012-04-compliance-bringt-keine-sicherheit

--
You received this message because you are subscribed to a topic in the Google Groups "PyInstaller" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyinstaller/9AWQwpmMmag/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.



--
Hi,



Thanks And Regards,
Ragini Sanjay Dahihande
Dell EMC
| DataDomain
Mob : +91 9561196896
Don't stop when you're tired. Stop when you're done!

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Not able to include html files and static content of django project to installer

Steve Barnes


On 02/01/2017 04:27, ragini dahihande wrote:
> Hi Hartmut,
>
> I am not  able to find any question for this in FAQ.
> Can you please help me ?
>
> Thanks,
> Ragini
>
Ragini,

All static content, including html files, would be classed as "data
files" so take a look at
https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Collect-Data-Files

You should also be reading
https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Executable-From-Django


--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Not able to include html files and static content of django project to installer

ragini dahihande

See following is my project directory structure
mysite
  --settings.py
  -- urls.py
  --wsgi.py

polls(app)
  --static
     --polls
       --images
  --templates
    --polls
      index.html
      results.html
admin.py
apps.py
models.py
urls.py
views.py


when I run my project using manage.py its working fine
but when I am running through exe file getting error like template does not exist

https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Collect-Data-Files
these steps are not clear so I am not able to proceed
 


On Monday, January 2, 2017 at 12:59:05 PM UTC+5:30, Steve Barnes wrote:


On 02/01/2017 04:27, ragini dahihande wrote:
> Hi Hartmut,
>
> I am not  able to find any question for this in FAQ.
> Can you please help me ?
>
> Thanks,
> Ragini
>
Ragini,

All static content, including html files, would be classed as "data
files" so take a look at
<a href="https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Collect-Data-Files" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpyinstaller%2Fpyinstaller%2Fwiki%2FRecipe-Collect-Data-Files\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFjpL1shAW5Gvr1lJEckgjK29AR2Q&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpyinstaller%2Fpyinstaller%2Fwiki%2FRecipe-Collect-Data-Files\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFjpL1shAW5Gvr1lJEckgjK29AR2Q&#39;;return true;">https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Collect-Data-Files

You should also be reading
<a href="https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Executable-From-Django" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpyinstaller%2Fpyinstaller%2Fwiki%2FRecipe-Executable-From-Django\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEfBiQfSVhDWnM8vMc_9qO0T5XdDQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpyinstaller%2Fpyinstaller%2Fwiki%2FRecipe-Executable-From-Django\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEfBiQfSVhDWnM8vMc_9qO0T5XdDQ&#39;;return true;">https://github.com/pyinstaller/pyinstaller/wiki/Recipe-Executable-From-Django


--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Not able to include html files and static content of django project to installer

Hartmut Goebel
In reply to this post by ragini dahihande
Am 02.01.2017 um 05:27 schrieb ragini dahihande:
I am not  able to find any question for this in FAQ.

I have to admit that the FAQ does not answer the question. The manual does: <https://pyinstaller.readthedocs.io/en/stable/spec-files.html#adding-files-to-the-bundle>

--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: http://www.goebel-consult.de/blog/k-9-mail-statt-apps-der-mailprovider
Kolumne: http://www.cissp-gefluester.de/2010-07-passwoerter-lieben-lernen

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.

smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Not able to include html files and static content of django project to installer

ragini dahihande
See I added datafiles path to .spec file

# -*- mode: python -*-

block_cipher
= None


a
= Analysis(['..\\mysite\\manage.py'],
             pathex
=['C:\\Users\\sanjad\\Desktop\\testdemo\\myinstaller'],
             binaries
=None,
             datas
=[
                   
('C:\\Users\\sanjad\\Desktop\\testdemo\\mysite\\polls\\templates\\','polls\\templates'),
                   
('C:\\Users\\sanjad\\Desktop\\testdemo\\mysite\\polls\\static\\','polls\\static')
                   
],
             hiddenimports
=[],
             hookspath
=[],
             runtime_hooks
=[],
             excludes
=[],
             win_no_prefer_redirects
=False,
             win_private_assemblies
=False,
             cipher
=block_cipher)
pyz
= PYZ(a.pure, a.zipped_data,
             cipher
=block_cipher)
exe
= EXE(pyz,
          a
.scripts,
          exclude_binaries
=True,
          name
='manage',
          debug
=False,
          strip
=False,
          upx
=True,
          console
=True )
coll
= COLLECT(exe,
               a
.binaries,
               a
.zipfiles,
               a
.datas,
               strip
=False,
               upx
=True,
               name
='manage')

Now when running through exe pyinstaller able to load html files
but not able to load static files
following error I am getting

Enter code here...C:\Users\sanjad\Desktop\testdemo\myinstaller>dist\manage\manage.exe runserver
Performing system checks...

System check identified no issues (0 silenced).
January 02, 2017 - 19:10:14
Django version 1.10.2, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
[02/Jan/2017 19:10:20] "GET / HTTP/1.1" 200 346
Not Found: /static/polls/style.css
[02/Jan/2017 19:10:20] "GET /static/polls/style.css HTTP/1.1" 404 2605






On Monday, January 2, 2017 at 3:45:41 PM UTC+5:30, Hartmut Goebel wrote:
Am 02.01.2017 um 05:27 schrieb ragini dahihande:
I am not  able to find any question for this in FAQ.

I have to admit that the FAQ does not answer the question. The manual does: <a href="https://pyinstaller.readthedocs.io/en/stable/spec-files.html#adding-files-to-the-bundle" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fpyinstaller.readthedocs.io%2Fen%2Fstable%2Fspec-files.html%23adding-files-to-the-bundle\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFmctXIrhn9dkTK9dwRHmmGA46Htg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fpyinstaller.readthedocs.io%2Fen%2Fstable%2Fspec-files.html%23adding-files-to-the-bundle\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFmctXIrhn9dkTK9dwRHmmGA46Htg&#39;;return true;"><https://pyinstaller.readthedocs.io/en/stable/spec-files.html#adding-files-to-the-bundle>

--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
<a style="color:black" href="http://www.goebel-consult.de" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.goebel-consult.de\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHs4zUB0fQIL_Yg4brDiF83WXvPcg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.goebel-consult.de\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHs4zUB0fQIL_Yg4brDiF83WXvPcg&#39;;return true;">http://www.goebel-consult.de

Blog: <a style="color:grey!important;text-decoration:none!important" href="http://www.goebel-consult.de/blog/k-9-mail-statt-apps-der-mailprovider" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.goebel-consult.de%2Fblog%2Fk-9-mail-statt-apps-der-mailprovider\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFDe1xPJ_sYczoAOEDAN9h49o0XcQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.goebel-consult.de%2Fblog%2Fk-9-mail-statt-apps-der-mailprovider\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFDe1xPJ_sYczoAOEDAN9h49o0XcQ&#39;;return true;">http://www.goebel-consult.de/blog/k-9-mail-statt-apps-der-mailprovider
Kolumne: <a style="color:grey!important;text-decoration:none!important" href="http://www.cissp-gefluester.de/2010-07-passwoerter-lieben-lernen" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.cissp-gefluester.de%2F2010-07-passwoerter-lieben-lernen\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGy2NppDtEVkF-kxASoiLZDk-2HqQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.cissp-gefluester.de%2F2010-07-passwoerter-lieben-lernen\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGy2NppDtEVkF-kxASoiLZDk-2HqQ&#39;;return true;">http://www.cissp-gefluester.de/2010-07-passwoerter-lieben-lernen

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Not able to include html files and static content of django project to installer

Hartmut Goebel
Am 02.01.2017 um 14:43 schrieb ragini dahihande:
Now when running through exe pyinstaller able to load html files
but not able to load static files
following error I am getting

Please see the "if things so wrong" section of the manual or the wiki,

--
Schönen Gruß
Hartmut Goebel
Dipl.-Informatiker (univ), CISSP, CSSLP, ISO 27001 Lead Implementer
Information Security Management, Security Governance, Secure Software Development

Goebel Consult, Landshut
http://www.goebel-consult.de

Blog: http://www.goebel-consult.de/blog/bin-offiziell-entdecker-einer-sicherheitslucke
Kolumne: http://www.cissp-gefluester.de/2010-06-adobe-und-der-maiszunsler

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.

smime.p7s (3K) Download Attachment
Loading...