Giter Site home page Giter Site logo

microsoft / python-sample-tweeterapp Goto Github PK

View Code? Open in Web Editor NEW
105.0 105.0 70.0 3.1 MB

Sample Django+React+Postgres application for use in Visual Studio Code and Azure

License: MIT License

Dockerfile 5.22% Python 54.21% Shell 0.07% CSS 8.14% JavaScript 29.64% HTML 2.72%

python-sample-tweeterapp's People

Contributors

anapo14 avatar dependabot[bot] avatar luabud avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar qubitron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-sample-tweeterapp's Issues

`docker-compose up` works, but remote debugging doesn't

When cloning into a new directory, docker-compose up works, after changing the name of .env file to .env-sample, since that's what docker-compose.yml is looking for. However, neither VisualStudio Code nor VisualStudio Code Insiders works to launch and connect to the docker-compose remotely.

Figured out an additional step necessary for this example to work in VS Code.
In requirements.txt file comment out psycopg2==2.7.4 --no-binary psycopg2 line and add psycopg2-binary==2.8.3. Then follow instructions in the Readme to start the node server in one terminal/shell, followed by Python/Django in another terminal/shell.

Also, thank you for posting this project. It made the ramp up on VS Code remote debugging much faster.

Out-of-date requirements file

Hello!

You have an out-of-date requirements file.

psycopg-2.7.4 is not compatible with python 3.8.*

If you leave it unchanged and try to run a remote docker folder, you will get this issue (because of old version of psycopg2 which is not compatible with python 3.8.*).

errorlog.txt

It also was discussed in this thread:
psycopg/psycopg2#854 (comment)

You can simply fix it by replacing the version of psycopg2 in requirements file with the last stable version of psycopg from psycopg.com (2.8.5 for instance)

Replace this

psycopg2==2.7.4 --no-binary psycopg2

with this

psycopg2==2.8.5 --no-binary psycopg2

djangorestframework-3.9.1 is not compatible with django 3.*

It won't let you to migrate your models, if you don't update. Because of deprecated django.utils.six module.

Solution:
pip install djangorestframework --upgrade

whitenoise-4.1 is not compatible with django 3.*

Same as above. Now it won't let you run server. Again this six import!!

Solution:
pip install whitenoise --upgrade

Error when clicking on reopen in container in vscode 1.43.0 remote-containers 0.106.0

[13569 ms] Successfully built lazy-object-proxy wrapt
[13699 ms] Installing collected packages: six, lazy-object-proxy, wrapt, astroid, asgiref, sqlparse, pytz, Django, python-dotenv, djangorestframework, isort, mccabe, psycopg2, pycodestyle, whitenoise
[17831 ms] Running setup.py install for psycopg2: started
[26798 ms] Running setup.py install for psycopg2: finished with status 'error'

ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rcteoxm8/psycopg2/setup.py'"'"'; file='"'"'/tmp/pip-install-rcteoxm8/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-toe7tkgr/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/psycopg2
cwd: /tmp/pip-install-rcteoxm8/psycopg2/
Complete output (72 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.8
creating build/lib.linux-x86_64-3.8/psycopg2
copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extensions.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/tz.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_json.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/extras.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/init.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/sql.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/errorcodes.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/_range.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/pool.py -> build/lib.linux-x86_64-3.8/psycopg2
copying lib/psycopg1.py -> build/lib.linux-x86_64-3.8/psycopg2
creating build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_transaction.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/dbapi20.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_cancel.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_types_extras.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_ipaddress.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_module.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_notify.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_bugX000.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_connection.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/testconfig.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_errcodes.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_types_basic.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_async.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_quote.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/init.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_cursor.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_fast_executemany.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_sql.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_green.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_async_keyword.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_psycopg2_dbapi20.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_bug_gc.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/dbapi20_tpc.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_lobject.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
[75235 ms] copying tests/test_with.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_dates.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_replication.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_extras_dictcursor.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/testutils.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
copying tests/test_copy.py -> build/lib.linux-x86_64-3.8/psycopg2/tests
Skipping optional fixer: buffer
Skipping optional fixer: idioms
Skipping optional fixer: set_literal
Skipping optional fixer: ws_comma
running build_ext
building 'psycopg2._psycopg' extension
creating build/temp.linux-x86_64-3.8
creating build/temp.linux-x86_64-3.8/psycopg
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7.4 (dt dec pq3 ext lo64)" -DPG_VERSION_NUM=110007 -DHAVE_LO64=1 -I/usr/local/include/python3.8 -I. -I/usr/include/postgresql -I/usr/include/postgresql/11/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.8/psycopg/psycopgmodule.o -Wdeclaration-after-statement
psycopg/psycopgmodule.c: In function ‘psyco_is_main_interp’:
psycopg/psycopgmodule.c:685:18: error: dereferencing pointer to incomplete type ‘PyInterpreterState’ {aka ‘struct _is’}
while (interp->next)
^~

It appears you are missing some prerequisite to build the package from source.

You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.

For further information please check the 'doc/src/install.rst' file (also at
<http://initd.org/psycopg/docs/install.html>).

error: command 'gcc' failed with exit status 1
----------------------------------------

Windows line endings in scripts

Windows line endings does not recognized by bash:

root@536137b2e733:/workspace# chmod +x manage.py
root@536137b2e733:/workspace# ./manage.py runserver
/usr/bin/env: ‘python\r’: No such file or directory

Error install psycopg2

Replaced
psycopg2==2.7.4 --no-binary psycopg2
with
psycopg2==2.8.4
in requirements.txt

This seems to have fixed the error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.