[Help] Advanced tutorial: How to install my Python package with Virtualenv

2016-09-27 Thread Aline C. R. Souza
Hello Guys,

I need some help to install my Python package with virtualenv. I follow the 
'Advanced tutorial: How to write reusable apps' and moved the polls 
directory out of the project. Now I want to install my package using 
virtualenv and pip, but I don't know how.

Consider I am inside of my project diretory (where the manage.py is) and I 
am working on a virtual environment. What would be the right pip command to 
install my package, considering that the polls directory is out of the 
project.

Please help!




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bb3167a4-61c3-4006-994d-c2b226636401%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Help] Advanced tutorial: How to install my Python package with Virtualenv

2016-09-27 Thread Aline C. R. Souza
Hello ke1g and gary719_list1,

Thank you for your time.

I am using windows and the cmd terminal. I do not know what you mean by 
activate the virtual env. I created one virtual enviroment called 
'poll-tutorial' and used the command 'workon poll-tutorial' to work on this 
enviroment.

I think you didn't understand my doubt. I think I was not very clear. The 
thing is:

I followed this tutorial: 
https://docs.djangoproject.com/en/1.10/intro/reusable-apps/

At the 'Using your own package' step, there is a choice:  install 
django-polls as a user library or with virtualenv

The tutorial does not explain how to install with virtualenv, so I am 
trying to figure it out.

I saw on a blog post that I should use the pip command as installing a user 
library but whitout the '--user':

pip install django-polls/dist/django-polls-0.1.tar.gz

But did not work, it can not find the file.

I think I am using this command at the wrong directory.

So, suppose that I am at 'mysite' directory, working on the 'poll-tutorial' 
virtual environment. What would be the correct pip command to install my 
package that is inside the folder django-polls/dist outside 
of 'mysite' directory?

I think my problem maybe is just about localization of the files. I am 
little bit lost.

Em terça-feira, 27 de setembro de 2016 08:21:54 UTC-3, Aline C. R. Souza 
escreveu:
>
> Hello Guys,
>
> I need some help to install my Python package with virtualenv. I follow 
> the 'Advanced tutorial: How to write reusable apps' and moved the polls 
> directory out of the project. Now I want to install my package using 
> virtualenv and pip, but I don't know how.
>
> Consider I am inside of my project diretory (where the manage.py is) and I 
> am working on a virtual environment. What would be the right pip command to 
> install my package, considering that the polls directory is out of the 
> project.
>
> Please help!
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9dbc498c-14a4-4fc7-b2e6-c537652d7dc3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Help] Advanced tutorial: How to install my Python package with Virtualenv

2016-09-27 Thread Aline C. R. Souza
Hello ke1g and gary719_list1,

Thank you for your time.

Hi, I am using windows and the cmd terminal. I do not know what you mean by 
activate the virtual env. I created one virtual enviroment called 
'poll-tutorial' and used the command 'workon poll-tutorial' to work on this 
enviroment.

I think you didn't understand my doubt. I think I was not very clear. The 
thing is:

I followed this tutorial: 
https://docs.djangoproject.com/en/1.10/intro/reusable-apps/

At the 'Using your own package' step, there is a choice:  install 
django-polls as a user library or with virtualenv

The tutorial does not explain how to install with virtualenv, so I am 
trying to figure it out.

I saw on a blog post that I should use the pip command as installing a user 
library but whitout the '--user':

pip install django-polls/dist/django-polls-0.1.tar.gz

But did not work, it can not find the file.

I think I am using this command at the wrong directory.

So, suppose that I am at 'mysite' directory, working on the 'poll-tutorial' 
virtual environment. What would be the correct pip command to install my 
package that is inside the folder django-polls/dist outside of my project 
directory?

I think my problem maybe is just about localization of the files. I am 
little bit lost.



