Thursday, June 27, 2019

Re: Heroku and DJango_Filters

It would be helpful to do a clean setup and then view the log files.


Kind regards,
Lloyd

On Thu, Jun 27, 2019, 01:58 Charlotte Wood <charlotte.wood@epiccharterschools.org> wrote:
yes, but look at the error...now it isn't recognize the django-heroku app all of a sudden.  it's not yielding any error on django_filters.....  you think my python is corrupt?


Charlotte Wood, MEd

Educator

(405) 578-5701

Zoom Meeting ID#: 4055785701

Zoom URL: https://epiccharterschools.zoom.us/j/2970513912

Classroom Google Site: https://sites.google.com/epiccharterschools.org/charlottewoodclassroom/home

Epic Technical Support: (405) 652-0935



Jordan McKesson Principal

405-749-4550 ext. 309

jordan.mckesson@epiccharterschools.org





On Wed, Jun 26, 2019 at 6:09 PM Sithembewena L. Dube <zebra05@gmail.com> wrote:
Hi Charlotte,

I spotted the problem.

You need to add 'django-filters' to your settings.py file.

Like so:


INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'maintenance',
  'django-filters',
]

Then run python manage.py migrate (if the app needs a database schema, the command will generate it.


Try this?


Kind regards,
Lloyd

On Thu, Jun 27, 2019, 00:58 Charlotte Wood <charlotte.wood@epiccharterschools.org> wrote:
Thanks everyone....so I've unistalled and reinstalled everything and same errors.  I so much appreciate ANY help:

settings.py file reads like this:


import os
import django_heroku
from decouple import config
import dj_database_url

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

SECRET_KEY = config('SECRET_KEY')

DEBUG = True

ALLOWED_HOSTS = []

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'maintenance',
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'whitenoise.middleware.WhiteNoiseMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'freshstart.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'freshstart.wsgi.application'

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
    }
}

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]


LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))

STATIC_URL = '/static/'

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'static')
]

STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

django_heroku.settings(locals())




REQUIREMENTS.TXT FILE:

j-database-url==0.5.0
Django==2.2
django-filter==2.1.0
django-heroku==0.3.1
gunicorn==19.9.0
psycopg2==2.8.3
python-decouple==3.1
pytz==2019.1
sqlparse==0.3.0
whitenoise==4.1.2

I have a Procfile and a Pipfile.  The Procfile was put there using touch . Procfile in Git Bash.

When I try to push to Heroku, now I get this error for django_heroku, but you can see, it's plainly installed and imported at the top of my settings file.

Should I complete uninstall and re-install Python?


Here is my error:

Enumerating objects: 80, done.
Counting objects: 100% (80/80), done.
Delta compression using up to 4 threads
Compressing objects: 100% (76/76), done.
Writing objects: 100% (80/80), 38.18 KiB | 566.00 KiB/s, done.
Total 80 (delta 16), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.7.3
remote: -----> Installing pip
remote: -----> Installing dependencies with Pipenv 2018.5.18…
remote:        Installing dependencies from Pipfile.lock (7fdd58)…
remote: -----> Installing SQLite3
remote: -----> $ python manage.py collectstatic --noinput
remote:        Traceback (most recent call last):
remote:          File "/app/.heroku/python/lib/python3.7/site-packages/django/core/management/__init__.py", line 204, in fetch_command
remote:            app_name = commands[subcommand]
remote:        KeyError: 'collectstatic'
remote:        During handling of the above exception, another exception occurred:
remote:        Traceback (most recent call last):
remote:          File "manage.py", line 21, in <module>
remote:            main()
remote:          File "manage.py", line 17, in main
remote:            execute_from_command_line(sys.argv)
remote:          File "/app/.heroku/python/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
remote:            utility.execute()
remote:          File "/app/.heroku/python/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute
remote:            settings.INSTALLED_APPS
remote:          File "/app/.heroku/python/lib/python3.7/site-packages/django/conf/__init__.py", line 79, in __getattr__
remote:            self._setup(name)
remote:          File "/app/.heroku/python/lib/python3.7/site-packages/django/conf/__init__.py", line 66, in _setup
remote:            self._wrapped = Settings(settings_module)
remote:          File "/app/.heroku/python/lib/python3.7/site-packages/django/conf/__init__.py", line 157, in __init__
remote:            mod = importlib.import_module(self.SETTINGS_MODULE)
remote:          File "/app/.heroku/python/lib/python3.7/importlib/__init__.py", line 127, in import_module

remote:            return _bootstrap._gcd_import(name[level:], package, level)
remote:          File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
remote:          File "<frozen importlib._bootstrap>", line 983, in _find_and_load
remote:          File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
remote:          File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
remote:          File "<frozen importlib._bootstrap_external>", line 728, in exec_module
remote:          File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
remote:          File "/tmp/build_c255721dd1d2732fd6d23e4f7726e08a/freshstart/settings.py", line 6, in <module>
remote:            import django_heroku
remote:        ModuleNotFoundError: No module named 'django_heroku'
remote:
remote:  !     Error while running '$ python manage.py collectstatic --noinput'.
remote:        See traceback above for details.
remote:
remote:        You may need to update application code to resolve this error.
remote:        Or, you can disable collectstatic for this application:
remote:
remote:           $ heroku config:set DISABLE_COLLECTSTATIC=1
remote:

