Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 16 2015 16:59
    olasitarska commented #362
  • May 16 2015 16:59

    olasitarska on master

    Making post_detail.html more co… Merge pull request #362 from ve… (compare)

  • May 16 2015 16:59
    olasitarska closed #362
  • May 16 2015 16:57
    kvbik commented #362
  • May 16 2015 16:51
    veuu opened #362
  • May 16 2015 15:20
    hjwp commented #361
  • May 16 2015 15:16
    hjwp synchronize #361
  • May 16 2015 15:15
    hjwp synchronize #361
  • May 16 2015 15:12
    bmispelon commented #361
  • May 16 2015 15:08
    hjwp opened #361
  • May 16 2015 14:58
    bmispelon opened #360
  • May 16 2015 13:15
    bmispelon commented #359
  • May 16 2015 13:15

    bmispelon on master

    Provide alternative runserver c… Merge pull request #359 from Al… (compare)

  • May 16 2015 13:15
    bmispelon closed #359
  • May 16 2015 13:14
    keimlink commented #359
  • May 16 2015 13:13
    olasitarska commented #359
  • May 16 2015 13:09
    bmispelon commented #359
  • May 16 2015 11:53
    Almad opened #359
  • May 15 2015 20:00
    bmispelon commented #358
  • May 15 2015 19:59

    bmispelon on master

    fixing broken github link Merge pull request #358 from gs… (compare)

prammohan
@prammohan
i see it in my prompt
Raphael Das Gupta
@das-g

what is the output when you run

pip freeze

in that command line window?

(It should be something like

Django==2.2.24
pytz==2021.1
sqlparse==0.4.1

)

prammohan
@prammohan
(myvenv) (base) ➜ ~ git:(master) ✗ pip freeze
Django==2.2.24
pytz==2021.1
sqlparse==0.4.1
Looks like @nur-hafiz has the same problem as reported above
Raphael Das Gupta
@das-g
That looks good.
prammohan
@prammohan
yep i just followed the steps. Everything seems ok but for the migration step
Raphael Das Gupta
@das-g

Maybe the Django installation was incomplete for some reason.

I'd try the following:

  1. disable the virtualenv:
     deactivate
  2. delete the virtualenv:
     rm myvenv -rf
  3. repeat the steps of https://tutorial.djangogirls.org/en/django_installation/ (except creating requirements.txt. You can use the existing one.)

Looks like @nur-hafiz has the same problem as reported above

The module that isn't being found is config in their case, though. But maybe the cause is indeed similar. I don't really know.

prammohan
@prammohan
ok thanks - followed your steps to deactivate, delete, recreate the virtual env, and then i just reinstalled django using the command below
pip install Django==2.2.4
note i did not use requirements.txt and put the version number directly
right after this i did the
python manage.py migrate but it still gives me the same error
Raphael Das Gupta
@das-g
strange.
Did pip install Django==2.2.4 give any output that looks like an error message?
prammohan
@prammohan
it gave a warning
WARNING: You are using pip version 21.1.1; however, version 21.1.2 is available.
You should consider upgrading via the '/Users/ramp/myvenv/bin/python3.9 -m pip install --upgrade pip' command.
Raphael Das Gupta
@das-g
Hmm ... usually it's not a problem to use a slightly older version of pip, but as you're facing a problem, let's try that anyway:
python -m pip install --upgrade pip
pip install --upgrade -r requirements.txt
prammohan
@prammohan
i think i figured it out. i had to use
python3.9 manage.py migrate instead of just python
(myvenv) (base) ➜ ~ git:(master) ✗ which python
python: aliased to /usr/local/bin/python3.9
(myvenv) (base) ➜ ~ git:(master) ✗ which python3.9
/Users/ramp/myvenv/bin/python3.9
Raphael Das Gupta
@das-g
oh
prammohan
@prammohan
there are 2 versions of python3.9. and i was using the python command per the tutorial but in this case I had to explicitly invoke python3.9 which as you see is pointing to a different folder
Raphael Das Gupta
@das-g
Strange, I would have thought that the virtualenv provides python, python3and python3.9.
(all pointing to the same executable)
prammohan
@prammohan
in my case they were pointing to a different executable. Not sure why
but happy to move forward
Raphael Das Gupta
@das-g
:+1:
prammohan
@prammohan
thank you Raphael
I want to develop a simple web app in 3 days. And as you see I know nothing about django :-)
Raphael Das Gupta
@das-g