Em terça-feira, 27 de setembro de 2016 08:21:54 UTC-3, Aline C. R. Souza 
escreveu:
>
> Hello Guys,
>
> I need some help to install my Python package with virtualenv. I follow 
> the 'Advanced tutorial: How to write reusable apps' and moved the polls 
> directory out of the project. Now I want to install my package using 
> virtualenv and pip, but I don't know how.
>
> Consider I am inside of my project diretory (where the manage.py is) and I 
> am working on a virtual environment. What would be the right pip command to 
> install my package, considering that the polls directory is out of the 
> project.
>
> Please help!
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/04d283f6-4ba3-41e2-b192-d3ba55ebd866%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Help] Advanced tutorial: How to install my Python package with Virtualenv

2016-09-27 Thread Aline C. R. Souza
Hello ke1g and gary719_list1,

Thank you for your time.

I am using windows and the cmd terminal. I do not know what you mean by 
activate the virtual env. I created one virtual enviroment called 
'poll-tutorial' and used the command 'workon poll-tutorial' to work on this 
enviroment.

I think you didn't understand my doubt. I think I was not very clear. The 
thing is:

I followed this tutorial: 
https://docs.djangoproject.com/en/1.10/intro/reusable-apps/

At the 'Using your own package' step, there is a choice:  install 
django-polls as a user library or with virtualenv

The tutorial does not explain how to install with virtualenv, so I am 
trying to figure it out.

I saw on a blog post that I should use the pip command as installing a user 
library but whitout the '--user':

pip install django-polls/dist/django-polls-0.1.tar.gz

But did not work, it can not find the file.

I think I am using this command at the wrong directory.

So, suppose that I am at 'mysite' directory, working on the 'poll-tutorial' 
virtual environment. What would be the correct pip command to install my 
package that is inside the folder django-polls/dist outside of my project 
directory?

I think my problem maybe is just about localization of the files. I am 
little bit lost.

Em terça-feira, 27 de setembro de 2016 08:21:54 UTC-3, Aline C. R. Souza 
escreveu:
>
> Hello Guys,
>
> I need some help to install my Python package with virtualenv. I follow 
> the 'Advanced tutorial: How to write reusable apps' and moved the polls 
> directory out of the project. Now I want to install my package using 
> virtualenv and pip, but I don't know how.
>
> Consider I am inside of my project diretory (where the manage.py is) and I 
> am working on a virtual environment. What would be the right pip command to 
> install my package, considering that the polls directory is out of the 
> project.
>
> Please help!
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fd24d7ee-3541-4707-b666-dc689b630ddd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Help] Advanced tutorial: How to install my Python package with Virtualenv

2016-09-27 Thread Aline C. R. Souza
Hi everybody,

Pip was working, but I did not know how to use it. Now, I figured out. 

Inside the project directory: 

pip install ../django-polls/dist/django-polls-0.1.zip

Worked fine, the app is running.

Thank you, guys.


Em terça-feira, 27 de setembro de 2016 08:21:54 UTC-3, Aline C. R. Souza 
escreveu:
>
> Hello Guys,
>
> I need some help to install my Python package with virtualenv. I follow 
> the 'Advanced tutorial: How to write reusable apps' and moved the polls 
> directory out of the project. Now I want to install my package using 
> virtualenv and pip, but I don't know how.
>
> Consider I am inside of my project diretory (where the manage.py is) and I 
> am working on a virtual environment. What would be the right pip command to 
> install my package, considering that the polls directory is out of the 
> project.
>
> Please help!
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/66dc1093-dced-4d3b-8a34-3e1c250fbee0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


NoReverseMatch Error using Django + Haystack + Elasticsearch

2016-10-14 Thread Aline C. R. Souza
Hello everybody,

I am having a issue using Django + Haystack + Elasticsearch to perform a 
website search.

I made a question on StackOverflow, but I had no satisfatory answer.

The problem is in this line:

by {{ post.author 
}}

post.author.pk works well when called by several views, but it is not 
resolved when called by the search.

There is another way to get the pk of the author of the post?

The link of the StackOverflow question: 
http://stackoverflow.com/questions/40033039/noreversematch-error-using-haystack-elasticsearch

Can someone help me? Please explain in details, because I am new in Django, 
and in haystack, elasticsearch...


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fb151afb-35a8-4ac4-a9e4-69f4419568c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: NoReverseMatch Error using Django + Haystack + Elasticsearch

2016-10-15 Thread Aline C. R. Souza
Thank you for your time, Constantine. 

I gave up on following this path. 

I threw away everything that I did on this matter, and I followed the steps 
of this link: http://django-haystack.readthedocs.io/en/v2.5.0/tutorial.html

It took me some time to understand, but now it is working fine.

Thank you.

Em sábado, 15 de outubro de 2016 04:43:21 UTC-3, Constantine Covtushenko 
escreveu:
>
> Hi Aline,
>
> I did not use Haystack but I am using ElastickSearch.
> I carefully read you post on StackOverflow and see that search form 
> returns author of the post without `pk` key defined.
>
> Did you check what is returned by ElastickSearch?
> May be your SearchForm returns exactly what Elastick stores in its index? 
> I mean that post returned by SearchForm not the same as Post model? It can 
> be dictionary or something?
>
> Sorry I do not have time to build test app to check my idea.
>
> You can easily set up a break point and check what are the posts inside 
> your `post_search` view function.
>
> Regards,
> Constantine C.
>
> On Sat, Oct 15, 2016 at 12:48 AM, Aline C. R. Souza  > wrote:
>
>> Hello everybody,
>>
>> I am having a issue using Django + Haystack + Elasticsearch to perform a 
>> website search.
>>
>> I made a question on StackOverflow, but I had no satisfatory answer.
>>
>> The problem is in this line:
>>
>> by {{ post.author 
>> }}
>>
>> post.author.pk works well when called by several views, but it is not 
>> resolved when called by the search.
>>
>> There is another way to get the pk of the author of the post?
>>
>> The link of the StackOverflow question: 
>> http://stackoverflow.com/questions/40033039/noreversematch-error-using-haystack-elasticsearch
>>
>> Can someone help me? Please explain in details, because I am new in 
>> Django, and in haystack, elasticsearch...
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/fb151afb-35a8-4ac4-a9e4-69f4419568c1%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/fb151afb-35a8-4ac4-a9e4-69f4419568c1%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/63bae927-7d3c-4b5e-9355-a15937520e67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


HELP - Django variable in style (width) attribute

2016-10-15 Thread Aline C. R. Souza
Hello Guys,

favorite 


Why the template tag call {% get_percentage question.pk choice.pk %} works 
inside the span tag, but doesn't work in style (width) attribute?

What is wrong?

 {% for choice in question.choice_set.all %}
{{ choice.choice_text }}
{% get_percentage question.pk choice.pk 
%}%



 {% endfor %}

I am using Python 3.5.2 and Django 1.10.2

PS: I did the same question on StackOverflow: 
http://stackoverflow.com/q/40065604/5498125, but I have no answers yet.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8148661a-77ed-4b2b-b68a-90dd1df1376a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: HELP - Django variable in style (width) attribute

2016-10-20 Thread Aline C. R. Souza
Thank you both, Constantine and James. Thanks to your comments I could 
realize where the error was, and I could improvve performance assigning the 
returned value to a variable.

The error was in html, and not django. When I looked at the rendered html, 
I could see the error.

Em sábado, 15 de outubro de 2016 22:28:38 UTC-3, Aline C. R. Souza escreveu:
>
> Hello Guys,
>
> favorite 
> <http://stackoverflow.com/questions/40065604/django-variable-in-style-width-attribute#>
>
> Why the template tag call {% get_percentage question.pk choice.pk %} 
> works inside the span tag, but doesn't work in style (width) attribute?
>
> What is wrong?
>
>  {% for choice in question.choice_set.all %}
> {{ choice.choice_text }}
> {% get_percentage question.pk choice.pk 
> %}%
> 
> 
> 
>  {% endfor %}
>
> I am using Python 3.5.2 and Django 1.10.2
>
> PS: I did the same question on StackOverflow: 
> http://stackoverflow.com/q/40065604/5498125, but I have no answers yet.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3dd650d0-1646-4c12-8387-5e90b8d0e4ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Deploy on Heroku Error

2016-10-20 Thread Aline C. R. Souza
Hello everybody,

I am catching an error on trying to deploy my app on heroku. This is the 
traceback:

  File "/app/.heroku/python/lib/python3.5/site-packages/polls/admin.py", 