remote:        https://devcenter.heroku.com/articles/django-assets
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to epiclivetest2.
remote:
To https://git.heroku.com/epiclivetest2.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/epiclivetest2.git'



Charlotte Wood, MEd

Educator

(405) 578-5701

Zoom Meeting ID#: 4055785701

Zoom URL: https://epiccharterschools.zoom.us/j/2970513912

Classroom Google Site: https://sites.google.com/epiccharterschools.org/charlottewoodclassroom/home

Epic Technical Support: (405) 652-0935



Jordan McKesson Principal

405-749-4550 ext. 309

jordan.mckesson@epiccharterschools.org





On Wed, Jun 26, 2019 at 2:29 PM Sithembewena L. Dube <zebra05@gmail.com> wrote:
As per: https://github.com/carltongibson/django-filter

Kind regards,
Lloyd


Sent with Shift

On Wed, Jun 26, 2019 at 9:26 PM Fabio C. Barrionuevo da Luz <bnafta@gmail.com> wrote:
make sure that you use the right package in your requirements.txt

This is the package that everyone uses:

django-filter 
https://pypi.org/project/django-filter/

This is another package with a very similar name

https://pypi.org/project/django-filters/



Em qua, 26 de jun de 2019 às 16:21, Charlotte Wood <charlotte.wood@epiccharterschools.org> escreveu:
I have that.  That's not the problem.  My specific problem is django_filters.  My app worked totally fine until I added these filters.  My questions was:  has anyone had trouble with django-filters and if so, how did you fix it?


Charlotte Wood, MEd

Educator

(405) 578-5701

Zoom Meeting ID#: 4055785701

Zoom URL: https://epiccharterschools.zoom.us/j/2970513912

Classroom Google Site: https://sites.google.com/epiccharterschools.org/charlottewoodclassroom/home

Epic Technical Support: (405) 652-0935



Jordan McKesson Principal

405-749-4550 ext. 309

jordan.mckesson@epiccharterschools.org





On Wed, Jun 26, 2019 at 2:17 PM Fabio C. Barrionuevo da Luz <bnafta@gmail.com> wrote:
Heroku use a "buildpack"  https://devcenter.heroku.com/articles/buildpacks to do automate some things in the deployment.
you can attach one or more buildpacks to your project in heroku
you can also create your own buildpack to customize it.

