Hello, i am getting a value error (from ..accounts.models import User.
ValueError: attempted relative import beyond top-level package) while
trying to import my custom user model, i have read through some post
suggesting i create a root folder for my project, I would like to know if
that
Another problem now..
I don't know why,
in local
localhost:8000/sitemap.xml will generate sitemap.xml.
But on heroku,
domain/sitemap.xml will error h13.
Any suggestions?
Thanks.
On Wed, Sep 9, 2020 at 11:31 AM hans alexander wrote:
> Thanks guys.. Already solved it.
> I guess the main reason
Thanks guys.. Already solved it.
I guess the main reason of the problem is that I'm using Pycharm Community
Edition.
So the alert error not accurate.
Anyway I tried to py manage.py with some alerts, and worked.
for example:
[image: image.png]
I left it like that. And sitemap still works.
But now
I did this long time ago and here is what i did...
in settings.py
SITE_ID = 1
# Application definition
INSTALLED_APPS = [
# ...
'django.contrib.sites',
'django.contrib.sitemaps',
]
run migration i.e.
>>> py manage.py migrateOR python manage.py migrate
aft
I followed a tutorial for creating django sitemap, but still got problems
along the way.
I've seen some videos, but didn't work.
Do you have any references for easy way creating django sitemap for blog
posts?
Sure it would help.
Thanks
On Wed, Sep 9, 2020 at 12:02 AM coolguy
wrote:
> Not sure
Not sure why you are importing this into your main project urls.py but its
very straight forward
from blog.sitemaps import BlogPostsSitemap
question... are you trying to map the application url here? then you should
use path('/' , Include("blog.urls"))
On Tuesday, September 8, 2020 at 4
Sorry, point no 1 needs to be revised..
1. In urls.py, I want to import BlogPostsSitemap
--
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...
then I got an error "ValueError: attempted relative import beyond
top-level package" when I ran the server.
Is anyone here got the solution? Or maybe some references how to
create sitemap on django?
Thanks.
--
You received this message because you are subscribed to the Google Groups
]
>
>
> ValueError: attempted relative import beyond top-level package
> How to fix it in django?
> I have this in AppTwo.views
> def index(request):
> return HttpResponse("My Second Project")
>
>
>
>
> --
> You received this message
Settings.py:
“../apptwo” ==> “appTwo.apps.apptwoconfig”,
发自我的 空间传送门
> 在 2019年3月3日,上午5:25,Bulgarian seller 写道:
>
> from ..appTwo import views
> urlpatterns = [
> path('',views.index),
> path('admin/', admin.site.urls),
> ]
>
>
> V
from ..appTwo import views
urlpatterns = [
path('',views.index),
path('admin/', admin.site.urls),
]
ValueError: attempted relative import beyond top-level package
How to fix it in django?
I have this in AppTwo.views
def index(request):
return HttpRespons
11 matches
Mail list logo