Re: Django bugfix release: 1.11.2

2017-06-02 Thread Andréas Kühne
Hi,

You should use pip to install python dependencies, so in this case: pip
install django --upgrade

That way you will get the latest version of django.

Best regards,

Andréas

2017-06-02 0:17 GMT+02:00 Bernd Wechner :

> Any tips on how to install it? Forgive the ignorance please.
>
> Tim Graham wrote:
>
> Details are available on the Django project weblog:
>
> https://www.djangoproject.com/weblog/2017/jun/01/bugfix-release/
> --
> 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/45ab39ab-cc38-467d-97bc-c8c39f971c8c%40googlegroups.com
> 
> .
> 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/a2c1ea60-8ef0-3889-5af3-e605f4341770%40gmail.com
> 
> .
> 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/CAK4qSCffJROhFsKCQu82WScMHUzJ-feEYnbucP_OG%3DLpiKOekA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Possible bug - Incorrect escaping in Django SQL query

2017-06-02 Thread Michal Petrucha
On Thu, Jun 01, 2017 at 02:29:17AM -0700, Roshan Raghupathy wrote:
> Hi,
> I came across an issue yesterday. Post on stackoverflow 
> 
> 
> On further investigation today, I think I found the source of the issue. 
> It's this line 
> .
>  
> The parameters which are escaped here are never reverted back to the 
> original form.
> I tested a dirty fix by converting all '%%s' to '%s' and the query worked. 
> Should I submit a bug? Has it been submitted already?

Hi Roshan,

I just took a quick look, and it seems you are right – in all of the
official backend implementations, the *_trunc_sql only use the second
argument in the right-hand side of string formatting, so this
double-percent escaping appears to be wrong there.

I did a quick search through the issue tracker, and didn't find
anything about this issue, would you mind submitting a new bug report?
It would be best if you could include a complete minimal example that
we could easily run to reproduce the problem.

Thanks,

Michal

-- 
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/20170602091343.GR23772%40konk.org.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Digital signature


Re: Connecting django to postgresql database

2017-06-02 Thread Gerald Brown
When you run "python manage.py.migrate" are you in the same directory as 
the "manage.py" file?  Also I always run "python manage.py makemigrations" 
before running the "migrate" command.

Hope this helps.

Gerry