line 3, in 
2016-10-20T18:42:46.734824+00:00 app[web.1]:   File 
"/app/.heroku/python/lib/python3.5/importlib/__init__.py", line 126, in 
import_module
2016-10-20T18:42:46.734830+00:00 app[web.1]: ImportError: No module named 
'models'
2016-10-20T18:42:46.735201+00:00 app[web.1]: [2016-10-20 18:42:46 +] 
[7] [INFO] Worker exiting (pid: 7)
2016-10-20T18:42:46.734826+00:00 app[web.1]: from models import Poll, 
Choice, Vote
2016-10-20T18:42:46.736625+00:00 app[web.1]: [2016-10-20 18:42:46 +] 
[8] [ERROR] Exception in worker process

The app runs normally on localhost.

That is what I tried to do: I went to my virtualenv directory at 
site-packages/polls/ and changed all the imports to polls.models instead of 
.models. Then, I cleaned the cache of the polls app and the cache of the 
blog app (blog app uses polls app). Built my app again and ran it locally. 
The app looks fine. So, I tried to push to heroku and run the app, but the 
same error occurs.

Any thoughts?

Link to the repo: https://github.com/alinecrsouza/django-blog-app

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8704854e-48ab-460e-8ff1-cedc427cb037%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploy on Heroku Error

2016-10-21 Thread Aline C. R. Souza
Hello Antony,

This is the link to the Poll App: 
https://github.com/alinecrsouza/django-polls-app

The changes I made on the imports (change to polls.models instead of 
.models), I made directly on my virtualenv, I didn't change the polls app 
code. I was afraid of losing some of my previous work reinstalling the 
polls app.

Em sexta-feira, 21 de outubro de 2016 03:40:21 UTC-2, Antonis Christofides 
escreveu:
>
> Hello,
>
> Link to the repo: https://github.com/alinecrsouza/django-blog-app
>
>
> that repo only contains the blog app. Could you show us the polls app?
>
> Regards,
>
> Antonis Christofideshttp://djangodeployment.com
>
> On 2016-10-20 22:49, Aline C. R. Souza wrote:
>
> Hello everybody, 
>
> I am catching an error on trying to deploy my app on heroku. This is the 
> traceback:
>
>   File "/app/.heroku/python/lib/python3.5/site-packages/polls/admin.py", 
> line 3, in 
> 2016-10-20T18:42:46.734824+00:00 app[web.1]:   File 
> "/app/.heroku/python/lib/python3.5/importlib/__init__.py", line 126, in 
> import_module
> 2016-10-20T18:42:46.734830+00:00 app[web.1]: ImportError: No module named 
> 'models'
> 2016-10-20T18:42:46.735201+00:00 app[web.1]: [2016-10-20 18:42:46 +] 
> [7] [INFO] Worker exiting (pid: 7)
> 2016-10-20T18:42:46.734826+00:00 app[web.1]: from models import Poll, 
> Choice, Vote
> 2016-10-20T18:42:46.736625+00:00 app[web.1]: [2016-10-20 18:42:46 +] 
> [8] [ERROR] Exception in worker process
>
> The app runs normally on localhost.
>
> That is what I tried to do: I went to my virtualenv directory at 
> site-packages/polls/ and changed all the imports to polls.models instead of 
> .models. Then, I cleaned the cache of the polls app and the cache of the 
> blog app (blog app uses polls app). Built my app again and ran it locally. 
> The app looks fine. So, I tried to push to heroku and run the app, but the 
> same error occurs.
>
> Any thoughts?
>
> Link to the repo: https://github.com/alinecrsouza/django-blog-app
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/8704854e-48ab-460e-8ff1-cedc427cb037%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/8704854e-48ab-460e-8ff1-cedc427cb037%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2feb2c1a-f622-4bef-9756-94d10dc2a8e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploy on Heroku Error

2016-10-21 Thread Aline C. R. Souza
Hello, Constantine,

I have already followed this article and using `heroku local` the app runs 
fine. However, some things I did different:

(i) I used psycopg2==2.6.2 instead of psycopg2==2.5.3, because the 2.5.3 
version do not works with Visual Studio Community 2015.
(ii) On my Procfile I put: 'web: python manage.py runserver 0.0.0.0:80' 
instead of 'web: python manage.py runserver 0.0.0.0:$PORT', because, for 
some reason, 0.0.0.0:$PORT catches an error of port not found, or something 
like that.

I think the problem occurs only with gunicorn server.

I was thinking in test the app on a linux virtual machine, using the 
gunicorn. However, I don't know how to migrate the virtual enviroment to 
the virtual machine.

So, I don't know if this would be a good approach to solve the problem.

Em sexta-feira, 21 de outubro de 2016 05:27:45 UTC-2, Constantine 
Covtushenko escreveu:
>
> Hi Aline,
>
> I have encountered the problem described by you as well. I am using heroku 
> for about 5 django projects.
>
> For some reason this problem does not exist when you run django server 
> with manage.py command.
>
> Try to read that heroku 
> <https://devcenter.heroku.com/articles/deploying-python#build-your-app-and-run-it-locally>
>  
> article. Using `heroku local` command helps fix/run/check locally and after 
> all ok you safely commit and push to heroku.
>
> Hope that helps
>
> Regards,
> Constantine C.
>
> On Fri, Oct 21, 2016 at 8:39 AM, Antonis Christofides <
> ant...@djangodeployment.com > wrote:
>
>> Hello,
>>
>> Link to the repo: https://github.com/alinecrsouza/django-blog-app
>>
>>
>> that repo only contains the blog app. Could you show us the polls app?
>>
>> Regards,
>>
>> Antonis Christofideshttp://djangodeployment.com
>>
>> On 2016-10-20 22:49, Aline C. R. Souza wrote:
>>
>> Hello everybody, 
>>
>> I am catching an error on trying to deploy my app on heroku. This is the 
>> traceback:
>>
>>   File "/app/.heroku/python/lib/python3.5/site-packages/polls/admin.py", 
>> line 3, in 
>> 2016-10-20T18:42:46.734824+00:00 app[web.1]:   File 
>> "/app/.heroku/python/lib/python3.5/importlib/__init__.py", line 126, in 
>> import_module
>> 2016-10-20T18:42:46.734830+00:00 app[web.1]: ImportError: No module named 
>> 'models'
>> 2016-10-20T18:42:46.735201+00:00 app[web.1]: [2016-10-20 18:42:46 +] 
>> [7] [INFO] Worker exiting (pid: 7)
>> 2016-10-20T18:42:46.734826+00:00 app[web.1]: from models import Poll, 
>> Choice, Vote
>> 2016-10-20T18:42:46.736625+00:00 app[web.1]: [2016-10-20 18:42:46 +] 
>> [8] [ERROR] Exception in worker process
>>
>> The app runs normally on localhost.
>>
>> That is what I tried to do: I went to my virtualenv directory at 
>> site-packages/polls/ and changed all the imports to polls.models instead of 
>> .models. Then, I cleaned the cache of the polls app and the cache of the 
>> blog app (blog app uses polls app). Built my app again and ran it locally. 
>> The app looks fine. So, I tried to push to heroku and run the app, but the 
>> same error occurs.
>>
>> Any thoughts?
>>
>> Link to the repo: https://github.com/alinecrsouza/django-blog-app
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/8704854e-48ab-460e-8ff1-cedc427cb037%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/8704854e-48ab-460e-8ff1-cedc427cb037%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/cdd71b29-ab8f-3736-71b3-ded998a6b82c%40djangodeploymen

Re: Deploy on Heroku Error

2016-10-22 Thread Aline C. R. Souza
Hi Constantine,

I did such changes because Gunicorn does not work on Windows, as the 
article itself states. And the psycopg2==2.5.3 does not work with Visual 
Studio Community 2015.
Your comment made me have an idea. I'll try to deploy with psycopg2 instead 
of gunicorn. It is a sample blog for my portfolio, not a real one. And I 
need this work ready this weekend, so if it run with psycopg2, it will be 
ok to me.

I will try it, and inform you if it works later.

Thank you.

