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)

Piotr Niełacny
@LTe
@pooya1919 your database is inconsistent, try to recreate database from scratch if you can
pooya
@pooya1919
@LTe thanks a lot
rohitam
@rohitam
Hi
Piotr Niełacny
@LTe
Hi
mmichaud3
@mmichaud3
The people there say “Looks like your wsgi file is not pointing to your django settings file”
Any Advice on how to fix?
Piotr Niełacny
@LTe
@mmichaud3 what is the problem? Can you show error message or what is going on?

In wsgi.py there is os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')

It will take env variable from your system but if there is none it will set mysite.settings in my case. This is mysite directory and settings file in your project directory. Name of your module is probably wrong (?)

mmichaud3
@mmichaud3
2019-09-12 02:22:42,843: Error running WSGI application
2019-09-12 02:22:42,857: NameError: name 'BASE_DIR' is not defined
2019-09-12 02:22:42,857: File "/var/www/mmichaud3_pythonanywhere_com_wsgi.py", line 15, in <module>
2019-09-12 02:22:42,858: application = get_wsgi_application()
2019-09-12 02:22:42,858:
2019-09-12 02:22:42,858: File "/home/mmichaud3/mmichaud3.pythonanywhere.com/myenv/Lib/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2019-09-12 02:22:42,858: django.setup(set_prefix=False)
2019-09-12 02:22:42,858:
2019-09-12 02:22:42,859: File "/home/mmichaud3/mmichaud3.pythonanywhere.com/myenv/Lib/site-packages/django/init.py", line 19, in setup
2019-09-12 02:22:42,859: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2019-09-12 02:22:42,859:
2019-09-12 02:22:42,859: File "/home/mmichaud3/mmichaud3.pythonanywhere.com/myenv/Lib/site-packages/django/conf/init.py", line 79, in getattr
2019-09-12 02:22:42,861: self._setup(name)
2019-09-12 02:22:42,861:
2019-09-12 02:22:42,861: File "/home/mmichaud3/mmichaud3.pythonanywhere.com/myenv/Lib/site-packages/django/conf/init.py", line 66, in _setup
2019-09-12 02:22:42,862: self._wrapped = Settings(settings_module)
2019-09-12 02:22:42,862:
2019-09-12 02:22:42,862: File "/home/mmichaud3/mmichaud3.pythonanywhere.com/myenv/Lib/site-packages/django/conf/init.py", line 157, in init
2019-09-12 02:22:42,862: mod = importlib.import_module(self.SETTINGS_MODULE)
2019-09-12 02:22:42,863:
2019-09-12 02:22:42,863: File "/home/mmichaud3/mmichaud3.pythonanywhere.com/myenv/Lib/site-packages/isort/init.py", line 25, in <module>
2019-09-12 02:22:42,863: from . import settings # noqa: F401
2019-09-12 02:22:42,863:
2019-09-12 02:22:42,864: File "/home/mmichaud3/mmichaud3.pythonanywhere.com/myenv/Lib/site-packages/isort/settings.py", line 359, in <module>
2019-09-12 02:22:42,864: STATIC_ROOT = os.path.join(BASE_DIR, 'static')
2019-09-12 02:22:42,865: *
2019-09-12 02:22:42,865: If you're seeing an import error and don't know why,
2019-09-12 02:22:42,865: we have a dedicated help page to help you debug:
2019-09-12 02:22:42,865: https://help.pythonanywhere.com/pages/DebuggingImportError/
panther101
@panther101
Hi
I am a bit new to Django and am struggling with settings.py to allow other hosts to access my development server running on Windows 10.
I have tried ALLOWED_HOSTS=['*'] to allow all hosts to access the Django. It didn't work.
I have no problem running and accessing on the same server, though.
Any help would be much appreciated. Thank you.
Piotr Niełacny
@LTe
@mmichaud3 you can show your setting.py?
@panther101 it depends also on your DEBUG flag. Based on documentation ALLOWED_HOSTS = ['*'] should be fine but only in case of DEBUG = False. But you can try also add 0.0.0.0. This address means that you will allow to connect from any address IP.
matrixbot
@matrixbot
abhisingh510 He guys I am new to django, and I have a project which requires me to run a script in backend (Linux server) can some help how to do it
panther101
@panther101
I got it working. The way I got it resolved is by creating new venv and copying/pasting files with a new project and app name.
The working setup has following configuration in the settings.py:
Allowed_Hosts=[‘*’] and DEBUG=True because it’s my development env. Also, start the Django with “python manage.py runserver 0.0.0.0:8000”. This allows all ip addresses in LAN and WAN (if setup right through your router port forwarding and NAT setup) to access your Django app.
panther101
@panther101
I tried copying the working settings.py onto the not working environment and it still did not resolve the problem. Problem being that I can run and browse Django locally but not from another PC or smart phone/tablet on the same LAN or WAN. By the way this also resolved my issue with making an HTTP Get from micro-controller. FYI- In the troubled environment, I could see the TCP connection requests coming from another PC on the same LAN but Django hosting PC would never reply back. Eventually, the request times out.
I would still like like to get to the root cause of the problem. This can happen again and no one can afford to re-install the whole setup.
Thank you
liulifeng02
@liulifeng02
very good
Dao Wang
@lava1206
Hello, everybody
I am a django newbie and I have a problem
I have cloned a django project from github
How can I run this project in local env?
I am get stuck
Please, give me your opinion
Harsha Vardhan
@harsha547
What is the project that you cloned
Dao Wang
@lava1206
this is the link of tutorial:https://www.techiediaries.com/vue-axios-tutorial/
and this is the link of django backend:https://github.com/techiediaries/django-crm
I followed the tutorial
as I run this command pipenv install, I get a error "Warning: Python 3.5 was not found on your system…
You can specify specific versions of Python with:
$ pipenv --python path\to\python"
Harsha Vardhan
@harsha547
Can you check python version by running following command
python -version
Dao Wang
@lava1206
yeah, my current version is 3.7.4
Do I have to install another version of python?
I mean 3.5
mmichaud3
@mmichaud3
@LTe