If the simple web app happens to be a simple blogging app, just continue following the tutorial. It's definitely doable within 3 days and you have a good part of it already behind you.

If the simple web app shall be something different, you may want to consult further resources, such as the tutorial in the Django documentation.

(But completing the Django Girls tutorial first is probably a good idea.)
prammohan
@prammohan
ok thanks - i have bookmarked the tutorial. The simple app is not a blogging app but I just started with it to learn the basics.
Someone please Help me Out With this
prammohan
@prammohan
Raphael and team : i finally got to setup the python anywhere account to host the blog. However, I realized I was using python3.9 instead of 3.8 since your original article mentioned 3.8 or later. But pythonanywhere doesnt support 3.9. And so I'm stuck. Just thought I let you know because for the blog example we MUST use 3.8 and no later version of python. thanks.
Raphael Das Gupta
@das-g
Using different versions of Python locally and on PythonAnywhere should be fine, as long as you don't use features only available in the later one.
The used Django version and the Django Girls tutorial should not use any such too-new features.
terrahQ
@terrahQ
Hi there- i am getting this error
image.png
How do I fix this?
prammohan
@prammohan

ok then i am not sure why I am getting this error when trying to host the app through pythonanywhere
ile "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/prammohan/prammohan.pythonanywhere.com/mysite/settings.py", line 125, in <module>
MEDIA_ROOT = Path(BASE_DIR / 'media')
NameError: name 'Path' is not defined
Traceback (most recent call last):
File "/home/prammohan/.local/bin/pa_autoconfigure_django.py", line 49, in <module>
main(
File "/home/prammohan/.local/bin/pa_autoconfigure_django.py", line 39, in main
project.run_collectstatic()
File "/home/prammohan/.local/lib/python3.8/site-packages/pythonanywhere/django_project.py", line 118, in run_coll
ectstatic
subprocess.check_call([
File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/prammohan/.virtualenvs/prammohan.pythonanywhere.com/bin/python', '/
home/prammohan/prammohan.pythonanywhere.com/manage.py', 'collectstatic', '--noinput']' returned non-zero exit statu
s 1.
22:10 ~ $ File "/home/prammohan/prammohan.pythonanywhere.com/mysite/settings.py", line 125, in <module>
bash: syntax error near unexpected token newline' 22:10 ~ $ MEDIA_ROOT = Path(BASE_DIR / 'media') bash: syntax error near unexpected token('
22:10 ~ $ NameError: name 'Path' is not defined
bash: NameError:: command not found
22:10 ~ $ Traceback (most recent call last):
bash: syntax error near unexpected token most' 22:10 ~ $ File "/home/prammohan/.local/bin/pa_autoconfigure_django.py", line 49, in <module> bash: syntax error near unexpected tokennewline'
22:10 ~ $ main(
bash: syntax error near unexpected token `newline'
22:10 ~ $ File "/home/prammohan/.local/bin/pa_autoconfigure_django.py", line 39, in main
bash: File: command not found
22:10 ~ $ project.run_collectstatic()

File "/home/prammohan/.local/lib/python3.8/site-packages/pythonanywhere/django_project.py", line 118, in run_co
llectstatic
bash: syntax error near unexpected token File' 22:10 ~ $ subprocess.check_call([ bash: syntax error near unexpected token['
22:10 ~ $ File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
bash: File: command not found
22:10 ~ $ raise CalledProcessError(retcode, cmd)
bash: syntax error near unexpected token `('
22:10 ~ $ subprocess.CalledProcessError: Command '['/home/prammohan/.virtualenvs/prammohan.pythonanywhere.com/bin/p
ython', '/home/prammohan/prammohan.pythonanywhere.com/manage.py', 'collectstatic', '--noinput']' returned non-zero
exit status 1.

Screen Shot 2021-06-07 at 3.15.59 PM.png
it complains about settings.py line 125 and when i go to that file it only has 123 lines
prammohan
@prammohan
I think I figured out the issue. Ignore my issue above.
Richa verma
@therichaverma
Hey! please fill this form. It would be helpful for the research i am doing.
https://forms.gle/BkyqSevJWiJz4SEw8
Mauro💎
@MauroUlloa14_twitter
Hello, my problem is that my blog folder is not created and I do not know how to create that folder. Please help!
image.png
image.png
Blessed
@nullx5

@MauroUlloa14_twitter The problem is that you forgot to import os. Add this line of code in settings.py:

import os

And everything should be fine. Hope this helps!

wuqidi233
@wuqidi233
python manage.py migrate
Traceback (most recent call last):
File "manage.py", line 21, in <module>
main()
File "manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "C:\Users\wuqid\djangogirls\myvenv\lib\site-packages\django\core\management__init.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\wuqid\djangogirls\myvenv\lib\site-packages\django\core\management\
init.py", line 357, in execute
django.setup()
File "C:\Users\wuqid\djangogirls\myvenv\lib\site-packages\django\
init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\wuqid\djangogirls\myvenv\lib\site-packages\django\apps\registry.py", line 114, in populate
app_config.import_models()
File "C:\Users\wuqid\djangogirls\myvenv\lib\site-packages\django\apps\config.py", line 211, in import_models
self.models_module = import_module(models_module_name) File "D:\anaconda3\lib\importlib\
init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\wuqid\djangogirls\myvenv\lib\site-packages\django\contrib\auth\models.py", line 2, in <module>
from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
File "C:\Users\wuqid\djangogirls\myvenv\lib\site-packages\django\contrib\auth\base_user.py", line 47, in <module>
class AbstractBaseUser(models.Model):
File "C:\Users\wuqid\djangogirls\myvenv\lib\site-packages\django\db\models\base.py", line 117, in
new
new_class.add_to_class('_meta', Options(meta, app_label))
File "C:\Users\wuqid\djangogirls\myvenv\lib\site-packages\django\db\models\base.py", line 321, in add_to_class
value.contribute_to_class(cls, name)
File "C:\Users\wuqid\djangogirls\myvenv\lib\site-packages\django\db\models\options.py", line 204, in contribute_to_class
self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
File "C:\Users\wuqid\djangogirls\myvenv\lib\site-packages\django\db\
init.py", line 28, in getattr
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "C:\Users\wuqid\djangogirls\myvenv\lib\site-packages\django\db\utils.py", line 201, in
getitem
backend = load_backend(db['ENGINE'])
File "C:\Users\wuqid\djangogirls\myvenv\lib\site-packages\django\db\utils.py", line 110, in load_backend
return import_module('%s.base' % backend_name)
File "D:\anaconda3\lib\importlib\
init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\wuqid\djangogirls\myvenv\lib\site-packages\django\db\backends\sqlite3\base.py", line 13, in <module>
from sqlite3 import dbapi2 as Database
File "D:\anaconda3\lib\sqlite3\
init__.py", line 23, in <module>
from sqlite3.dbapi2 import
File "D:\anaconda3\lib\sqlite3\dbapi2.py", line 27, in <module>
from _sqlite3 import

ImportError: DLL load failed while importing _sqlite3: 指
定されたモジュールが見つかりません。
SHIVAM CHAVAN
@shivamchavan:matrix.org
[m]
hello
bete o bete moj krdii
Abhijeet
@abhijeet341:matrix.org
[m]
Can someone explain me the warning that git is showing in the "Use Git and optional Unix tools from the Windows Command Prompt" option during the installation process. Will this warning affect any of my future work.