On Thursday, May 25, 2017 at 7:48:32 PM UTC+8, Njogu wrote:
>
> I have been trying to connect my django project to postrgesql database, i 
> have one the configurations to it perfectly like this;
>
>
> ALLOWED_HOSTS = ['localhost', '127.0.0.1']
>
> DATABASES = {
> 'default': {
> 'ENGINE' : 'django.db.backends.postgresql_psycopg2',
> 'NAME'  : 'firstdjangoproject',
> 'USER'  : 'djangouser',
> 'PASSWORD' : 'django254',
> 'HOST'  : '127.0.0.1',
> 'PORT'  : '5432',
> }
>
> however when i run the command *'python manage.py migrate'* it does not 
> identify the word migrate, and when i run the command '*python manage.py 
> syncdb*' i get the following error;
>
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/core/management/__init__.py",
>  
> line 363, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/core/management/__init__.py",
>  
> line 337, in execute
> django.setup()
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/__init__.py",
>  
> line 27, in setup
> apps.populate(settings.INSTALLED_APPS)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/apps/registry.py",
>  
> line 108, in populate
> app_config.import_models()
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/apps/config.py",
>  
> line 202, in import_models
> self.models_module = import_module(models_module_name)
>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in 
> import_module
> __import__(name)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/contrib/auth/models.py",
>  
> line 4, in 
> from django.contrib.auth.base_user import AbstractBaseUser, 
> BaseUserManager
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/contrib/auth/base_user.py",
>  
> line 52, in 
> class AbstractBaseUser(models.Model):
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/db/models/base.py",
>  
> line 124, in __new__
> new_class.add_to_class('_meta', Options(meta, app_label))
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/db/models/base.py",
>  
> line 330, in add_to_class
> value.contribute_to_class(cls, name)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/db/models/options.py",
>  
> line 214, in contribute_to_class
> self.db_table = truncate_name(self.db_table, 
> connection.ops.max_name_length())
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/db/__init__.py",
>  
> line 33, in __getattr__
> return getattr(connections[DEFAULT_DB_ALIAS], item)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/db/utils.py",
>  
> line 211, in __getitem__
> backend = load_backend(db['ENGINE'])
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/db/utils.py",
>  
> line 115, in load_backend
> return import_module('%s.base' % backend_name)
>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in 
> import_module
> __import__(name)
>   File 
> "/usr/local/lib/python2.7/dist-packages/Django-1.11.1-py2.7.egg/django/db/backends/postgresql/base.py",
>  
> line 36, in 
> raise ImproperlyConfigured("psycopg2_version 2.5.4 or newer is 
> required; you have %s" % psycopg2.__version__)
> django.core.exceptions.ImproperlyConfigured: psycopg2_version 2.5.4 or 
> newer is required; you have 2.4.5 (dt dec mx pq3 ext)
>
>

-- 
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/6fd0561b-9317-4d0a-ad8f-1aebcf134202%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: uWSGI ModuleNotFoundError Django 1.11

2017-06-02 Thread 'Abraham Varricatt' via Django users
Consider thinking of the problem this way - you are trying to tell uwsgi to 
run a django project located within a certain directory using a virtualenv 
located in another directory. 

What James is asking is, if you have checked that the virtualenv you are 
using has all the dependencies to run your django project. A trivial way to 
do this check, is to simply activate the virtualenv and try runnig the 
debug 'runserver' command on your project directory. If that works, you 
know that your project and virtualenv are good, so the larger issue must be 
with the uwsgi config. 

At least, that's how I would go about debugging this matter.

-Abraham V.


On Thursday, June 1, 2017 at 6:03:34 PM UTC-4, F. Nikita Thomas wrote:
>
> Here's the directory listing for my virtual environment:
> (projectenv) [user@echo project]$ ls -al projectenv/bin/
> total 84
> drwxrwxr-x 3 user user  4096 Jun  1 14:28 .
> drwxrwxr-x 5 user user  4096 Jun  1 14:26 ..
> -rw-rw-r-- 1 user user  2095 Jun  1 14:26 activate
> -rw-rw-r-- 1 user user  1037 Jun  1 14:26 activate.csh
> -rw-rw-r-- 1 user user  2191 Jun  1 14:26 activate.fish
> -rw-rw-r-- 1 user user  1137 Jun  1 14:26 activate_this.py
> -rwxrwxr-x 1 user user   301 Jun  1 14:28 django-admin
> -rwxrwxr-x 1 user user   159 Jun  1 14:28 django-admin.py
> -rwxrwxr-x 1 user user   268 Jun  1 14:26 easy_install
> -rwxrwxr-x 1 user user   268 Jun  1 14:26 easy_install-3.6
> -rwxrwxr-x 1 user user   240 Jun  1 14:26 pip
> -rwxrwxr-x 1 user user   240 Jun  1 14:26 pip3
> -rwxrwxr-x 1 user user   240 Jun  1 14:26 pip3.6
> drwxrwxr-x 2 user user  4096 Jun  1 14:28 __pycache__
> lrwxrwxrwx 1 user user 9 Jun  1 14:26 python -> python3.6
> lrwxrwxrwx 1 user user 9 Jun  1 14:26 python3 -> python3.6
> -rwxrwxr-x 1 user user 17776 Jun  1 14:26 python3.6
> -rwxrwxr-x 1 user user  2354 Jun  1 14:26 python-config
> -rwxrwxr-x 1 user user   247 Jun  1 14:26 wheel
>
>
> I followed the steps listed here :  
> https://www.digitalocean.com/community/tutorials/how-to-use-mysql-or-mariadb-with-your-django-application-on-ubuntu-14-04
>  
>
> On Thursday, June 1, 2017 at 5:47:25 PM UTC-4, F. Nikita Thomas wrote:
>>
>> No such thing as a dumb question, how  do I check? 
>>
>> On Thursday, June 1, 2017 at 5:36:23 PM UTC-4, James Schneider wrote:
>>>
>>> *** Operational MODE: single process ***
 Traceback (most recent call last):
   File "./project/wsgi.py", line 12, in 
 from django.core.wsgi import get_wsgi_application
 ModuleNotFoundError: No module named 'django'
 unable to load app 0 (mountpoint='') (callable not found or import 
 error)
 *** no app loaded. going in full dynamic mode ***
 *** uWSGI is running in multiple interpreter mode ***
 spawned uWSGI worker 1 (and the only) (pid: 22388, cores: 1)
 ^C

 Shouldn't it see the Django installation in the virtualenv? I haven't 
 had this much fun since I had my wisdom teeth removed  Thanks again!

>>>
>>> Dumb question. Have you verified that Django is installed in the 
>>> virtualenv being used by uwsgi? You should be able to enter the virtualenv 
>>> and run that specific import command that is outlined. 
>>>
>>> -James 
>>>
>>

-- 
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/819a28c1-12f0-478f-bfa0-218c9323b14d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Post Office - html_content KO with attachment

2017-06-02 Thread Артём Мальцев
I has encountered this behaviour with django-post-office now. And I find 
one workaround: use both arguments *message* and *html_message* in 
*mail.send()* method. For example:

msg = render_to_string('path/to/template/', {'some_data': 'some_data'})
pdf = render_to_pdf(form.pdf_template, email_data)
attachments = {'Message.pdf': ContentFile(pdf)}
mail.send(user_email, me, subject=subject, message=msg, html_message=msg, 
attachments=attachments, headers=headers)



It works for me.

-- 
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/20707145-77c8-4e1a-8d3d-aff70575afa4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Generic Search for any Django Model

2017-06-02 Thread guettli
There are several libraries which enable you to do fancy pagination of 
django queryset.

See this grid: https://djangopackages.org/grids/g/pagination/

I have not look at all libraries, but the one I saw needed a queryset as 
input.

I search a solution for the step before this:

How to get to the queryset?

I search a library which translates request.GET to a queryset filter.


Example: You want to show a search form for users (model User) with a 
generic interface.

AFAIK this could be solved without coding, just configuring should be 
enough.


http:///mydjangopage.example.com/query?username=foo&date_joined__gt=2017-01-01

The library should take request.GET and the django.contrib.auth.models.User 
model. The result should be a queryset. The nice double underscore feature 
for filter should be supported, too.

This queryset can be passed to one of above pagination libraries.

Of course authorization needs to handled somehow (but later)


License: Only open source software can be used here.

Please ask, if you don't understand the question.

I ask here, since no expert could help me here: 
https://softwarerecs.stackexchange.com/questions/42458/generic-search-for-any-django-model

Regards,
  Thomas Güttler

-- 
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/4d002075-cd92-4fa8-86db-4e52ab633729%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Generic Search for any Django Model

2017-06-02 Thread Melvyn Sopacua
On Friday 02 June 2017 07:10:15 guettli wrote:
> There are several libraries which enable you to do fancy 
pagination of
> django queryset.
> 
> See this grid: https://djangopackages.org/grids/g/pagination/

And try looking at this grid:
https://djangopackages.org/grids/g/filters/


-- 
Melvyn Sopacua

-- 
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/3731225.IKlHOosZAb%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: Possible bug - Incorrect escaping in Django SQL query

2017-06-02 Thread Tim Graham
Cross posted to django-developers: 
https://groups.google.com/d/topic/django-developers/sIjOXpbQWZ0/discussion

In the future, please keep the conversation in one place. django-users is 
fine for asking "is it a bug?" questions.

My reply from django-developers:

I couldn't find any testing of TruncDay with Value().

Is there a difference between the query you're trying to construct and 
MyModel.objects.filter(created__lt=timezone.now().date()) ?

On Friday, June 2, 2017 at 5:15:23 AM UTC-4, Michal Petrucha wrote:
>
> On Thu, Jun 01, 2017 at 02:29:17AM -0700, Roshan Raghupathy wrote: 
> > Hi, 
> > I came across an issue yesterday. Post on stackoverflow 
> > <
> https://stackoverflow.com/questions/44287443/incorrect-escaping-in-django-sql-query>
>  
>
> > 
> > On further investigation today, I think I found the source of the issue. 
> > It's this line 
> > <
> https://github.com/django/django/blob/master/django/db/models/functions/datetime.py#L149>.
>  
>
> > The parameters which are escaped here are never reverted back to the 
> > original form. 
> > I tested a dirty fix by converting all '%%s' to '%s' and the query 
> worked. 
> > Should I submit a bug? Has it been submitted already? 
>
> Hi Roshan, 
>
> I just took a quick look, and it seems you are right – in all of the 
> official backend implementations, the *_trunc_sql only use the second 
> argument in the right-hand side of string formatting, so this 
> double-percent escaping appears to be wrong there. 
>
> I did a quick search through the issue tracker, and didn't find 
> anything about this issue, would you mind submitting a new bug report? 
> It would be best if you could include a complete minimal example that 
> we could easily run to reproduce the problem. 
>
> Thanks, 
>
> Michal 
>

-- 
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/41b97ade-d732-462f-ae3a-f324866b5418%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Inconsistency of clean method

2017-06-02 Thread Matthew Pava
I have been working with Django for several years and just discovered this gem 
in the documentation (emphasis mine):

https://docs.djangoproject.com/en/1.11/ref/forms/validation/#cleaning-and-validating-fields-that-depend-on-each-other
"If your form inherits another that doesn't return a cleaned_data dictionary in 
its clean() method (doing so is optional), then don't assign cleaned_data to 
the result of the super() call and use self.cleaned_data instead:"

I had always assumed that the clean method was required return the cleaned_data 
because I thought I had read that elsewhere.  Upon further investigation, I 
discovered that this requirement was changed in Django 1.7.  Any idea why?  (I 
obviously missed reading about that change.)  It does seem somewhat 
inconsistent since the clean_field methods all require the cleaned_data of the 
field to be returned.

I've been working on a formset and was used to the behavior of the super clean 
method always returning the cleaned_data dictionary.  ...but, it doesn't, and 
I've spent a great deal of time troubleshooting this issue believing otherwise. 
 I was wondering if we could/should ask the Django developers to return the 
cleaned_data in the formset classes since they do return cleaned_data in the 
form classes.

-- 
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/b2ec34cd647647ca807a284e424a57bc%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Re: uWSGI ModuleNotFoundError Django 1.11

2017-06-02 Thread F. Nikita Thomas
Thank you everyone and my apologies for the late reply, a friend passed. I 
did as requested and here are the results:


[user@echo project]$ which python
/usr/bin/python
[user@echo project]$ python -V
Python 2.7.5
[user@echo project]$ . projectenv/bin/activate
(projectenv) [user@echo project]$ which python
~/Env/project/projectenv/bin/python
(projectenv) [user@echo project]$ python -V
Python 3.6.1
(projectenv) [user@echo project]$ ls
foobar.py  manage.py  project  projectenv
(projectenv) [user@echo project]$ python manage.py check
System check identified no issues (0 silenced).
(projectenv) [user@echo project]$ ls -al projectenv/
total 24
drwxrwxr-x 5 user user 4096 Jun  1 14:26 .
drwxrwxr-x 4 user user 4096 Jun  1 19:09 ..
drwxrwxr-x 3 user user 4096 Jun  1 14:28 bin
drwxrwxr-x 2 user user 4096 Jun  1 14:26 include
drwxrwxr-x 3 user user 4096 Jun  1 14:26 lib
-rw-rw-r-- 1 user user   60 Jun  1 14:26 pip-selfcheck.json
(projectenv) [user@echo project]$ ls -al projectenv/lib/
total 12
drwxrwxr-x 3 user user 4096 Jun  1 14:26 .
drwxrwxr-x 5 user user 4096 Jun  1 14:26 ..
drwxrwxr-x 5 user user 4096 Jun  1 14:26 python3.6
(projectenv) [user@echo project]$ ls -al projectenv/include/
total 8
drwxrwxr-x 2 user user 4096 Jun  1 14:26 .
drwxrwxr-x 5 user user 4096 Jun  1 14:26 ..
lrwxrwxrwx 1 user user   29 Jun  1 14:26 python3.6m -> 
/usr/local/include/python3.6m
(projectenv) [user@echo project]$ ls -al projectenv/lib/python3.6/
total 52
drwxrwxr-x  5 user user  4096 Jun  1 14:26 .
drwxrwxr-x  3 user user  4096 Jun  1 14:26 ..
lrwxrwxrwx  1 user user31 Jun  1 14:26 abc.py -> 
/usr/local/lib/python3.6/abc.py
lrwxrwxrwx  1 user user34 Jun  1 14:26 base64.py -> 
/usr/local/lib/python3.6/base64.py
lrwxrwxrwx  1 user user34 Jun  1 14:26 bisect.py -> 
/usr/local/lib/python3.6/bisect.py
lrwxrwxrwx  1 user user39 Jun  1 14:26 _bootlocale.py -> 
/usr/local/lib/python3.6/_bootlocale.py
lrwxrwxrwx  1 user user34 Jun  1 14:26 codecs.py -> 
/usr/local/lib/python3.6/codecs.py
lrwxrwxrwx  1 user user36 Jun  1 14:26 collections -> 
/usr/local/lib/python3.6/collections
lrwxrwxrwx  1 user user44 Jun  1 14:26 _collections_abc.py -> 
/usr/local/lib/python3.6/_collections_abc.py
lrwxrwxrwx  1 user user53 Jun  1 14:26 config-3.6m-x86_64-linux-gnu -> 
/usr/local/lib/python3.6/config-3.6m-x86_64-linux-gnu
lrwxrwxrwx  1 user user32 Jun  1 14:26 copy.py -> 
/usr/local/lib/python3.6/copy.py
lrwxrwxrwx  1 user user35 Jun  1 14:26 copyreg.py -> 
/usr/local/lib/python3.6/copyreg.py
drwxrwxr-x  3 user user  4096 Jun  1 14:26 distutils
lrwxrwxrwx  1 user user41 Jun  1 14:26 _dummy_thread.py -> 
/usr/local/lib/python3.6/_dummy_thread.py
lrwxrwxrwx  1 user user34 Jun  1 14:26 encodings -> 
/usr/local/lib/python3.6/encodings
lrwxrwxrwx  1 user user32 Jun  1 14:26 enum.py -> 
/usr/local/lib/python3.6/enum.py
lrwxrwxrwx  1 user user35 Jun  1 14:26 fnmatch.py -> 
/usr/local/lib/python3.6/fnmatch.py
lrwxrwxrwx  1 user user37 Jun  1 14:26 functools.py -> 
/usr/local/lib/python3.6/functools.py
lrwxrwxrwx  1 user user38 Jun  1 14:26 __future__.py -> 
/usr/local/lib/python3.6/__future__.py
lrwxrwxrwx  1 user user39 Jun  1 14:26 genericpath.py -> 
/usr/local/lib/python3.6/genericpath.py
lrwxrwxrwx  1 user user35 Jun  1 14:26 hashlib.py -> 
/usr/local/lib/python3.6/hashlib.py
lrwxrwxrwx  1 user user33 Jun  1 14:26 heapq.py -> 
/usr/local/lib/python3.6/heapq.py
lrwxrwxrwx  1 user user32 Jun  1 14:26 hmac.py -> 
/usr/local/lib/python3.6/hmac.py
lrwxrwxrwx  1 user user34 Jun  1 14:26 importlib -> 
/usr/local/lib/python3.6/importlib
lrwxrwxrwx  1 user user31 Jun  1 14:26 imp.py -> 
/usr/local/lib/python3.6/imp.py
lrwxrwxrwx  1 user user30 Jun  1 14:26 io.py -> 
/usr/local/lib/python3.6/io.py
lrwxrwxrwx  1 user user35 Jun  1 14:26 keyword.py -> 
/usr/local/lib/python3.6/keyword.py
lrwxrwxrwx  1 user user36 Jun  1 14:26 lib-dynload -> 
/usr/local/lib/python3.6/lib-dynload
lrwxrwxrwx  1 user user37 Jun  1 14:26 linecache.py -> 
/usr/local/lib/python3.6/linecache.py
lrwxrwxrwx  1 user user34 Jun  1 14:26 locale.py -> 
/usr/local/lib/python3.6/locale.py
-rw-rw-r--  1 user user 0 Jun  1 14:26 no-global-site-packages.txt
lrwxrwxrwx  1 user user34 Jun  1 14:26 ntpath.py -> 
/usr/local/lib/python3.6/ntpath.py
lrwxrwxrwx  1 user user36 Jun  1 14:26 operator.py -> 
/usr/local/lib/python3.6/operator.py
-rw-rw-r--  1 user user10 Jun  1 14:26 orig-prefix.txt
lrwxrwxrwx  1 user user30 Jun  1 14:26 os.py -> 
/usr/local/lib/python3.6/os.py
lrwxrwxrwx  1 user user37 Jun  1 14:26 posixpath.py -> 
/usr/local/lib/python3.6/posixpath.py
drwxrwxr-x  2 user user  4096 Jun  1 14:26 __pycache__
lrwxrwxrwx  1 user user34 Jun  1 14:26 random.py -> 
/usr/local/lib/python3.6/random.py
lrwxrwxrwx  1 user user35 Jun  1 14:26 reprlib.py -> 
/usr/local/lib/python3.6/reprlib.py
lrwxrwxrwx  1 user user30 Jun  1 14:26 re.py -> 
/usr/local/lib/python3.6/re

Re: uWSGI ModuleNotFoundError Django 1.11

2017-06-02 Thread Melvyn Sopacua
On Friday 02 June 2017 12:53:06 F. Nikita Thomas wrote:
> Thank you everyone and my apologies for the late reply, a friend
> passed. I did as requested and here are the results:
> 
> 
> [user@echo project]$ which python
> /usr/bin/python
> [user@echo project]$ python -V
> Python 2.7.5

So at this point start uwsgi.
Not after activation of the virtualenv. Let uwsgi activate it by itself.

Personally, I don't have these issues as uwsgi is started by root as a service, 
with a 
somewhat clean environment. I can start it as:

sudo env -i PATH=/bin:/usr/bin:/usr/local/bin \
/usr/local/etc/rc.d/uwsgi start

and it still works (and no leakage of shell env of user to wsgi requests). I'm 
on FreeBSD, so 
hence no init.d but rc.d. Principle is the same though.
-- 
Melvyn Sopacua

-- 
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/55522997.a96XGSvLlg%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: uWSGI ModuleNotFoundError Django 1.11

2017-06-02 Thread F. Nikita Thomas

Hi Melvyn and yes!!:


[user@echo project]$ uwsgi --http :8000 --chdir /home/user/Env/project/ 
--module project.wsgi --virtualenv /home/user/Env/project/projectenv/
*** Starting uWSGI 2.0.15 (64bit) on [Fri Jun  2 19:54:37 2017] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-11) on 30 May 2017 
20:50:53
os: Linux-3.10.0-514.10.2.el7.x86_64 #1 SMP Fri Mar 3 00:04:05 UTC 2017
nodename: echo.com
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
current working directory: /home/user/Env/project
detected binary path: /usr/local/bin/uwsgi
chdir() to /home/user/Env/project/
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 4096
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on :8000 fd 4
spawned uWSGI http 1 (pid: 23477)
uwsgi socket 0 bound to TCP address 127.0.0.1:38743 (port auto-assigned) fd 
3
Python version: 3.6.1 (default, May 29 2017, 14:21:37)  [GCC 4.8.5 20150623 
(Red Hat 4.8.5-11)]
Set PythonHome to /home/user/Env/project/projectenv/
*** Python threads support is disabled. You can enable it with 
--enable-threads ***
Python main interpreter initialized at 0xf2a6f0
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72768 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
WSGI app 0 (mountpoint='') ready in 1 seconds on interpreter 0xf2a6f0 pid: 
23476 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 23476, cores: 1)
[pid: 23476|app: 0|req: 1/1] 74.70.110.103 () {40 vars in 738 bytes} [Fri 
Jun  2 23:55:20 2017] GET / => generated 1716 bytes in 9 msecs (HTTP/1.1 
200) 3 headers in 95 bytes (1 switches on core 0)
[pid: 23476|app: 0|req: 2/2] 74.70.110.103 () {40 vars in 738 bytes} [Fri 
Jun  2 23:55:21 2017] GET / => generated 1716 bytes in 2 msecs (HTTP/1.1 
200) 3 headers in 95 bytes (1 switches on core 0)
[pid: 23476|app: 0|req: 3/3] 74.70.110.103 () {38 vars in 719 bytes} [Fri 
Jun  2 23:55:51 2017] GET /admin/ => generated 0 bytes in 26 msecs 
(HTTP/1.1 302) 7 headers in 265 bytes (1 switches on core 0)
[pid: 23476|app: 0|req: 4/4] 74.70.110.103 () {38 vars in 756 bytes} [Fri 
Jun  2 23:55:51 2017] GET /admin/login/?next=/admin/ => generated 1650 
bytes in 52 msecs (HTTP/1.1 200) 7 headers in 381 bytes (1 switches on core 
0)
Not Found: /static/admin/css/base.css
[pid: 23476|app: 0|req: 5/5] 74.70.110.103 () {40 vars in 788 bytes} [Fri 
Jun  2 23:55:51 2017] GET /static/admin/css/base.css => generated 2009 
bytes in 7 msecs (HTTP/1.1 404) 3 headers in 102 bytes (1 switches on core 
0)
Not Found: /static/admin/css/login.css