"""
Django settings for mysite project.

Generated by 'django-admin startproject' using Django 2.2.5.

For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""

import os

Build paths inside the project like this: os.path.join(BASE_DIR, ...)

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

Quick-start development settings - unsuitable for production

See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/

SECURITY WARNING: keep the secret key used in production secret!

SECRET_KEY = 'bssp^c8sr2&49v0$w7ht29h!9b0aw=!)z(orxt%3te1v_20$'

SECURITY WARNING: don't run with debug turned on in production!

DEBUG = True

ALLOWED_HOSTS = ['127.0.0.1', '.pythonanywhere.com']

Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'blog.apps.BlogConfig',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'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 = 'mysite.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 = 'mysite.wsgi.application'

Database

https://docs.djangoproject.com/en/2.2/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}

Password validation

https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators

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',
},
]

Internationalization

https://docs.djangoproject.com/en/2.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'America/New_York'

USE_I18N = True

USE_L10N = True

USE_TZ = True

Static files (CSS, JavaScript, Images)

https://docs.djangoproject.com/en/2.2/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')

Ashwin Kumar
@ashwin31
@lava1206 look into https://github.com/MicroPyramid/Django-CRM to know more.
Abd017
@Abd017
(myvenv) C:\Users\Administrator\djangogirls>pyhton manage.py makemigrations blog
'pyhton' is not recognized as an internal or external command,
operable program or batch file.
hey why i'm getting this error
Abd017
@Abd017

(myvenv) C:\Users\Administrator\djangogirls>python manage.py makemigrations blog
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\Administrator\djangogirls\myvenv\lib\site-packages\django\core\management__init.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\Administrator\djangogirls\myvenv\lib\site-packages\django\core\management\
init.py", line 357, in execute
django.setup()
File "C:\Users\Administrator\djangogirls\myvenv\lib\site-packages\django\
init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\Administrator\djangogirls\myvenv\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\Administrator\djangogirls\myvenv\lib\site-packages\django\apps\config.py", line 116, in create
mod = import_module(mod_path)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\importlib\
init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'blog.app'

I'm getting this error, someone, please help me.

Harsha Vardhan
@harsha547
@Abd017 you might have to add python executable to PATH variable
Piotr Niełacny
@LTe
@mmichaud3 are you sure about this 'blog.apps.BlogConfig'? Maybe you can share your git repository?
@Abd017 make sure you type python not pyhton
@Abd017 are you sure that you generated application in Django names blog?
JulieLePalabe
@JulieLePalabe
Hi there, I curently doing the django tutorial. I have trouble connecting the post_list.html file with the static css blog file. Any help would be welcome :)