title: Django-React/Redux-Apache project: Can't resolve url
body: <p>first time building a web app. decided to use django/react with redux and django rest framework for api routing and component state. decided to implement apache as a production server and test locally. when I used the django development server everything worked fine but when I switched to apache I hit an issue.</p>
  <p>I can get the static content to display at the root url &quot;http://localhost&quot; but can't get any further urls to resolve. On the main page of this app there's a component that, when it mounts, calls a url (GET) &quot;.../api/buildings&quot; to populate the component with some data but the server responds with a 404 or 500 but didn't when I used django dev server.</p>
  <p>I can't figure out what I'm doing wrong and seeing as I'm pretty new to this I'd appreciate some help!</p>
  <p>here's some code references and lmk if I can provide anything else. thanks in advance!</p>
  <p>building component that makes the call during mount:</p>
  <pre><code>export class Buildings extends Component {
      static propTypes = {
          buildings: PropTypes.array.isRequired,
          getBuildings: PropTypes.func.isRequired,
          deleteBuildings: PropTypes.func.isRequired,
      };
  
      componentDidMount() {
          this.props.getBuildings();
      };
      render() {
          return (
              &lt;Fragment&gt;
                  &lt;h2&gt;Buildings&lt;/h2&gt;
                  &lt;table className=&quot;table table-striped&quot;&gt;
                      &lt;thead&gt;
                          &lt;tr&gt;
                              &lt;th&gt;Id&lt;/th&gt;
                              &lt;th&gt;Name&lt;/th&gt;
                              &lt;th&gt;Code&lt;/th&gt;
                              &lt;th&gt;Last_Inspection&lt;/th&gt;
                              &lt;th /&gt;
                          &lt;/tr&gt;
                      &lt;/thead&gt;
                      &lt;tbody&gt;
                          {this.props.buildings.map(b =&gt; (
                              &lt;tr key={b.code}&gt;
                                  &lt;td&gt;{b.id}&lt;/td&gt;
                                  &lt;td&gt;{b.name}&lt;/td&gt;
                                  &lt;td&gt;{b.code}&lt;/td&gt;
                                  &lt;td&gt;{b.last_inspection}&lt;/td&gt;
                                  &lt;td&gt;&lt;button onClick={this.props.deleteBuildings.bind(this, b.id)} className=&quot;btn btn-danger btn-sm&quot;&gt;delete&lt;/button&gt;&lt;/td&gt;
                              &lt;/tr&gt;
                          ))}
                      &lt;/tbody&gt;
                  &lt;/table&gt;
              &lt;/Fragment&gt;
          )
      }
  }
  
  const mapStateToProps = state =&gt; ({
      buildings: state.buildings.buildings
  });
  
  // gives access to this.props.deleteBuildings()
  export default connect(mapStateToProps, { getBuildings, deleteBuildings })(Buildings);
  </code></pre>
  <p>getBuilding action (axios call):</p>
  <pre><code>export const getBuildings = () =&gt; dispatch =&gt; {
      axios.get('/api/buildings/').then(res =&gt; {
          dispatch({
              type: GET_BUILDINGS,
              payload: res.data
          });
      }).catch(err =&gt; console.log(err));
  }
  </code></pre>
  <p>urls.py for root dir:</p>
  <pre><code>from django.urls import path, include
  
  urlpatterns = [
      path('', include('frontend.urls')),
      path('', include('buildings.urls'))
  ]
  </code></pre>
  <p>urls.py for &quot;/api/buildings/&quot;:</p>
  <pre><code>router = routers.DefaultRouter()
  router.register('api/buildings/', BuildingViewSet, 'buildings')
  
  urlpatterns = router.urls
  </code></pre>
  <p>apache config (default httpd.conf with this at the end):</p>
  <pre><code># Django Project
  LoadFile &quot;a:/apps/python3/python38.dll&quot;
  LoadModule wsgi_module &quot;a:/apps/python3/lib/site-packages/mod_wsgi/server/mod_wsgi.cp38-win_amd64.pyd&quot;
  WSGIPythonHome &quot;a:/apps/python3&quot;
  WSGIScriptAlias / &quot;A:/stuff/projects/django_react/leadmanager/leadmanager/wsgi.py/&quot;
  WSGIPythonPath &quot;A:/stuff/projects/django_react/leadmanager/&quot;
  
  &lt;Directory &quot;A:/stuff/projects/django_react/leadmanager/leadmanager/&quot;&gt;
      &lt;Files wsgi.py&gt;
          Require all granted
      &lt;/Files&gt;
  &lt;/Directory&gt;
  
  Alias /static/ &quot;A:/stuff/projects/django_react/leadmanager/frontend/static/&quot;
  &lt;Directory &quot;A:/stuff/projects/django_react/leadmanager/frontend/static/&quot;&gt;
      Require all granted
  &lt;/Directory&gt;
  </code></pre>
  <p>using this tutorial: <a href="https://www.youtube.com/watch?v=Uyei2iDA4Hs&amp;t=404s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=Uyei2iDA4Hs&amp;t=404s</a></p>