So as you can see the only thing that's screwed up is the missing CSS and 
JavaScript files, ::cough, Help!!:: I am using this document 
-> https://gist.github.com/evildmp/3094281 , and wondering if this is fit 
to use to finish setting up Django & nginx, and could you recommend a 
canonical source for implementing good security for Django apps. Otherwise, 
thanks so much for all your help, you've made a rough time go a lot 
smoother.


On Thursday, June 1, 2017 at 1:53:37 PM UTC-4, F. Nikita Thomas wrote:
>
> Hi!
> I'm having a problem with configuring uWSGI with Django, when I run the 
> development server everything 'seems' okay, except that I am missing 
> styling on the html,  and when I test run uWSGI from the command line I get:
>
> (projectenv) [user@echo project]$  uwsgi --http :8000 --chdir 
> /home/user/env/project/project/ --module project.wsgi --virtualenv 
> /home/user/env/projectenv/
> *** Starting uWSGI 2.0.15 (64bit) on [Thu Jun  1 13:37:09 2017] ***
> compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-11) on 30 May 2017 
> 20:50:53
> os: Linux-3.10.0-514.10.2.el7.x86_64 #1 SMP Fri Mar 3 00:04:05 UTC 2017
> nodename: echo.com
> machine: x86_64
> clock source: unix
> pcre jit disabled
> detected number of CPU cores: 2
> current working directory: /home/user/env/project
> detected binary path: /usr/local/bin/uwsgi
> chdir() to /home/user/env/project/project/
> *** WARNING: you are running uWSGI without its master process manager ***
> your processes number limit is 4096
> your memory page size is 4096 bytes
> detected max file descriptor number: 1024
> lock engine: pthread robust mutexes
> thunder lock: disabled (you can enable it with --thunder-lock)
> uWSGI http bound on :8000 fd 4
> spawned uWSGI http 1 (pid: 22015)
> uwsgi socket 0 bound to TCP address 127.0.0.1:38735 (port auto-assigned) 
> fd 3
> Python version: 3.6.1 (default, May 29 2017, 14:21:37)  [GCC 4.8.5 
> 20150623 (Red Hat 4.8.5-11)]
> Set PythonHome to /home/user/env/projectenv/
> *** Python threads support is disabled. You can enable it with 
> --enable-threads ***
> Python main interpreter