-1

​I'm having an issue with my site, in making and incorporating a second app. The first works perfectly. You can see the demo site here: http://216.158.236.51​​​ but when I try to visit the new url pages created http://216.158.236.51/​signup for example, it just gives me a HTTP 404 response. It gives me a 404 for both the new app pages and for other new pages created within the first app.

I'm pretty sure I did everything correctly from the django side. Not sure if I have to reload the nginx or gunicorn, or what backend problems there are... any advice would be great.

My url patterns look like this:

from django.conf.urls import url, include

from django.contrib import admin

from blackcrowtours import views

from accounts import views

from django.conf.urls.static import static

from django.conf import settings

urlpatterns = [

    url(r'^admin/', admin.site.urls),
    url(r'^accounts/', include('accounts.urls'), name='accounts'),
    url(r'^signup/', accounts.views.signup, name='signup'),
    url(r'^$', views.home, name='home'),
    url(r'^yourtrips/', views.yourtrips, name='yourtrips'),
    url(r'^about/', views.about, name='about'),
    url(r'^whyus/', views.whyus, name='whyus'),
    url(r'^accommodations/', views.accommodations, name='accommodations'),
    url(r'^yourguides/', views.yourguides, name='yourguides'),
    url(r'^westerneurotrip/', views.westerneurotrip, name='westerneurotrip'),
    url(r'^contact/', views.contact, name='contact'),

] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

account app views

from django.shortcuts import render

from django.contrib.auth.models import User

from django.contrib.auth import authenticate, login

def signup(request):
return render(request, 'accounts/signup.html') 

account app urls

from django.conf.urls import url
from . import views

app_name = 'accounts'

urlpatterns = [

    url(r'^signup/', views.signup, name='signup'),
    url(r'^login/', views.loginview, name='login'),

]   

blackcrowtours app views

from django.shortcuts import render


def home(request):
    return render (request, 'blackcrowtours/home.html',)

def yourtrips(request):
    return render (request, 'blackcrowtours/yourtrips.html',)

def about(request):
    return render (request, 'blackcrowtours/about.html',)

def whyus(request):
    return render (request, 'blackcrowtours/whyus.html',)

def accommodations(request):
    return render (request, 'blackcrowtours/accommodations.html',)

def yourguides(request):
    return render (request, 'blackcrowtours/yourguides.html',)

def westerneurotrip(request):
    return render (request, 'blackcrowtours/westerneurotrip.html',)

def contact(request):
    return render (request, 'blackcrowtours/contact.html',)

All of those views work EXCEPT for the contact url which I just added after the fact.

Matze
  • 5,100
  • 6
  • 46
  • 69
Kyle
  • 11
  • urm... I gather you aren't using runserver. Under runserver, django automatically reloads whenever you change the files. But if you're running a regular web server with wsgi links to django (or fastcgi, or whatever), then you need to reload your webserver or your wsgi server. – zBeeble Mar 03 '17 at 17:53

1 Answers1

0

How does your app.py file look like. Have you added new/ second app in INSTALLED_APPS ?

oshaiken
  • 2,593
  • 1
  • 15
  • 25