Em sexta-feira, 21 de outubro de 2016 18:25:12 UTC-2, Constantine 
Covtushenko escreveu:
>
> Hi Aline,
>
> I thought that an initial idea of running application with `heroku local` 
> is to check how it can run in heroku.
>
> Why did you change the Procfile in such a way?
> It supposed to use it the same as for heroku.
>
> Can you please try with Procfile without any local specific modifications?
>
> Regards,
> Constantine C.
>
> On Fri, Oct 21, 2016 at 1:14 PM, Aline C. R. Souza  > wrote:
>
>> Hello, Constantine,
>>
>> I have already followed this article and using `heroku local` the app 
>> runs fine. However, some things I did different:
>>
>> (i) I used psycopg2==2.6.2 instead of psycopg2==2.5.3, because the 2.5.3 
>> version do not works with Visual Studio Community 2015.
>> (ii) On my Procfile I put: 'web: python manage.py runserver 0.0.0.0:80' 
>> instead of 'web: python manage.py runserver 0.0.0.0:$PORT', because, for 
>> some reason, 0.0.0.0:$PORT catches an error of port not found, or something 
>> like that.
>>
>> I think the problem occurs only with gunicorn server.
>>
>> I was thinking in test the app on a linux virtual machine, using the 
>> gunicorn. However, I don't know how to migrate the virtual enviroment to 
>> the virtual machine.
>>
>> So, I don't know if this would be a good approach to solve the problem.
>>
>> Em sexta-feira, 21 de outubro de 2016 05:27:45 UTC-2, Constantine 
>> Covtushenko escreveu:
>>>
>>> Hi Aline,
>>>
>>> I have encountered the problem described by you as well. I am using 
>>> heroku for about 5 django projects.
>>>
>>> For some reason this problem does not exist when you run django server 
>>> with manage.py command.
>>>
>>> Try to read that heroku 
>>> <https://devcenter.heroku.com/articles/deploying-python#build-your-app-and-run-it-locally>
>>>  
>>> article. Using `heroku local` command helps fix/run/check locally and after 
>>> all ok you safely commit and push to heroku.
>>>
>>> Hope that helps
>>>
>>> Regards,
>>> Constantine C.
>>>
>>> On Fri, Oct 21, 2016 at 8:39 AM, Antonis Christofides <
>>> ant...@djangodeployment.com> wrote:
>>>
>>>> Hello,
>>>>
>>>> Link to the repo: https://github.com/alinecrsouza/django-blog-app
>>>>
>>>>
>>>> that repo only contains the blog app. Could you show us the polls app?
>>>>
>>>> Regards,
>>>>
>>>> Antonis Christofideshttp://djangodeployment.com
>>>>
>>>> On 2016-10-20 22:49, Aline C. R. Souza wrote:
>>>>
>>>> Hello everybody, 
>>>>
>>>> I am catching an error on trying to deploy my app on heroku. This is 
>>>> the traceback:
>>>>
>>>>   File 
>>>> "/app/.heroku/python/lib/python3.5/site-packages/polls/admin.py", line 3, 
>>>> in 
>>>> 2016-10-20T18:42:46.734824+00:00 app[web.1]:   File 
>>>> "/app/.heroku/python/lib/python3.5/importlib/__init__.py", line 126, in 
>>>> import_module
>>>> 2016-10-20T18:42:46.734830+00:00 app[web.1]: ImportError: No module 
>>>> named 'models'
>>>> 2016-10-20T18:42:46.735201+00:00 app[web.1]: [2016-10-20 18:42:46 
>>>> +] [7] [INFO] Worker exiting (pid: 7)
>>>> 2016-10-20T18:42:46.734826+00:00 app[web.1]: from models import 
>>>> Poll, Choice, Vote
>>>> 2016-10-20T18:42:46.736625+00:00 app[web.1]: [2016-10-20 18:42:46 
>>>> +] [8] [ERROR] Exception in worker process
>>>>
>>>> The app runs normally on localhost.
>>>>
>>>> That is what I tried to do: I went to my virtualenv directory at 
>>>> site-packages/polls/ and changed all the imports to polls.models instead 
>>>> of 
>>>> .models. Then, I cleaned the cache of the polls app and the cache of the 
>>>> blog app (blog ap