specifically for Python, the heroku python buildpack (https://github.com/heroku/heroku-buildpack-python) will:

- search a "requirements.txt" file on root directory and install all packages listed on that file.
- search pipenv related files and install all packages listed on that file.

in short, have a requirements.txt file in your root directory





Em qua, 26 de jun de 2019 às 16:07, Charlotte Wood <charlotte.wood@epiccharterschools.org> escreveu:
ok, stupid question....

is there a heroku pip install?

all of my dependencies are installed and listed on my requirements.txt file just like they're supposed to be.

do i pip install somewhere OTHER than my folder in my virtual environment?

i could be totally crazy, but i don't remember every using heroku pip install.....




Charlotte Wood, MEd

Educator

(405) 578-5701

Zoom Meeting ID#: 4055785701

Zoom URL: https://epiccharterschools.zoom.us/j/2970513912

Classroom Google Site: https://sites.google.com/epiccharterschools.org/charlottewoodclassroom/home

Epic Technical Support: (405) 652-0935



Jordan McKesson Principal

405-749-4550 ext. 309

jordan.mckesson@epiccharterschools.org





On Wed, Jun 26, 2019 at 12:07 PM Sithembewena L. Dube <zebra05@gmail.com> wrote:
It sounds like the package django-filters is not installed on your Heroku environment.

Do you have a dependency file suck as a Pipfile or requirements.txt? If you do, you will need to install all dependencies listed there on your Heroku server (at least those you need for production use).

Kind regards,
Lloyd


Sent with Shift

On Wed, Jun 26, 2019 at 6:53 PM Charlotte Wood <charlotte.wood@epiccharterschools.org> wrote:
The only error I keep seeing is "No Module Found" for django-filters

But, I don't understand why it runs perfectly on my local host, every single page, then heroku just hates django filters.  I was hoping someone else had the same issues and remembered.  But, I will follow up with the error logs in a sec.  Thanks ya'll!!



Charlotte Wood, MEd

Educator

(405) 578-5701

Zoom Meeting ID#: 4055785701

Zoom URL: https://epiccharterschools.zoom.us/j/2970513912

Classroom Google Site: https://sites.google.com/epiccharterschools.org/charlottewoodclassroom/home

Epic Technical Support: (405) 652-0935



Jordan McKesson Principal

405-749-4550 ext. 309

jordan.mckesson@epiccharterschools.org





On Wed, Jun 26, 2019 at 11:13 AM Sithembewena L. Dube <zebra05@gmail.com> wrote:
Hi Charlotte,

What sort of error do you see?

Also, have your checked your logs on Heroku?

Lastly, if you have a sandbox on Heroku, you could run the site there in debug mode to get more specific error information.

Kind regards,
Lloyd


Sent with Shift

On Wed, Jun 26, 2019 at 5:59 PM Charlotte Wood <charlotte.wood@epiccharterschools.org> wrote:
I need help.

I've followed the directions to a "T."  

1.  My site works PERFECTLY on my local host in my virtual environment.  NO errors, migrates fine, runs fine and looks beautiful.

2.  BEFORE I added Django-filters to my pages, it worked GREAT on Heroku.

3.  AS SOON as I put the DJango_filters in it, BOOM, Heroku won't run it.  I can find literally no documentation except for the textbook info from DJango, which doesn't troubleshoot at all.

Has anyone had this trouble already?

I have to get this up and running!

ANY suggestions would be helpful.  ANY.....


Charlotte Wood, MEd

Educator

(405) 578-5701

Zoom Meeting ID#: 4055785701

Zoom URL: https://epiccharterschools.zoom.us/j/2970513912

Classroom Google Site: https://sites.google.com/epiccharterschools.org/charlottewoodclassroom/home

Epic Technical Support: (405) 652-0935



Jordan McKesson Principal

405-749-4550 ext. 309

jordan.mckesson@epiccharterschools.org



--
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+unsubscribe@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/CAPZR0N4O0MorKsihVqZzbNmsrkptZgo2tqy_NfGUi%2BnF0_mZ6A%40mail.gmail.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+unsubscribe@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/CAH-SnCC0B1FYJpEtZYo72x-_uTwRMdBojg1mw9bkxw1tdWRe5Q%40mail.gmail.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+unsubscribe@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/CAPZR0N7Okz5pk3aM24pD7kQHri4BZvqripKtimdbs5cHSs9GLg%40mail.gmail.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+unsubscribe@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/CAH-SnCAypOEPdoDpS%3DqXJkH76yE-hKdGSF9nd2gvNHV4xyCyew%40mail.gmail.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+unsubscribe@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/CAPZR0N4dBX_oR8EWh1sG0WBEmE%3DVqnTRLTR1EeRsKnWRpqdCOQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


--
Fábio C. Barrionuevo da Luz
Palmas - Tocantins - Brasil - América do Sul


Blog colaborativo sobre Python e tecnologias Relacionadas, mantido totalmente no https://github.com/pythonclub/pythonclub.github.io .

Todos são livres para publicar. É só fazer fork, escrever sua postagem e mandar o pull-request. Leia mais sobre como publicar em README.md e contributing.md.
Regra básica de postagem:
"Você" acha interessante? É útil para "você"? Pode ser utilizado com Python ou é útil para quem usa Python? Está esperando o que? Publica logo, que estou louco para ler...

--
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+unsubscribe@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/CAPVjvMa6K%3Dx%2Bxs%3DKCxZeT8ZEhbZbBQwvLCJvwSU8EiFYaf6HtA%40mail.gmail.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+unsubscribe@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/CAPZR0N5L7%3DOBQnBuZCaiivKCxeAPseFb618AYTppzgWOo6VV9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


--
Fábio C. Barrionuevo da Luz
Palmas - Tocantins - Brasil - América do Sul


Blog colaborativo sobre Python e tecnologias Relacionadas, mantido totalmente no https://github.com/pythonclub/pythonclub.github.io .

Todos são livres para publicar. É só fazer fork, escrever sua postagem e mandar o pull-request. Leia mais sobre como publicar em README.md e contributing.md.
Regra básica de postagem:
"Você" acha interessante? É útil para "você"? Pode ser utilizado com Python ou é útil para quem usa Python? Está esperando o que? Publica logo, que estou louco para ler...

--
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+unsubscribe@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/CAPVjvMbsDMyHhnbCVE15jG5YHTTwRgYpsnb4vHhDTCNfeHN15w%40mail.gmail.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+unsubscribe@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/CAH-SnCAorgVtH-gkOFkczv3TP7C8Mi4oCZbeMeVtC-etfcS-5A%40mail.gmail.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+unsubscribe@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/CAPZR0N4-sNQCSiwkWqyDgJ1RFH4X0NxgoLUWDV5tPsKRvTZqww%40mail.gmail.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+unsubscribe@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/CAH-SnCAG7%3DoCpJVku77euVroXXBH2cHau9JnpJa3nfgQXX2KUQ%40mail.gmail.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+unsubscribe@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/CAPZR0N7%2Bs58rOnDHuG1NdX1n1WJPYxmDeUg%3Dx%2BUu2gXqBHmwpw%40mail.gmail.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+unsubscribe@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/CAH-SnCC%2Bc6jH72YrPfEavx3RmCU2kaSD_zex1OgkaW%3DO02rsvQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment